]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: update ctime on setattr(no mask)
authorSage Weil <sage@newdream.net>
Sat, 3 Jul 2010 04:28:56 +0000 (21:28 -0700)
committerSage Weil <sage@newdream.net>
Sat, 3 Jul 2010 04:28:56 +0000 (21:28 -0700)
This makes pjd happy (chown -1 -1 should bump ctime, apparently).  The
kclient does the same trick: dirty any excl caps we have, otherwise do an
mds setattr(ctime) request.

Signed-off-by: Sage Weil <sage@newdream.net>
src/client/Client.cc

index 8b9bc76628f85c5e55f2804e909045625bb5a2a2..18524b96256d64ee0024a4bd00f803fdbed7779f 100644 (file)
@@ -3423,6 +3423,20 @@ int Client::_setattr(Inode *in, struct stat_precise *attr, int mask, int uid, in
   dout(10) << "_setattr mask " << mask << " issued " << ccap_string(issued) << dendl;
 
   // make the change locally?
+
+  if (!mask) {
+    // caller just needs us to bump the ctime
+    in->ctime = g_clock.now();
+    if (issued & CEPH_CAP_AUTH_EXCL)
+      mark_caps_dirty(in, CEPH_CAP_AUTH_EXCL);
+    else if (issued & CEPH_CAP_FILE_EXCL)
+      mark_caps_dirty(in, CEPH_CAP_FILE_EXCL);
+    else if (issued & CEPH_CAP_XATTR_EXCL)
+      mark_caps_dirty(in, CEPH_CAP_XATTR_EXCL);
+    else
+      mask |= CEPH_SETATTR_CTIME;
+  }
+
   if (in->caps_issued_mask(CEPH_CAP_AUTH_EXCL)) {
     if (mask & CEPH_SETATTR_MODE) {
       in->ctime = g_clock.now();