History

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 dd00aaeb343255a8a30de671bd27bde79a47c8e5.

Andreas Gruenbacher committed 2 years ago

Commit e9f1e6b1 parent 41bccc92 files · +13 −18Browse files

Unified · Split

2 files
  1. fs/gfs2/dentry.c +9 −14
  2. fs/gfs2/inode.c +4 −4
fs/gfs2/dentry.c+9−14
@@ -32,25 +32,21 @@ · 31 unmodified lines
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) · 9 unmodified lines
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+4−4
@@ -1882,10 +1882,10 @@ int gfs2_permission(struct mnt_idmap *idmap, struct inode *inode, · 1881 unmodified lines
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 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t