Commit e9f1e6bb authored by Andreas Gruenbacher's avatar Andreas Gruenbacher

Revert "gfs2: Use GL_NOBLOCK flag for non-blocking lookups"

Commit "gfs2: Use GL_NOBLOCK flag for non-blocking lookups" has several
issues, some of which are non-trivial to fix, so revert it for now:

  https://lore.kernel.org/gfs2/20240202050230.GA875515@ZenIV/T/

This reverts commit dd00aaeb.
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent 41bccc98
...@@ -32,25 +32,21 @@ ...@@ -32,25 +32,21 @@
static int gfs2_drevalidate(struct dentry *dentry, unsigned int flags) static int gfs2_drevalidate(struct dentry *dentry, unsigned int flags)
{ {
struct dentry *parent = NULL; struct dentry *parent;
struct gfs2_sbd *sdp; struct gfs2_sbd *sdp;
struct gfs2_inode *dip; struct gfs2_inode *dip;
struct inode *dinode, *inode; struct inode *inode;
struct gfs2_holder d_gh; struct gfs2_holder d_gh;
struct gfs2_inode *ip = NULL; struct gfs2_inode *ip = NULL;
int error, valid = 0; int error, valid = 0;
int had_lock = 0; int had_lock = 0;
if (flags & LOOKUP_RCU) { if (flags & LOOKUP_RCU)
dinode = d_inode_rcu(READ_ONCE(dentry->d_parent)); return -ECHILD;
if (!dinode)
return -ECHILD; parent = dget_parent(dentry);
} else { sdp = GFS2_SB(d_inode(parent));
parent = dget_parent(dentry); dip = GFS2_I(d_inode(parent));
dinode = d_inode(parent);
}
sdp = GFS2_SB(dinode);
dip = GFS2_I(dinode);
inode = d_inode(dentry); inode = d_inode(dentry);
if (inode) { if (inode) {
...@@ -66,8 +62,7 @@ static int gfs2_drevalidate(struct dentry *dentry, unsigned int flags) ...@@ -66,8 +62,7 @@ static int gfs2_drevalidate(struct dentry *dentry, unsigned int flags)
had_lock = (gfs2_glock_is_locked_by_me(dip->i_gl) != NULL); had_lock = (gfs2_glock_is_locked_by_me(dip->i_gl) != NULL);
if (!had_lock) { if (!had_lock) {
error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &d_gh);
flags & LOOKUP_RCU ? GL_NOBLOCK : 0, &d_gh);
if (error) if (error)
goto out; goto out;
} }
......
...@@ -1882,10 +1882,10 @@ int gfs2_permission(struct mnt_idmap *idmap, struct inode *inode, ...@@ -1882,10 +1882,10 @@ int gfs2_permission(struct mnt_idmap *idmap, struct inode *inode,
WARN_ON_ONCE(!may_not_block); WARN_ON_ONCE(!may_not_block);
return -ECHILD; return -ECHILD;
} }
if (gfs2_glock_is_locked_by_me(ip->i_gl) == NULL) { if (gfs2_glock_is_locked_by_me(gl) == NULL) {
int noblock = may_not_block ? GL_NOBLOCK : 0; if (may_not_block)
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, return -ECHILD;
LM_FLAG_ANY | noblock, &i_gh); error = gfs2_glock_nq_init(gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
if (error) if (error)
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment