Skip to contentSkip to conversation

GFS2: Use resizable hash table for glocks

Cluster-devel Dan Carpenter 2 participants 2 messages Jul 15, 2015 – Jul 17, 2015

lore
Share & tools
lore
#0 lore raw

Hello Bob Peterson,

The patch 6afe4c76af37: "GFS2: Use resizable hash table for glocks" from Mar 16, 2015, leads to the following static checker warning:

	fs/gfs2/glock.c:1798 gfs2_glock_iter_next()
	error: 'gi->gl' dereferencing possible ERR_PTR()

fs/gfs2/glock.c
1793 static void gfs2_glock_iter_next(struct gfs2_glock_rht_iter *gi) 1794 {
1795 do {

  1796                  gi->gl = rhashtable_walk_next(&gi->hti);
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

can return -EAGAIN sometimes.

1797 /* Skip entries for other sb and dead entries */
1798 } while ((gi->gl) && ((gi->sdp != gi->gl->gl_name.ln_sbd) ||

                                                  ^^^^^^^^

Might be an issue here, might not. I don't know the subsystem well enough to know when it returns NULL vs -EAGAIN.

  1799                                __lockref_is_dead(&gi->gl->gl_lockref)));
  1800  }

regards,
dan carpenter

#1 lore raw

----- Original Message -----

Quoted 22 lines

Hello Bob Peterson,

The patch 6afe4c76af37: "GFS2: Use resizable hash table for glocks" from Mar 16, 2015, leads to the following static checker warning:

	fs/gfs2/glock.c:1798 gfs2_glock_iter_next()
	error: 'gi->gl' dereferencing possible ERR_PTR()

fs/gfs2/glock.c
1793 static void gfs2_glock_iter_next(struct gfs2_glock_rht_iter *gi) 1794 {
1795 do {

  1796                  gi->gl = rhashtable_walk_next(&gi->hti);
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

can return -EAGAIN sometimes.

1797 /* Skip entries for other sb and dead entries */
1798 } while ((gi->gl) && ((gi->sdp != gi->gl->gl_name.ln_sbd) ||

                                                  ^^^^^^^^

Might be an issue here, might not. I don't know the subsystem well enough to know when it returns NULL vs -EAGAIN.

Quoted 7 lines
  1799
  __lockref_is_dead(&gi->gl->gl_lockref)));
  1800  }

regards,
dan carpenter

Thanks, Dan. I'll craft a fix.

Bob Peterson
Red Hat File Systems