From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Mon, 3 Aug 2015 13:17:31 -0400 (EDT) Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Handle errors from rhashtable_walk_next In-Reply-To: <338955658.3406242.1438622031072.JavaMail.zimbra@redhat.com> Message-ID: <426920591.3409293.1438622251959.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, This patch was inspired by Dan Carpenter's email from 17 July. This patch adds some needed error checking after calling function rhashtable_walk_next. Signed-off-by: Bob Peterson --- diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 1b0dff4..15227a7 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -1794,6 +1794,11 @@ static void gfs2_glock_iter_next(struct gfs2_glock_rht_iter *gi) { do { gi->gl = rhashtable_walk_next(&gi->hti); + if (IS_ERR(gi->gl)) { + if (PTR_ERR(gi->gl) == -EAGAIN) + continue; + gi->gl = NULL; + } /* Skip entries for other sb and dead entries */ } while ((gi->gl) && ((gi->sdp != gi->gl->gl_name.ln_sbd) || __lockref_is_dead(&gi->gl->gl_lockref)));