summaryrefslogtreecommitdiff
path: root/fs/ceph
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2022-03-30 07:21:12 +0300
committerIlya Dryomov <idryomov@gmail.com>2022-05-25 21:45:13 +0300
commit7ffe4fcea789552fac47216188f30559c329c847 (patch)
treea0fd34389dd0f5670055d734c8c68e4178c4f066 /fs/ceph
parent546a5d6122faae161cb59159e8af8518130efeab (diff)
downloadlinux-7ffe4fcea789552fac47216188f30559c329c847.tar.xz
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 <xiubli@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/inode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 63113e2a4890..f9b68b2c9b12 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1466,10 +1466,12 @@ retry_lookup:
} else if (have_lease) {
if (d_unhashed(dn))
d_add(dn, NULL);
+ }
+
+ if (!d_unhashed(dn) && have_lease)
update_dentry_lease(dir, dn,
rinfo->dlease, session,
req->r_request_started);
- }
goto done;
}