Bug #49833
closedMDS should return -ENODATA when asked to remove xattr that doesn't exist
0%
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.
Updated by Patrick Donnelly about 3 years ago
- 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
Updated by Jeff Layton about 3 years ago
- Assignee changed from Sidharth Anupkrishnan to Jeff Layton
I'll take this one since I have a patch (and testcase).
Updated by Patrick Donnelly about 3 years ago
- Status changed from Triaged to Fix Under Review
Updated by Patrick Donnelly about 3 years ago
- Status changed from Fix Under Review to Pending Backport
- Backport changed from pacific,octopus to pacific,octopus,nautilus
Updated by Backport Bot about 3 years ago
- Copied to Backport #49931: octopus: MDS should return -ENODATA when asked to remove xattr that doesn't exist added
Updated by Backport Bot about 3 years ago
- Copied to Backport #49932: pacific: MDS should return -ENODATA when asked to remove xattr that doesn't exist added
Updated by Backport Bot about 3 years ago
- Copied to Backport #49933: nautilus: MDS should return -ENODATA when asked to remove xattr that doesn't exist added
Updated by Nathan Cutler about 3 years ago
@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.
Updated by Nathan Cutler about 3 years ago
@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.
Updated by Patrick Donnelly about 3 years ago
- Has duplicate Bug #49873: ceph_lremovexattr does not return error on file in ceph pacific added
Updated by Sidharth Anupkrishnan about 3 years ago
I don't think this should be backported to octopus and nautilus since the change that introduced the incorrect handling was https://github.com/ceph/ceph/pull/36603/commits/a641e3c7600c7323532f95641a4b229c29985d55 and that commit is not present in octopus and nautilus.
Updated by Loïc Dachary about 3 years ago
- 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".