]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
btrfs: dev-replace: go back to suspended state if target device is missing
authorAnand Jain <anand.jain@oracle.com>
Sun, 11 Nov 2018 14:22:17 +0000 (22:22 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit0107b33069604aa15e00c0edf776b4ee7d7e7f90
tree871b4920e39112f719eac4aa9b8bfd6b39136299
parentaae817ffb1146dbd8d9dd3b974508f20744a77a0
btrfs: dev-replace: go back to suspended state if target device is missing

BugLink: https://bugs.launchpad.net/bugs/1837257
commit 0d228ece59a35a9b9e8ff0d40653234a6d90f61e upstream.

At the time of forced unmount we place the running replace to
BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED state, so when the system comes
back and expect the target device is missing.

Then let the replace state continue to be in
BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED state instead of
BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED as there isn't any matching scrub
running as part of replace.

Fixes: e93c89c1aaaa ("Btrfs: add new sources for device replace code")
CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/btrfs/dev-replace.c