From ca3987fff1928cd6b74a969a68ba62f79a900550 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Sun, 21 Jul 2013 10:21:13 +0800 Subject: [PATCH] mds: notify clients about deleted inode To make sure clients trim the deleted inode from the their cache ASAP. After all clients release the inode, we can reclaim space. Signed-off-by: Yan, Zheng Reviewed-by: Sage Weil --- src/mds/Locker.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 084d64aeb9c..99bd761e0f7 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -1777,6 +1777,10 @@ bool Locker::issue_caps(CInode *in, Capability *only_cap) continue; } + // notify clients about deleted inode, to make sure they release caps ASAP. + if (in->inode.nlink == 0) + wanted |= CEPH_CAP_LINK_SHARED; + // are there caps that the client _wants_ and can have, but aren't pending? // or do we need to revoke? if (((wanted & allowed) & ~pending) || // missing wanted+allowed caps