]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-shell: Remove extra length argument passed to setxattr()
authorVarsha Rao <varao@redhat.com>
Wed, 9 Oct 2019 06:00:06 +0000 (11:30 +0530)
committerVarsha Rao <varao@redhat.com>
Sat, 28 Dec 2019 12:25:40 +0000 (17:55 +0530)
Length is computed before calling ceph_setxattr() in setxattr() definition.

Fixes: https://tracker.ceph.com/issues/42238
Signed-off-by: Varsha Rao <varao@redhat.com>
src/tools/cephfs/cephfs-shell

index 5bcc7a8f7b3df6baa1c0a3305bc6a8fd36366734..177dd65356215afd6d4ac516ead0a1cf152d62ed 100755 (executable)
@@ -1258,13 +1258,11 @@ class CephFSShell(Cmd):
                 max_bytes = to_bytes(str(args.max_bytes))
                 try:
                     cephfs.setxattr(args.path, 'ceph.quota.max_bytes',
-                                    max_bytes, len(max_bytes),
-                                    os.XATTR_CREATE)
+                                    max_bytes, os.XATTR_CREATE)
                     poutput('max_bytes set to %d' % args.max_bytes)
                 except libcephfs.Error:
                     cephfs.setxattr(args.path, 'ceph.quota.max_bytes',
-                                    max_bytes, len(max_bytes),
-                                    os.XATTR_REPLACE)
+                                    max_bytes, os.XATTR_REPLACE)
                     perror('max_bytes reset to %d' % args.max_bytes)
                     self.exit_code = 1
 
@@ -1272,13 +1270,11 @@ class CephFSShell(Cmd):
                 max_files = to_bytes(str(args.max_files))
                 try:
                     cephfs.setxattr(args.path, 'ceph.quota.max_files',
-                                    max_files, len(max_files),
-                                    os.XATTR_CREATE)
+                                    max_files, os.XATTR_CREATE)
                     poutput('max_files set to %d' % args.max_files)
                 except libcephfs.Error:
                     cephfs.setxattr(args.path, 'ceph.quota.max_files',
-                                    max_files, len(max_files),
-                                    os.XATTR_REPLACE)
+                                    max_files, os.XATTR_REPLACE)
                     perror('max_files reset to %d' % args.max_files)
                     self.exit_code = 1
         elif args.op == 'get':