Skip to contentSkip to conversation

GFS2: Handle errors from rhashtable_walk_next

PATCH New Bob Peterson 2 participants 2 messages Aug 3, 2015 1 message not in the archive GFS2 file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 GFS2: Handle errors from rhashtable_walk_next

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.

---

fs/gfs2/glock.c +5 -0
index 1b0dff4..15227a7 100644
@@ -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)));
#2 lore raw

PATCH 1/1 GFS2: Handle errors from rhashtable_walk_next

Quoted 4 lines · Bob Peterson

Hi,

This patch was inspired by Dan Carpenter's email from 17 July.

Heh. I looked through my out box from July 17 and I only see pointer math patches. Ah... Here I've found the email. :) Ah here it is, I reported a static checker bug here.

Quoted 3 lines

This patch adds some needed error checking after calling function rhashtable_walk_next.

Looks good.

regards,
dan carpenter