Project

General

Profile

Actions

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.

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 4 (0 open4 closed)

Has duplicate CephFS - Bug #49873: ceph_lremovexattr does not return error on file in ceph pacificDuplicateSidharth Anupkrishnan

Actions
Copied to CephFS - Backport #49931: octopus: MDS should return -ENODATA when asked to remove xattr that doesn't existRejectedPatrick DonnellyActions
Copied to CephFS - Backport #49932: pacific: MDS should return -ENODATA when asked to remove xattr that doesn't existResolvedPatrick DonnellyActions
Copied to CephFS - Backport #49933: nautilus: MDS should return -ENODATA when asked to remove xattr that doesn't existRejectedPatrick DonnellyActions
Actions #1

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
Actions #2

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).

Actions #3

Updated by Jeff Layton about 3 years ago

  • Pull request ID set to 40158
Actions #4

Updated by Patrick Donnelly about 3 years ago

  • Status changed from Triaged to Fix Under Review
Actions #5

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
Actions #6

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
Actions #7

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
Actions #8

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
Actions #9

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.

Actions #10

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.

Actions #11

Updated by Patrick Donnelly about 3 years ago

  • Has duplicate Bug #49873: ceph_lremovexattr does not return error on file in ceph pacific added
Actions #12

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.

Actions #13

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".

Actions

Also available in: Atom PDF