]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: force rdlock on any snapped inodes
authorSage Weil <sage@newdream.net>
Wed, 11 Nov 2009 23:47:28 +0000 (15:47 -0800)
committerSage Weil <sage@newdream.net>
Wed, 11 Nov 2009 23:47:28 +0000 (15:47 -0800)
When the client has an excl lock on an inode, and it's
stating a snapped version of it, we can't expect it to
put 2 and 2 together and look at it's head metadata.  If
the cap does not follow the snapid we're trying to stat, do
the full rdlock to force the snapped values back to the
mds so we can do the cow.

If there is nothing cow, the cap will get reissued with an
accurate follows value, and we won't have to do this again.

src/mds/Server.cc

index 71dfe9a689df1716a879c1c243a74fd5a576e8dc..2e816e8238ff044e52f58a334445ea5a03a0e72a 100644 (file)
@@ -1816,7 +1816,8 @@ void Server::handle_client_stat(MDRequest *mdr)
   client_t client = mdr->get_client();
   int issued = 0;
   Capability *cap = ref->get_client_cap(client);
-  if (cap)
+  if (cap && (mdr->snapid == CEPH_NOSNAP ||
+             mdr->snapid <= cap->client_follows))
     issued = cap->issued();
 
   int mask = req->head.args.getattr.mask;