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

Also available in: Atom PDF