From: Eric Sandeen <sandeen@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 15/18] xfs_repair: fix 'bno' shadow vars in scan.c
Date: Wed, 10 Oct 2018 15:01:19 -0500 [thread overview]
Message-ID: <1539201682-22198-16-git-send-email-sandeen@redhat.com> (raw)
In-Reply-To: <1539201682-22198-1-git-send-email-sandeen@redhat.com>
scan.c has 3 functions which accept 'bno' as an argument, but then use a
local variable of the same name for a different purpose in an inner scope,
which causes sparse warnings.
Rename these inner-scope loop variables 'agbno' to fix this.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
repair/scan.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/repair/scan.c b/repair/scan.c
index 65a76e2..12ca314 100644
--- a/repair/scan.c
+++ b/repair/scan.c
@@ -738,7 +738,7 @@ _("%s freespace btree block claimed (state %d), agno %d, bno %d, suspect %d\n"),
}
for (i = 0; i < numrecs; i++) {
- xfs_agblock_t bno = be32_to_cpu(pp[i]);
+ xfs_agblock_t agbno = be32_to_cpu(pp[i]);
/*
* XXX - put sibling detection right here.
@@ -749,17 +749,17 @@ _("%s freespace btree block claimed (state %d), agno %d, bno %d, suspect %d\n"),
* pointer mismatch, try and extract as much data
* as possible.
*/
- if (bno != 0 && verify_agbno(mp, agno, bno)) {
+ if (agbno != 0 && verify_agbno(mp, agno, agbno)) {
switch (magic) {
case XFS_ABTB_CRC_MAGIC:
case XFS_ABTB_MAGIC:
- scan_sbtree(bno, level, agno, suspect,
+ scan_sbtree(agbno, level, agno, suspect,
scan_allocbt, 0, magic, priv,
&xfs_allocbt_buf_ops);
break;
case XFS_ABTC_CRC_MAGIC:
case XFS_ABTC_MAGIC:
- scan_sbtree(bno, level, agno, suspect,
+ scan_sbtree(agbno, level, agno, suspect,
scan_allocbt, 0, magic, priv,
&xfs_allocbt_buf_ops);
break;
@@ -1177,7 +1177,7 @@ advance:
}
for (i = 0; i < numrecs; i++) {
- xfs_agblock_t bno = be32_to_cpu(pp[i]);
+ xfs_agblock_t agbno = be32_to_cpu(pp[i]);
/*
* XXX - put sibling detection right here.
@@ -1199,12 +1199,12 @@ advance:
/* Look for impossible flags. */
do_warn(
_("invalid flags in high key %u of %s btree block %u/%u\n"),
- i, name, agno, bno);
+ i, name, agno, agbno);
continue;
}
- if (bno != 0 && verify_agbno(mp, agno, bno)) {
- scan_sbtree(bno, level, agno, suspect, scan_rmapbt, 0,
+ if (agbno != 0 && verify_agbno(mp, agno, agbno)) {
+ scan_sbtree(agbno, level, agno, suspect, scan_rmapbt, 0,
magic, priv, &xfs_rmapbt_buf_ops);
}
}
@@ -1419,10 +1419,10 @@ _("extent (%u/%u) len %u claimed, state is %d\n"),
}
for (i = 0; i < numrecs; i++) {
- xfs_agblock_t bno = be32_to_cpu(pp[i]);
+ xfs_agblock_t agbno = be32_to_cpu(pp[i]);
- if (bno != 0 && verify_agbno(mp, agno, bno)) {
- scan_sbtree(bno, level, agno, suspect, scan_refcbt, 0,
+ if (agbno != 0 && verify_agbno(mp, agno, agbno)) {
+ scan_sbtree(agbno, level, agno, suspect, scan_refcbt, 0,
magic, priv, &xfs_refcountbt_buf_ops);
}
}
--
1.8.3.1
next prev parent reply other threads:[~2018-10-11 3:25 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-10 20:01 [PATCH 00/18] xfsprogs: finer-grained sparse fixes Eric Sandeen
2018-10-10 20:01 ` [PATCH 01/18] xfsprogs: enable sparse checking with "make C=[12]" Eric Sandeen
2018-10-10 21:24 ` Darrick J. Wong
2018-10-10 22:18 ` [PATCH 01/18 V2] " Eric Sandeen
2018-10-11 5:57 ` Christoph Hellwig
2018-10-11 14:09 ` Eric Sandeen
2018-10-10 20:01 ` [PATCH 02/18] xfs_db: convert single-bit bitfields to bools Eric Sandeen
2018-10-11 5:58 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 03/18] xfsprogs: minor endian annotation fixes Eric Sandeen
2018-10-11 5:59 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 04/18] xfsprogs: avoid redefinition of NBBY Eric Sandeen
2018-10-11 5:59 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 05/18] xfsprogs: include headers for extern variables Eric Sandeen
2018-10-11 5:59 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 06/18] libxfs: add several zone extern declarations to libxfs_priv.h Eric Sandeen
2018-10-11 5:59 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 07/18] libxfs: silence static warnings about platform_* functions Eric Sandeen
2018-10-11 6:00 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 08/18] xfs_io: include io.h to silence static function warnings Eric Sandeen
2018-10-11 6:00 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 09/18] libxfs: silence sparse static function warnings in util.c Eric Sandeen
2018-10-11 6:00 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 10/18] avl64: export avl64_firstino / avl64_firstino from avl64.h Eric Sandeen
2018-10-11 6:01 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 11/18] xfsprogs: misc static function warning fixes Eric Sandeen
2018-10-11 6:01 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 12/18] xfsprogs: don't shadow global libxfs_init x variable Eric Sandeen
2018-10-11 6:02 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 13/18] xfs_io: rename global buffer variable Eric Sandeen
2018-10-11 6:02 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 14/18] xfs_logprint: fix shadow var in xlog_print_trans_buffer Eric Sandeen
2018-10-11 6:03 ` Christoph Hellwig
2018-10-10 20:01 ` Eric Sandeen [this message]
2018-10-11 6:03 ` [PATCH 15/18] xfs_repair: fix 'bno' shadow vars in scan.c Christoph Hellwig
2018-10-10 20:01 ` [PATCH 16/18] xfs_scrub: remove shadow var from run_scrub_phases() Eric Sandeen
2018-10-11 6:03 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 17/18] xfs_metadump: remove shadow variable Eric Sandeen
2018-10-10 21:34 ` Darrick J. Wong
2018-10-11 6:04 ` Christoph Hellwig
2018-10-10 20:01 ` [PATCH 18/18] libfrog: change project entity variable scope to local/static Eric Sandeen
2018-10-10 21:37 ` [PATCH 00/18] xfsprogs: finer-grained sparse fixes 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=1539201682-22198-16-git-send-email-sandeen@redhat.com \
--to=sandeen@redhat.com \
--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).