linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@whamcloud.com>
To: tytso@mit.edu, linux-ext4@vger.kernel.org
Cc: Andreas Dilger <adilger@whamcloud.com>
Subject: [PATCH] debugfs: fix icheck finding blocks used for xattrs
Date: Fri, 10 Jun 2011 00:02:50 -0600	[thread overview]
Message-ID: <1307685770-6099-1-git-send-email-adilger@whamcloud.com> (raw)

This was an "uninitialized variable" warning, but it turns out to be
a real bug.  Without this change, it is not possible to use "icheck"
to find blocks that are used for the i_file_acl (xattr) block.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
---
 debugfs/icheck.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/debugfs/icheck.c b/debugfs/icheck.c
index 643bc5b..729ac93 100644
--- a/debugfs/icheck.c
+++ b/debugfs/icheck.c
@@ -106,13 +106,15 @@ void do_icheck(int argc, char **argv)
 	}
 
 	while (ino) {
+		blk64_t blk;
+
 		if (!inode.i_links_count)
 			goto next;
 
 		bw.inode = ino;
 
-		if (ext2fs_file_acl_block(&inode)) {
-			blk64_t blk;
+		blk = ext2fs_file_acl_block(&inode);
+		if (blk) {
 			icheck_proc(current_fs, &blk, 0,
 				    0, 0, &bw);
 			if (bw.blocks_left == 0)
-- 
1.7.3.4


             reply	other threads:[~2011-06-10  6:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-10  6:02 Andreas Dilger [this message]
2011-06-11 15:31 ` [PATCH] debugfs: fix icheck finding blocks used for xattrs Ted Ts'o

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=1307685770-6099-1-git-send-email-adilger@whamcloud.com \
    --to=adilger@whamcloud.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).