X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=btrfstune.c;h=eccedf79a8039641693739dd2d58c1d4c5478748;hb=992aa558397e519d2251cdc6c4d3a9e019b240a0;hp=2d85b0411a778ba011e6c715dce3e580fc4b1341;hpb=de8622fcd0f5bbd5326a12329edab542213dba82;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/btrfstune.c b/btrfstune.c index 2d85b04..eccedf7 100644 --- a/btrfstune.c +++ b/btrfstune.c @@ -66,6 +66,7 @@ static int update_seeding_flag(struct btrfs_root *root, int set_flag) } trans = btrfs_start_transaction(root, 1); + BUG_ON(IS_ERR(trans)); btrfs_set_super_flags(disk_super, super_flags); ret = btrfs_commit_transaction(trans, root); @@ -83,6 +84,7 @@ static int set_super_incompat_flags(struct btrfs_root *root, u64 flags) super_flags = btrfs_super_incompat_flags(disk_super); super_flags |= flags; trans = btrfs_start_transaction(root, 1); + BUG_ON(IS_ERR(trans)); btrfs_set_super_incompat_flags(disk_super, super_flags); ret = btrfs_commit_transaction(trans, root); @@ -149,7 +151,7 @@ static int change_extents_uuid(struct btrfs_fs_info *fs_info) goto next; bytenr = key.objectid; - eb = read_tree_block(fs_info, bytenr, fs_info->nodesize, 0); + eb = read_tree_block(fs_info, bytenr, 0); if (IS_ERR(eb)) { error("failed to read tree block: %llu", bytenr); ret = PTR_ERR(eb); @@ -242,7 +244,7 @@ static int change_fsid_prepare(struct btrfs_fs_info *fs_info) btrfs_set_super_flags(fs_info->super_copy, flags); memcpy(fs_info->super_copy->fsid, fs_info->new_fsid, BTRFS_FSID_SIZE); - ret = write_all_supers(tree_root); + ret = write_all_supers(fs_info); if (ret < 0) return ret; @@ -260,7 +262,7 @@ static int change_fsid_done(struct btrfs_fs_info *fs_info) flags &= ~BTRFS_SUPER_FLAG_CHANGING_FSID; btrfs_set_super_flags(fs_info->super_copy, flags); - return write_all_supers(fs_info->tree_root); + return write_all_supers(fs_info); } /* @@ -354,7 +356,7 @@ static int change_uuid(struct btrfs_fs_info *fs_info, const char *new_fsid_str) BTRFS_FSID_SIZE); memcpy(fs_info->super_copy->fsid, fs_info->new_fsid, BTRFS_FSID_SIZE); - ret = write_all_supers(fs_info->tree_root); + ret = write_all_supers(fs_info); if (ret < 0) goto out;