Skip to content

Commit 7ffe4fc

Browse files
lxbszidryomov
authored andcommitted
ceph: update the dlease for the hashed dentry when removing
The MDS will always refresh the dentry lease when removing the files or directories. And if the dentry is still hashed, we can update the dentry lease and no need to do the lookup from the MDS later. Signed-off-by: Xiubo Li <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 546a5d6 commit 7ffe4fc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/ceph/inode.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,10 +1466,12 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req)
14661466
} else if (have_lease) {
14671467
if (d_unhashed(dn))
14681468
d_add(dn, NULL);
1469+
}
1470+
1471+
if (!d_unhashed(dn) && have_lease)
14691472
update_dentry_lease(dir, dn,
14701473
rinfo->dlease, session,
14711474
req->r_request_started);
1472-
}
14731475
goto done;
14741476
}
14751477

0 commit comments

Comments
 (0)