mbox series

[v2,0/2] btrfs-progs: fix the return value of "btrfs subvolume create"

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

Message

Qu Wenruo Jan. 10, 2024, 8:36 a.m. UTC
[CHANGELOG]
v2:
- Fix the missing "f" for the subject of the first patch
- Add the missing unmount of the test case

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: fix 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     | 32 +++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100755 tests/cli-tests/025-subvolume-create-failures/test.sh

--
2.43.0