From: Sage Weil Date: Thu, 3 Sep 2015 17:41:43 +0000 (-0400) Subject: client: clarify setattr forced sync behavior X-Git-Tag: v10.0.0~123^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ac0314436a5bc6903a90bbd43f8ef5d7aa25b113;p=ceph.git client: clarify setattr forced sync behavior Signed-off-by: Sage Weil --- diff --git a/src/client/Client.cc b/src/client/Client.cc index b1da7a896bb..669a835a1f3 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -5807,6 +5807,17 @@ int Client::_setattr(Inode *in, struct stat *attr, int mask, int uid, int gid, << " != cap dirtier " << in->cap_dirtier_uid << ":" << in->cap_dirtier_gid << ", forcing sync setattr" << dendl; + /* + * This works because we implicitly flush the caps as part of the + * request, so the cap update check will happen with the writeback + * cap context, and then the setattr check will happen with the + * caller's context. + * + * In reality this pattern is likely pretty rare (different users + * setattr'ing the same file). If that turns out not to be the + * case later, we can build a more complex pipelined cap writeback + * infrastructure... + */ if (!mask) mask |= CEPH_SETATTR_CTIME; goto force_request;