mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Colin Ian King <colin.king@canonical.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>,
	linux-xfs@vger.kernel.org, Brian Foster <bfoster@redhat.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: re: xfs: support inode btree blockcounts in online repair
Date: Fri, 11 Sep 2020 12:16:33 +0100	[thread overview]
Message-ID: <7c612801-682a-0115-2b37-5d21b933960d@canonical.com> (raw)

Hi,

Static analysis with Coverity has detected an issue with the following
commit:

commit 30deae31eab501f568aadea45cfb3258b9e522f5
Author: Darrick J. Wong <darrick.wong@oracle.com>
Date:   Wed Aug 26 10:48:50 2020 -0700

    xfs: support inode btree blockcounts in online repair

the analysis is as follows:

830                cur = xfs_inobt_init_cursor(mp, sc->tp, agi_bp,
sc->sa.agno,
831                                XFS_BTNUM_FINO);

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

 832                if (error)

CID: Logically dead code (DEADCODE)dead_error_line: Execution cannot
reach this statement: goto err;.

 833                        goto err;

While it is tempting to change the if (error) check to if (cur), the
exit error path uses the errnoeous cur as follows:

 842 err:
 843       xfs_btree_del_cursor(cur, error);
 844       return error;

so the error exit path needs some sorting out too.

             reply	other threads:[~2020-09-11 11:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 11:16 Colin Ian King [this message]
2020-09-11 16:03 ` Darrick J. Wong

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=7c612801-682a-0115-2b37-5d21b933960d@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

all inboxes | Powered by JetHome®