1
0
mirror of https://github.com/ceph/ceph synced 2024-12-25 21:03:31 +00:00

client: clarify setattr forced sync behavior

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2015-09-03 13:41:43 -04:00
parent 527241699d
commit ac0314436a

View File

@ -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;