[Cluster-devel] [bug report] GFS2: Use resizable hash table for glocks
Dan Carpenter
dan.carpenter at oracle.com
Wed Dec 14 14:08:19 UTC 2016
On Wed, Dec 14, 2016 at 08:41:57AM -0500, Bob Peterson wrote:
> Hi Dan,
>
> ----- Original Message -----
> | Hello Bob Peterson,
> |
> | The patch 88ffbf3e037e: "GFS2: Use resizable hash table for glocks"
> | from Mar 16, 2015, leads to the following static checker warning:
> |
> | fs/gfs2/glock.c:1813 gfs2_glock_iter_next()
> | error: 'gi->gl' dereferencing possible ERR_PTR()
> |
> | fs/gfs2/glock.c
> | 1803 static void gfs2_glock_iter_next(struct gfs2_glock_iter *gi)
> | 1804 {
> | 1805 do {
> | 1806 gi->gl = rhashtable_walk_next(&gi->hti);
> | 1807 if (IS_ERR(gi->gl)) {
> | 1808 if (PTR_ERR(gi->gl) == -EAGAIN)
> | 1809 continue;
> |
> | This continue was probably intended to go to the top of the loop, but
> | it's a do while loop so it actually drops down
> |
> | 1810 gi->gl = NULL;
> | 1811 }
> | 1812 /* Skip entries for other sb and dead entries */
> | 1813 } while ((gi->gl) && ((gi->sdp != gi->gl->gl_name.ln_sbd) ||
> | ^^^^^^^^
> | to here where we dereference gi->gl. It's weird that Smatch is only
> | complaining about this now though...
> |
> | 1814
> | __lockref_is_dead(&gi->gl->gl_lockref)));
> | 1815 }
> |
> | regards,
> | dan carpenter
>
> Yes, that looks like a bug. Do you have a patch or should I patch it?
>
Could you patch it?
regards,
dan carpenter
More information about the Cluster-devel
mailing list