btrfs-progs/cmds
Anand Jain ddf878187e btrfs-progs: fix return code for failed replace start
When replace starts with no-background and fails for the reason that
a BTRFS_FS_EXCL_OP is in progress, we still return the value 0 and also
leak the target device open, because in cmd_replace_start() we missed
the goto leave_with_error for this error.

So the test case btrfs/064 in its seqres.full output reports...

  Replacing /dev/sdf with /dev/sdc
  ERROR: /dev/sdc is mounted

instead of...

  Replacing /dev/sdc with /dev/sdf
  ERROR: ioctl(DEV_REPLACE_START) '/mnt/scratch': add/delete/balance/replace/resize operation in progress

for the failed replace attempts in the test case

Fix it by jumping to the error label which also fixes the leaked open
device.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-02-19 19:58:01 +01:00
..
balance.c btrfs-progs: add enqueue parameter for exclusive ops 2020-12-16 17:08:12 +01:00
commands.h btrfs-progs: help: define helper for command with flags 2019-07-03 20:49:04 +02:00
device.c btrfs-progs: build: fix linking with static libmount 2021-01-25 23:31:56 +01:00
filesystem-du.c btrfs-progs: fix short/long unit size options 2020-12-16 17:08:52 +01:00
filesystem-usage.c btrfs-progs: a bunch of typo fixes 2021-01-13 22:33:10 +01:00
filesystem-usage.h btrfs-progs: move all cmds-fi*.c to cmds/ 2019-07-03 20:49:03 +02:00
filesystem.c btrfs-progs: remove duplicate checks from cmd_filesystem_resize 2021-02-19 15:24:42 +01:00
inspect-dump-super.c btrfs-progs: move ctree.c to kernel-shared/ 2020-08-31 17:01:05 +02:00
inspect-dump-tree.c btrfs-progs: move volumes.c to kernel-shared/ 2020-08-31 17:01:06 +02:00
inspect-tree-stats.c btrfs-progs: move volumes.c to kernel-shared/ 2020-08-31 17:01:06 +02:00
inspect.c btrfs-progs: inspect: use find_mount_fsroot in logical-resolve 2021-01-18 17:49:22 +01:00
property.c btrfs-progs: move ctree.c to kernel-shared/ 2020-08-31 17:01:05 +02:00
qgroup.c btrfs-progs: build: fix linking with static libmount 2021-01-25 23:31:56 +01:00
quota.c btrfs-progs: move ctree.c to kernel-shared/ 2020-08-31 17:01:05 +02:00
receive-dump.c btrfs-progs: move send-utils.c to common/ 2020-08-31 17:01:04 +02:00
receive-dump.h btrfs-progs: move send-dump.c to cmds/receive-dump.c 2020-08-31 17:01:04 +02:00
receive.c btrfs-progs: receive: remove workaround for setting capabilities 2021-02-19 15:18:39 +01:00
replace.c btrfs-progs: fix return code for failed replace start 2021-02-19 19:58:01 +01:00
rescue-chunk-recover.c btrfs-progs: move volumes.c to kernel-shared/ 2020-08-31 17:01:06 +02:00
rescue-super-recover.c btrfs-progs: move volumes.c to kernel-shared/ 2020-08-31 17:01:06 +02:00
rescue.c btrfs-progs: rescue: add create-control-device subcommand 2021-02-19 16:19:37 +01:00
rescue.h btrfs-progs: super-recover: add global verbose option 2020-06-12 19:31:37 +02:00
restore.c btrfs-progs: docs: fix typo in btrfs restore message 2020-09-08 21:59:52 +02:00
scrub.c btrfs-progs: fix short/long unit size options 2020-12-16 17:08:52 +01:00
send.c btrfs-progs: send: fix crash on unknown option 2021-01-13 22:33:09 +01:00
subvolume.c btrfs-progs: subvol set-default: change id to 5 if specified as 0 2021-01-18 17:49:23 +01:00