From: Dan Carpenter <dan.carpenter@oracle.com>
To: a-fujita@rs.jp.nec.com
Cc: linux-ext4@vger.kernel.org
Subject: re: ext4: Replace BUG_ON() with ext4_error() in move_extents.c
Date: Thu, 25 Oct 2012 14:35:03 +0300 [thread overview]
Message-ID: <20121025113503.GA7836@elgon.mountain> (raw)
Hello Akira Fujita,
This is a semi-automatic email about new static checker warnings.
The patch 2147b1a6a48e: "ext4: Replace BUG_ON() with ext4_error() in
move_extents.c" from Sep 16, 2009, leads to the following Smatch
complaint:
fs/ext4/move_extent.c:693 mext_replace_branches()
warn: variable dereferenced before check 'dext' (see line 683)
fs/ext4/move_extent.c
682 dext = donor_path[depth].p_ext;
683 tmp_dext = *dext;
^^^^^
Old dereference.
684
685 *err = mext_calc_swap_extents(&tmp_dext, &tmp_oext, orig_off,
686 donor_off, count);
687 if (*err)
688 goto out;
689
690 /* Loop for the donor extents */
691 while (1) {
692 /* The extent for donor must be found. */
693 if (!dext) {
^^^^^
This check was inside BUG_ON() macro before and so Smatch ignored it on
the basis that macros do a lot of unneeded checks. But now it's outside
the macro it triggers a warning.
694 EXT4_ERROR_INODE(donor_inode,
695 "The extent for donor must be found");
regards,
dan carpenter
next reply other threads:[~2012-10-25 11:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-25 11:35 Dan Carpenter [this message]
2012-10-26 8:07 ` ext4: Replace BUG_ON() with ext4_error() in move_extents.c Akira Fujita
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=20121025113503.GA7836@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=a-fujita@rs.jp.nec.com \
--cc=linux-ext4@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).