From ac0314436a5bc6903a90bbd43f8ef5d7aa25b113 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 3 Sep 2015 13:41:43 -0400 Subject: [PATCH] client: clarify setattr forced sync behavior Signed-off-by: Sage Weil --- src/client/Client.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/client/Client.cc b/src/client/Client.cc index b1da7a896bb04..669a835a1f3ec 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; -- 2.47.3