All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: "'linux-xfs@oss.sgi.com'" <linux-xfs@oss.sgi.com>
Subject: [PATCH] xfsprogs: fix unint var in repair phase6
Date: Wed, 31 Jul 2013 20:13:10 -0500	[thread overview]
Message-ID: <51F9B626.4010707@redhat.com> (raw)

2 calls to libxfs_bmapi_write exist in repair's phase6
where "first" is uninitialized, but is accessed
in that function.

Normally we call xfs_bmap_init() first to initialize
both the free list and the first block, but in these
cases, the free list var is sent as NULL.

So in these 2 cases, explicitly initialize the "first"
variable to NULLFSBLOCK as xfs_bmap_init() does
elsewhere.

Coverity caught this.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/repair/phase6.c b/repair/phase6.c
index 5c33797..119ec3b 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -536,6 +536,7 @@ fill_rbmino(xfs_mount_t *mp)
 			error);
 	}
 
+	first = NULLFSBLOCK;
 	while (bno < mp->m_sb.sb_rbmblocks)  {
 		/*
 		 * fill the file one block at a time
@@ -605,6 +606,7 @@ fill_rsumino(xfs_mount_t *mp)
 			error);
 	}
 
+	first = NULLFSBLOCK;
 	while (bno < end_bno)  {
 		/*
 		 * fill the file one block at a time

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2013-08-01  1:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01  1:13 Eric Sandeen [this message]
2013-08-01 14:50 ` [PATCH] xfsprogs: fix unint var in repair phase6 Mark Tinguely

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=51F9B626.4010707@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-xfs@oss.sgi.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.