All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [bug report] GFS2: Use resizable hash table for glocks
Date: Wed, 14 Dec 2016 11:58:44 +0300	[thread overview]
Message-ID: <20161214085844.GA10659@elgon.mountain> (raw)

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



             reply	other threads:[~2016-12-14  8:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14  8:58 Dan Carpenter [this message]
2016-12-14 13:41 ` [Cluster-devel] [bug report] GFS2: Use resizable hash table for glocks Bob Peterson
2016-12-14 14:05   ` Bob Peterson
2016-12-14 14:25     ` Dan Carpenter
2016-12-14 14:26     ` [Cluster-devel] [patch] GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next Dan Carpenter
2016-12-16 13:22       ` Bob Peterson
2016-12-14 14:08   ` [Cluster-devel] [bug report] GFS2: Use resizable hash table for glocks Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161214085844.GA10659@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.