Btrfs-progs: commit the csum_root if we do --init-csum-tree
authorJosef Bacik <jbacik@fusionio.com>
Fri, 14 Jun 2013 18:25:54 +0000 (14:25 -0400)
committerDavid Sterba <dsterba@suse.cz>
Fri, 9 Aug 2013 12:32:31 +0000 (14:32 +0200)
This is just an oddity with the commit stuff in btrfs-progs.  It will just
update the generation of the root you call with, which in btrfsck case would
have been the fs_root.  But because we didn't actually update the fs_root we
wouldn't have cow'ed the fs root and therefore the generation will not match the
node which will make the file system unmountable.  Fix this by calling with the
csum_root which is the one we're messing with.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
cmds-check.c

index cc9606c..5349d4b 100644 (file)
@@ -5855,7 +5855,7 @@ int cmd_check(int argc, char **argv)
                        return -EIO;
                }
 
-               ret = btrfs_commit_transaction(trans, root);
+               ret = btrfs_commit_transaction(trans, info->csum_root);
                if (ret)
                        exit(1);
                goto out;