Patchwork debugfs: fix icheck finding blocks used for xattrs

login
register
mail settings
Submitter Andreas Dilger
Date June 10, 2011, 6:02 a.m.
Message ID <1307685770-6099-1-git-send-email-adilger@whamcloud.com>
Download mbox | patch
Permalink /patch/99845/
State Accepted
Headers show

Comments

Andreas Dilger - June 10, 2011, 6:02 a.m.
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(-)
Theodore Ts'o - June 11, 2011, 3:31 p.m.
On Fri, Jun 10, 2011 at 12:02:50AM -0600, Andreas Dilger wrote:
> 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>

Applied to the next branch, thanks.

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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)