From a600b2e8929eb1d36c2fd52bc8d93fa864b3c69a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 11 Nov 2009 15:47:28 -0800 Subject: [PATCH] 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. --- src/mds/Server.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 71dfe9a689df1..2e816e8238ff0 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; -- 2.39.5