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.
Fixes: http://tracker.ceph.com/issues/17939
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit
532dc4b68e538c189ef828f67cecd0d647a62250)
if (vxattr) {
r = -ENODATA;
- char buf[256];
+ // Do a force getattr to get the latest quota before returning
+ // a value to userspace.
+ r = _getattr(in, 0, perms, true);
+ if (r != 0) {
+ // Error from getattr!
+ return r;
+ }
+
// call pointer-to-member function
- if (!(vxattr->exists_cb && !(this->*(vxattr->exists_cb))(in)))
+ char buf[256];
+ if (!(vxattr->exists_cb && !(this->*(vxattr->exists_cb))(in))) {
r = (this->*(vxattr->getxattr_cb))(in, buf, sizeof(buf));
+ } else {
+ r = -ENODATA;
+ }
if (size != 0) {
if (r > (int)size) {