mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-25 15:42:23 +00:00
btrfs-progs: resize: properly return error from check_resize_args
The function almost always returns 0 even for errors as the ret value is not used in the final return. This was attempted to be fixed in55438f3930
("btrfs-progs: resize: return error value from check_resize_args()") but this broke 'resize cancel' when devid 1 was missing and was later reverted as4286eb552e
("Revert "btrfs-progs: resize: return error value from check_resize_args()""). The devid fallback has been fixed so the proper return value can be returned now. Issue: #539 Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
b64f8437b6
commit
c08071e7be
@ -1242,6 +1242,7 @@ static int check_resize_args(const char *amount, const char *path, u64 *devid_re
|
||||
ret = 1;
|
||||
goto out;
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
/* Cancel does not need to determine the device number. */
|
||||
if (strcmp(amount, "cancel") == 0) {
|
||||
@ -1351,7 +1352,7 @@ static int check_resize_args(const char *amount, const char *path, u64 *devid_re
|
||||
|
||||
out:
|
||||
free(di_args);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int cmd_filesystem_resize(const struct cmd_struct *cmd,
|
||||
|
Loading…
Reference in New Issue
Block a user