linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin Ian King <colin.king@canonical.com>
To: Brian Foster <bfoster@redhat.com>,
	darrick.wong@oracle.com, linux-xfs@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: re: xfs: cancel dfops on xfs_defer_finish() error
Date: Tue, 7 Aug 2018 15:14:07 +0100	[thread overview]
Message-ID: <18f3296d-e5d4-4d76-51f8-a40d0ceaa20e@canonical.com> (raw)

Hi,

Recent commit 82ff27bc52a88cb5cc400bfa64e210d3ec8dfebd ("xfs: automatic
dfops buffer relogging") removed the assignment of variable error:

-       error = xfs_defer_bjoin(tp->t_dfops, bp);
        if (error) {
                xfs_trans_bhold_release(tp, bp);
                xfs_trans_brelse(tp, bp);


.. the removal of the assignment leads to dead code on the following if
statement as error is always zero at this point.  Not sure if that was
intended, but it tripped a static analysis warning from CoverityScan.


364        xfs_trans_bhold(tp, bp);

   const: At condition error, the value of error must be equal to 0.
   dead_error_condition: The condition error cannot be true.

365        if (error) {
   CID 1472288 (#1 of 1): Logically dead code (DEADCODE)
   dead_error_begin: Execution cannot reach this statement:
xfs_trans_bhold_release(tp,....


366                xfs_trans_bhold_release(tp, bp);
367                xfs_trans_brelse(tp, bp);
368                goto error1;
369        }

Colin

             reply	other threads:[~2018-08-07 16:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 14:14 Colin Ian King [this message]
2018-08-07 14:37 ` xfs: cancel dfops on xfs_defer_finish() error Brian Foster
2018-08-07 15:10   ` Darrick J. Wong
2018-08-07 15:18     ` Brian Foster
2018-08-07 15:26       ` Darrick J. Wong
2018-08-07 15:34         ` Brian Foster

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=18f3296d-e5d4-4d76-51f8-a40d0ceaa20e@canonical.com \
    --to=colin.king@canonical.com \
    --cc=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@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).