Skip to content

Commit

Permalink
mds: notify clients about deleted inode
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Sage Weil <[email protected]>
  • Loading branch information
Yan, Zheng authored and Sage Weil committed Aug 9, 2013
1 parent 151e6d2 commit ca3987f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mds/Locker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ca3987f

Please sign in to comment.