From: Sage Weil Date: Wed, 11 Nov 2009 23:47:28 +0000 (-0800) Subject: mds: force rdlock on any snapped inodes X-Git-Tag: v0.18~121^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a600b2e8929eb1d36c2fd52bc8d93fa864b3c69a;p=ceph.git mds: force rdlock on any snapped inodes 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. --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 71dfe9a689df..2e816e8238ff 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -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;