]> git.hungrycats.org Git - linux/commitdiff
btrfs: fix warning on uninit variable in btrfs_finish_chunk_alloc
authorChris Mason <clm@fb.com>
Wed, 23 Dec 2015 21:30:51 +0000 (13:30 -0800)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Tue, 19 Jan 2016 05:22:00 +0000 (00:22 -0500)
map->num_stripes really can't be zero, but just in case.

Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit 140e639f1a3ff052c3921818e2120fdfa4427681)
(cherry picked from commit e1b0ac26c411c864b470d4ef67ff9ac77b07a392)

fs/btrfs/volumes.c

index 1c233addc93671032425543bc059e14bfb08b980..ee7261d8ec40b06939952469bc11fb791cfdcb05 100644 (file)
@@ -4789,7 +4789,7 @@ int btrfs_finish_chunk_alloc(struct btrfs_trans_handle *trans,
        u64 dev_offset;
        u64 stripe_size;
        int i = 0;
-       int ret;
+       int ret = 0;
 
        em_tree = &extent_root->fs_info->mapping_tree.map_tree;
        read_lock(&em_tree->lock);