Skip to content

Commit 6b89b6a

Browse files
committed
Merge tag 'gfs2-v6.8-rc2-revert' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2
Pull gfs2 revert from Andreas Gruenbacher: "It turns out that the commit to use GL_NOBLOCK flag for non-blocking lookups has several issues, and not all of them have a simple fix" * tag 'gfs2-v6.8-rc2-revert' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: Revert "gfs2: Use GL_NOBLOCK flag for non-blocking lookups"
2 parents b1dd6c2 + e9f1e6b commit 6b89b6a

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

fs/gfs2/dentry.c

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,21 @@
3232

3333
static int gfs2_drevalidate(struct dentry *dentry, unsigned int flags)
3434
{
35-
struct dentry *parent = NULL;
35+
struct dentry *parent;
3636
struct gfs2_sbd *sdp;
3737
struct gfs2_inode *dip;
38-
struct inode *dinode, *inode;
38+
struct inode *inode;
3939
struct gfs2_holder d_gh;
4040
struct gfs2_inode *ip = NULL;
4141
int error, valid = 0;
4242
int had_lock = 0;
4343

44-
if (flags & LOOKUP_RCU) {
45-
dinode = d_inode_rcu(READ_ONCE(dentry->d_parent));
46-
if (!dinode)
47-
return -ECHILD;
48-
} else {
49-
parent = dget_parent(dentry);
50-
dinode = d_inode(parent);
51-
}
52-
sdp = GFS2_SB(dinode);
53-
dip = GFS2_I(dinode);
44+
if (flags & LOOKUP_RCU)
45+
return -ECHILD;
46+
47+
parent = dget_parent(dentry);
48+
sdp = GFS2_SB(d_inode(parent));
49+
dip = GFS2_I(d_inode(parent));
5450
inode = d_inode(dentry);
5551

5652
if (inode) {
@@ -66,8 +62,7 @@ static int gfs2_drevalidate(struct dentry *dentry, unsigned int flags)
6662

6763
had_lock = (gfs2_glock_is_locked_by_me(dip->i_gl) != NULL);
6864
if (!had_lock) {
69-
error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED,
70-
flags & LOOKUP_RCU ? GL_NOBLOCK : 0, &d_gh);
65+
error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &d_gh);
7166
if (error)
7267
goto out;
7368
}

fs/gfs2/inode.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,10 +1882,10 @@ int gfs2_permission(struct mnt_idmap *idmap, struct inode *inode,
18821882
WARN_ON_ONCE(!may_not_block);
18831883
return -ECHILD;
18841884
}
1885-
if (gfs2_glock_is_locked_by_me(ip->i_gl) == NULL) {
1886-
int noblock = may_not_block ? GL_NOBLOCK : 0;
1887-
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED,
1888-
LM_FLAG_ANY | noblock, &i_gh);
1885+
if (gfs2_glock_is_locked_by_me(gl) == NULL) {
1886+
if (may_not_block)
1887+
return -ECHILD;
1888+
error = gfs2_glock_nq_init(gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
18891889
if (error)
18901890
return error;
18911891
}

0 commit comments

Comments
 (0)