Project

General

Profile

Bug #49833

MDS should return -ENODATA when asked to remove xattr that doesn't exist

Added by Jeff Layton about 1 month ago. Updated about 9 hours ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
-
Target version:
% Done:

0%

Source:
Development
Tags:
Backport:
pacific,octopus,nautilus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
MDS
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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.


Related issues

Duplicated by CephFS - Bug #49873: ceph_lremovexattr does not return error on file in ceph pacific Duplicate
Copied to CephFS - Backport #49931: octopus: MDS should return -ENODATA when asked to remove xattr that doesn't exist Rejected
Copied to CephFS - Backport #49932: pacific: MDS should return -ENODATA when asked to remove xattr that doesn't exist Resolved
Copied to CephFS - Backport #49933: nautilus: MDS should return -ENODATA when asked to remove xattr that doesn't exist Rejected

History

#1 Updated by Patrick Donnelly about 1 month 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

#2 Updated by Jeff Layton about 1 month ago

  • Assignee changed from Sidharth Anupkrishnan to Jeff Layton

I'll take this one since I have a patch (and testcase).

#3 Updated by Jeff Layton about 1 month ago

  • Pull request ID set to 40158

#4 Updated by Patrick Donnelly about 1 month ago

  • Status changed from Triaged to Fix Under Review

#5 Updated by Patrick Donnelly 30 days ago

  • Status changed from Fix Under Review to Pending Backport
  • Backport changed from pacific,octopus to pacific,octopus,nautilus

#6 Updated by Backport Bot 30 days ago

  • Copied to Backport #49931: octopus: MDS should return -ENODATA when asked to remove xattr that doesn't exist added

#7 Updated by Backport Bot 30 days ago

  • Copied to Backport #49932: pacific: MDS should return -ENODATA when asked to remove xattr that doesn't exist added

#8 Updated by Backport Bot 30 days ago

  • Copied to Backport #49933: nautilus: MDS should return -ENODATA when asked to remove xattr that doesn't exist added

#9 Updated by Nathan Cutler 12 days 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.

#10 Updated by Nathan Cutler 12 days 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.

#11 Updated by Patrick Donnelly 9 days ago

  • Duplicated by Bug #49873: ceph_lremovexattr does not return error on file in ceph pacific added

#12 Updated by Sidharth Anupkrishnan 7 days 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.

#13 Updated by Loïc Dachary about 9 hours 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".

Also available in: Atom PDF