Thread (2 messages) 2 messages, 2 authors, 2021-02-19

Re: [PATCH] btrfs-progs: fix return code for failed replace start

From: David Sterba <hidden>
Date: 2021-02-19 19:02:58

On Wed, Sep 30, 2020 at 10:46:14AM +0800, Anand Jain wrote:
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 adding a goto leave_with_error for this error which also fixes
the device open leak.

Signed-off-by: Anand Jain <redacted>
Added to devel, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help