Skip to content

Commit c08071e

Browse files
committed
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 in 55438f3 ("btrfs-progs: resize: return error value from check_resize_args()") but this broke 'resize cancel' when devid 1 was missing and was later reverted as 4286eb5 ("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>
1 parent b64f843 commit c08071e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmds/filesystem.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,7 @@ static int check_resize_args(const char *amount, const char *path, u64 *devid_re
12421242
ret = 1;
12431243
goto out;
12441244
}
1245+
ret = 0;
12451246

12461247
/* Cancel does not need to determine the device number. */
12471248
if (strcmp(amount, "cancel") == 0) {
@@ -1351,7 +1352,7 @@ static int check_resize_args(const char *amount, const char *path, u64 *devid_re
13511352

13521353
out:
13531354
free(di_args);
1354-
return 0;
1355+
return ret;
13551356
}
13561357

13571358
static int cmd_filesystem_resize(const struct cmd_struct *cmd,

0 commit comments

Comments
 (0)