Skip to content

Commit 1776364

Browse files
committed
Merge tag 'gfs2-for-linus-4.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2
Pull gfs2 fix from Bob Peterson: "GFS2: Fix an old regression in GFS2's debugfs interface This fixes a regression introduced by commit 88ffbf3 ("GFS2: Use resizable hash table for glocks"). The regression caused the glock dump in debugfs to not report all the glocks, which makes debugging extremely difficult" * tag 'gfs2-for-linus-4.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Fix debugfs glocks dump
2 parents cf03461 + 1020165 commit 1776364

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

fs/gfs2/glock.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,20 +1945,17 @@ static void *gfs2_glock_seq_start(struct seq_file *seq, loff_t *pos)
19451945
{
19461946
struct gfs2_glock_iter *gi = seq->private;
19471947
loff_t n = *pos;
1948-
int ret;
1949-
1950-
if (gi->last_pos <= *pos)
1951-
n = (*pos - gi->last_pos);
19521948

1953-
ret = rhashtable_walk_start(&gi->hti);
1954-
if (ret)
1949+
rhashtable_walk_enter(&gl_hash_table, &gi->hti);
1950+
if (rhashtable_walk_start(&gi->hti) != 0)
19551951
return NULL;
19561952

19571953
do {
19581954
gfs2_glock_iter_next(gi);
19591955
} while (gi->gl && n--);
19601956

19611957
gi->last_pos = *pos;
1958+
19621959
return gi->gl;
19631960
}
19641961

@@ -1970,6 +1967,7 @@ static void *gfs2_glock_seq_next(struct seq_file *seq, void *iter_ptr,
19701967
(*pos)++;
19711968
gi->last_pos = *pos;
19721969
gfs2_glock_iter_next(gi);
1970+
19731971
return gi->gl;
19741972
}
19751973

@@ -1980,6 +1978,7 @@ static void gfs2_glock_seq_stop(struct seq_file *seq, void *iter_ptr)
19801978

19811979
gi->gl = NULL;
19821980
rhashtable_walk_stop(&gi->hti);
1981+
rhashtable_walk_exit(&gi->hti);
19831982
}
19841983

19851984
static int gfs2_glock_seq_show(struct seq_file *seq, void *iter_ptr)
@@ -2042,12 +2041,10 @@ static int __gfs2_glocks_open(struct inode *inode, struct file *file,
20422041
struct gfs2_glock_iter *gi = seq->private;
20432042

20442043
gi->sdp = inode->i_private;
2045-
gi->last_pos = 0;
20462044
seq->buf = kmalloc(GFS2_SEQ_GOODSIZE, GFP_KERNEL | __GFP_NOWARN);
20472045
if (seq->buf)
20482046
seq->size = GFS2_SEQ_GOODSIZE;
20492047
gi->gl = NULL;
2050-
rhashtable_walk_enter(&gl_hash_table, &gi->hti);
20512048
}
20522049
return ret;
20532050
}
@@ -2063,7 +2060,6 @@ static int gfs2_glocks_release(struct inode *inode, struct file *file)
20632060
struct gfs2_glock_iter *gi = seq->private;
20642061

20652062
gi->gl = NULL;
2066-
rhashtable_walk_exit(&gi->hti);
20672063
return seq_release_private(inode, file);
20682064
}
20692065

0 commit comments

Comments
 (0)