Bug #49833
closed
MDS should return -ENODATA when asked to remove xattr that doesn't exist
Added by Jeff Layton about 3 years ago.
Updated about 3 years ago.
Backport:
pacific,octopus,nautilus
Description
This patch adds a small gtest that shows that the handling of removexattr is wrong:
diff --git a/src/test/libcephfs/test.cc b/src/test/libcephfs/test.cc
index e74e99740979..f14a4605e137 100644
--- a/src/test/libcephfs/test.cc
+++ b/src/test/libcephfs/test.cc
@@ -540,6 +540,9 @@ TEST(LibCephFS, Xattrs) {
int fd = ceph_open(cmount, test_xattr_file, O_CREAT, 0666);
ASSERT_GT(fd, 0);
+ // test removing non-existent xattr
+ ASSERT_EQ(-ENODATA, ceph_removexattr(cmount, test_xattr_file, "user.nosuchxattr"));
+
char i = 'a';
char xattrk[128];
char xattrv[128];
libcephfs always does a synchronous RMXATTR call to the MDS for a removexattr. In the kclient, this is mostly papered over by the fact that we usually handle the removal locally when we have Xx caps, so we only rarely do a synchronous call to the MDS there.
- Status changed from New to Triaged
- Assignee set to Sidharth Anupkrishnan
- Priority changed from Normal to High
- Target version set to v17.0.0
- Source set to Development
- Backport set to pacific,octopus
- Component(FS) MDS added
- Assignee changed from Sidharth Anupkrishnan to Jeff Layton
I'll take this one since I have a patch (and testcase).
- Pull request ID set to 40158
- Status changed from Triaged to Fix Under Review
- Status changed from Fix Under Review to Pending Backport
- Backport changed from pacific,octopus to pacific,octopus,nautilus
- Copied to Backport #49931: octopus: MDS should return -ENODATA when asked to remove xattr that doesn't exist added
- Copied to Backport #49932: pacific: MDS should return -ENODATA when asked to remove xattr that doesn't exist added
- Copied to Backport #49933: nautilus: MDS should return -ENODATA when asked to remove xattr that doesn't exist added
@Patrick, you requested that this bugfix be backported to nautilus, but AFAICT the line that introduced the bug is not present in nautilus. Therefore, I'm setting the nautilus backport "Need More Info" and assigning it to you.
@Patrick, you requested that this bugfix be backported to octopus, but AFAICT the line that introduced the bug is not present in octopus. Therefore, I'm setting the octopus backport "Need More Info" and assigning it to you.
- Has duplicate Bug #49873: ceph_lremovexattr does not return error on file in ceph pacific added
- Status changed from Pending Backport to Resolved
While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".
Also available in: Atom
PDF