]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ceph: getattr before read on ceph.* xattrs
authorYan, Zheng <zyan@redhat.com>
Wed, 14 Jun 2017 07:54:56 +0000 (15:54 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 7 Jul 2017 15:25:13 +0000 (17:25 +0200)
Previously we were returning values for quota, layout
xattrs without any kind of update -- the user just got
whatever happened to be in our cache.

Clearly this extra round trip has a cost, but reads of
these xattrs are fairly rare, happening on admin
intervention rather than in normal operation.

Link: http://tracker.ceph.com/issues/17939
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/xattr.c

index 75267cdd5dfd822b3290221b269cb0fde64a8e83..11263f102e4c914eaf849c39a35c95e33eefe3c6 100644 (file)
@@ -756,6 +756,9 @@ ssize_t __ceph_getxattr(struct inode *inode, const char *name, void *value,
        /* let's see if a virtual xattr was requested */
        vxattr = ceph_match_vxattr(inode, name);
        if (vxattr) {
+               err = ceph_do_getattr(inode, 0, true);
+               if (err)
+                       return err;
                err = -ENODATA;
                if (!(vxattr->exists_cb && !vxattr->exists_cb(ci)))
                        err = vxattr->getxattr_cb(ci, value, size);