Whamcloud - gitweb
debugfs: fix icheck finding blocks used for xattrs
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 11 Jun 2011 15:29:54 +0000 (11:29 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 11 Jun 2011 15:29:54 +0000 (11:29 -0400)
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>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/icheck.c

index 643bc5b..729ac93 100644 (file)
@@ -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)