Commit 3e75e69f authored by Dan Carpenter's avatar Dan Carpenter Committed by Thadeu Lima de Souza Cascardo

GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next

BugLink: http://bugs.launchpad.net/bugs/1724772

[ Upstream commit 14d37564 ]

This patch fixes a place where function gfs2_glock_iter_next can
reference an invalid error pointer.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent bc7af446
...@@ -1798,16 +1798,18 @@ void gfs2_glock_exit(void) ...@@ -1798,16 +1798,18 @@ void gfs2_glock_exit(void)
static void gfs2_glock_iter_next(struct gfs2_glock_iter *gi) static void gfs2_glock_iter_next(struct gfs2_glock_iter *gi)
{ {
do { while ((gi->gl = rhashtable_walk_next(&gi->hti))) {
gi->gl = rhashtable_walk_next(&gi->hti);
if (IS_ERR(gi->gl)) { if (IS_ERR(gi->gl)) {
if (PTR_ERR(gi->gl) == -EAGAIN) if (PTR_ERR(gi->gl) == -EAGAIN)
continue; continue;
gi->gl = NULL; gi->gl = NULL;
return;
} }
/* Skip entries for other sb and dead entries */ /* Skip entries for other sb and dead entries */
} while ((gi->gl) && ((gi->sdp != gi->gl->gl_name.ln_sbd) || if (gi->sdp == gi->gl->gl_name.ln_sbd &&
__lockref_is_dead(&gi->gl->gl_lockref))); !__lockref_is_dead(&gi->gl->gl_lockref))
return;
}
} }
static void *gfs2_glock_seq_start(struct seq_file *seq, loff_t *pos) static void *gfs2_glock_seq_start(struct seq_file *seq, loff_t *pos)
......
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