From: Yan, Zheng Date: Wed, 14 Jun 2017 07:54:56 +0000 (+0800) Subject: ceph: getattr before read on ceph.* xattrs X-Git-Tag: v4.13-rc1~58^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1684dd03e9f59212775cafa50ea77b9ef5b263db;p=platform%2Fkernel%2Flinux-exynos.git ceph: getattr before read on ceph.* xattrs 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" Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index 75267cd..11263f1 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c @@ -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);