mbox series

[0/2] btrfs-progs: fix the return value of "btrfs

Message ID cover.1704855097.git.wqu@suse.com (mailing list archive)
Headers show
Series btrfs-progs: fix the return value of "btrfs | expand

Message

Qu Wenruo Jan. 10, 2024, 2:53 a.m. UTC
There is a bug report ("https://github.com/kdave/btrfs-progs/issues/730")
that after commit 5aa959fb3440 ("btrfs-progs: subvolume create: accept
multiple arguments"), "btrfs subvolume create" no longer properly return
1 for error cases.

It turns out that the offending commit changed how we determine the
return code, thus for several error cases, we still return 0 for
create_one_subvolume().

Fix it and add a test case for it.

Qu Wenruo (2):
  btrfs-progs: cmd/subvolume: ix return value when the target exists
  btrfs-progs: cli-tests: add test case for return value of "btrfs
    subvlume create"

 cmds/subvolume.c                              | 11 ++++++-
 .../025-subvolume-create-failures/test.sh     | 30 +++++++++++++++++++
 2 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100755 tests/cli-tests/025-subvolume-create-failures/test.sh

--
2.43.0

Comments

David Sterba Jan. 10, 2024, 3:20 a.m. UTC | #1
On Wed, Jan 10, 2024 at 01:23:30PM +1030, Qu Wenruo wrote:
> There is a bug report ("https://github.com/kdave/btrfs-progs/issues/730")
> that after commit 5aa959fb3440 ("btrfs-progs: subvolume create: accept
> multiple arguments"), "btrfs subvolume create" no longer properly return
> 1 for error cases.
> 
> It turns out that the offending commit changed how we determine the
> return code, thus for several error cases, we still return 0 for
> create_one_subvolume().
> 
> Fix it and add a test case for it.
> 
> Qu Wenruo (2):
>   btrfs-progs: cmd/subvolume: ix return value when the target exists
>   btrfs-progs: cli-tests: add test case for return value of "btrfs
>     subvlume create"

Added to devel, thanks.