Skip to contentSkip to conversation

debugfs: fix icheck finding blocks used for xattrs

PATCH Applied Andreas Dilger 2 participants 2 messages Jun 10, 2011 – Jun 11, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 debugfs: fix icheck finding blocks used for xattrs

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.

---
 debugfs/icheck.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
debugfs/icheck.c +4 -2
index 643bc5b..729ac93 100644
@@ -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)
Signature · 1 line
1.7.3.4
Applied
#1 lore raw
Quoted 5 lines · Andreas Dilger

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.

Applied to the next branch, thanks.

- Ted