aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2024-02-02 17:01:39 +0100
committerAndreas Gruenbacher <agruenba@redhat.com>2024-02-02 23:20:53 +0100
commit4ac2813fded4b487559845b9c940663c657bf871 (patch)
tree1c52bae502d1c6c68bf6695fcd040c71e4e868a7
parent9272f0d28bc476d3dbf76f2e9857b1491139a303 (diff)
downloadlinux-gfs2-lockless-lookup.tar.gz
-rw-r--r--fs/gfs2/dentry.c4
-rw-r--r--fs/gfs2/inode.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/fs/gfs2/dentry.c b/fs/gfs2/dentry.c
index b14956cdab0ec2..1c2d6e0f894cc6 100644
--- a/fs/gfs2/dentry.c
+++ b/fs/gfs2/dentry.c
@@ -86,8 +86,10 @@ static int gfs2_drevalidate(struct dentry *dentry, unsigned int flags)
error = inode ? !error : (error == -ENOENT);
out:
- if (gfs2_holder_initialized(&d_gh))
+ if (gfs2_holder_initialized(&d_gh)) {
+ /* XXX see the comments in gfs2_permission() */
gfs2_glock_dq_uninit(&d_gh);
+ }
dput(parent);
return error;
}
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index b67f1d49b2a2f4..1f86a04422637f 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1894,8 +1894,15 @@ int gfs2_permission(struct mnt_idmap *idmap, struct inode *inode,
error = -EPERM;
else
error = generic_permission(&nop_mnt_idmap, inode, mask);
- if (gfs2_holder_initialized(&i_gh))
+ if (gfs2_holder_initialized(&i_gh)) {
+ /* XXX This can sleep in gfs2_glock_dq() waiting for a withdraw
+ * to complete as well as in gfs2_holder_uninit() ->
+ * gfs2_glock_put(). We can turn the gfs2_glock_put() into a
+ * gfs2_glock_put_async(), but we don't have a way of getting
+ * rid of the waiting for withdraw for now.
+ */
gfs2_glock_dq_uninit(&i_gh);
+ }
return error;
}