]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: notify clients about deleted inode
authorYan, Zheng <zheng.z.yan@intel.com>
Sun, 21 Jul 2013 02:21:13 +0000 (10:21 +0800)
committerSage Weil <sage@inktank.com>
Fri, 9 Aug 2013 05:29:59 +0000 (22:29 -0700)
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 <zheng.z.yan@intel.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/mds/Locker.cc

index 084d64aeb9c8c8206fd6226578ec028d001b719b..99bd761e0f7c3b77a646511253f2d78d244a2382 100644 (file)
@@ -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