btrfs-progs: rescue: Fix zero-log mounted branch
authorQu Wenruo <wqu@suse.com>
Tue, 17 Oct 2017 09:13:12 +0000 (17:13 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Nov 2017 14:59:00 +0000 (15:59 +0100)
Seems to be a typo that, in (ret > 0) branch of check_mounted(),
zero-log set the return value but doesn't return.

Fix it by adding back the missing return.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-rescue.c

index d1bec02..4bc798d 100644 (file)
@@ -177,6 +177,7 @@ static int cmd_rescue_zero_log(int argc, char **argv)
        } else if (ret) {
                error("%s is currently mounted", devname);
                ret = -EBUSY;
+               goto out;
        }
 
        root = open_ctree(devname, 0, OPEN_CTREE_WRITES | OPEN_CTREE_PARTIAL);