Skip to content

btrfs-progs: fix the return value of "btrfs subvolume create"

Qu Wenruo linux-btrfs 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- Fix the missing "f" for the subject of the first patch
- Add the missing unmount of the test case

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs-progs: cmd/subvolume: fix return value when the target existscmds/subvolume.c+10 -10 replies
2/2btrfs-progs: cli-tests: add test case for return value of "btrfs subvlume create"tests/cli-tests/025-subvolume-create-failures/test.sh+32 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

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

[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