]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: clarify setattr forced sync behavior
authorSage Weil <sage@redhat.com>
Thu, 3 Sep 2015 17:41:43 +0000 (13:41 -0400)
committerSage Weil <sage@redhat.com>
Thu, 1 Oct 2015 13:42:37 +0000 (09:42 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/client/Client.cc

index b1da7a896bb046d4ac8ceedaf39ba8d1a4e8daf0..669a835a1f3ecfff6252e32674b14169ca0070aa 100644 (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;