]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: properly trim unlinked inode 7297/head
authorYan, Zheng <zyan@redhat.com>
Wed, 20 Jan 2016 14:22:01 +0000 (22:22 +0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 20 Jan 2016 14:34:49 +0000 (22:34 +0800)
Client should trim inode from its cache when receiving a cap message
with nlink == 0. But the corresponding code has a bug, it does nothing
when inode's nlink is already 0.

Fixes: #13903
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/client/Client.cc

index 5412e0c0190f78116a745e151da6c5e81b608c2b..13c3233faf5c9101ae155c93a83288f8b59996d3 100644 (file)
@@ -4658,7 +4658,7 @@ void Client::handle_cap_grant(MetaSession *session, Inode *in, Cap *cap, MClient
     in->gid = m->head.gid;
   }
   bool deleted_inode = false;
-  if ((issued & CEPH_CAP_LINK_EXCL) == 0 && in->nlink != (int32_t)m->head.nlink) {
+  if ((issued & CEPH_CAP_LINK_EXCL) == 0) {
     in->nlink = m->head.nlink;
     if (in->nlink == 0 &&
        (new_caps & (CEPH_CAP_LINK_SHARED | CEPH_CAP_LINK_EXCL)))