[PATCH] Ceph: Make sure stale dentries should be unhashed successfully in time.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Prior to kernel v3.19, d_invalidate() might not unhash stale dentries due to reference count,
so the stale dentries are left in the memory, causing a delayed expiration.

Fixes: http://tracker.ceph.com/issues/23097

Signed-off-by: Yupeng Chen <chenyupeng-it@xxxxxx>
---
 fs/ceph/inode.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index c6ec5aa..70a38f2 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1345,6 +1345,10 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req)
 			     dn, d_inode(dn), ceph_vinop(d_inode(dn)),
 			     ceph_vinop(in));
 			d_invalidate(dn);
+			/* Prito to v3.19,d_invalidate might unhash the dentry unsuccessfully.*/
+			if (!d_unhashed(dn)) {
+				d_drop(dn);
+			}
 			have_lease = false;
 		}
 
-- 
1.8.3.1
?韬{.n?????%??檩??w?{.n????u朕?Ф?塄}?财??j:+v??????2??璀??摺?囤??z夸z罐?+?????w棹f




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux