Revert "btrfs-progs: resize: return error value from check_resize_args()"

This reverts commit 55438f3930.

The patch breaks resize cancel.

Reproducer:

    #!/bin/bash

    fallocate -l 7g /var/tmp/7g1 && fallocate -l 7g /var/tmp/7g2

    thing1=$(sudo losetup --show -f /var/tmp/7g1)
    thing2=$(sudo losetup --show -f /var/tmp/7g2)

    echo Make the fs
    mkfs.btrfs -L test539 $thing1
    mkdir test539
    mount -L test539 test539

    echo Get rid of devid:1 by adding a new device and removing the original
    btrfs dev add $thing2 test539
    btrfs dev del $thing1 test539
    echo Creating wiggleroom
    fallocate -l 3g test539/3g1 && fallocate -l 3g test539/3g2
    rm test539/3g1

    echo Start a resize operation and wait 3s to run a cancel
    echo Under 6.0 cancel, under 6.0.1 no cancel and runs out of space
    btrfs fi re 2:-4g test539 &
    sleep 3s && btrfs fi re cancel test539
    wait

    echo Cleanup
    umount test539

    losetup -d $thing1 && losetup -d $thing2

    rm /var/tmp/7g{1,2}
    rmdir test539

Issue: #539
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2022-11-09 18:59:12 +01:00
parent 1c6c2c2159
commit 4286eb552e

View File

@ -1124,7 +1124,6 @@ static int check_resize_args(const char *amount, const char *path) {
ret = 1;
goto out;
}
ret = 0;
sizestr = amount_dup;
devstr = strchr(sizestr, ':');
@ -1211,7 +1210,7 @@ static int check_resize_args(const char *amount, const char *path) {
out:
free(di_args);
return ret;
return 0;
}
static int cmd_filesystem_resize(const struct cmd_struct *cmd,