Skip to contentSkip to conversation

FAILED: patch "[PATCH] btrfs: dev-replace: go back to suspended state if target" failed to apply to 4.14-stable tree

PATCH [email protected] 2 participants 3 messages Jan 5, 2019 – Jan 29, 2019

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 0d228ece59a35a9b9e8ff0d40653234a6d90f61e Mon Sep 17 00:00:00 2001
From: Anand Jain <[email protected]>
Date: Sun, 11 Nov 2018 22:22:17 +0800
Subject: [PATCH] btrfs: dev-replace: go back to suspended state if target
device is missing

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")
fs/btrfs/dev-replace.c +2 -0
index 32da6901dc88..11df8f778b63 100644
@@ -890,6 +890,8 @@ int btrfs_resume_dev_replace_async(struct btrfs_fs_info *fs_info)
 			   "cannot continue dev_replace, tgtdev is missing");
 		btrfs_info(fs_info,
 			   "you may cancel the operation after 'mount -o degraded'");
+		dev_replace->replace_state =
+					BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED;
 		btrfs_dev_replace_write_unlock(dev_replace);
 		return 0;
 	}
Reviewed-by David Sterba
#1 lore raw

Hi Greg,

Quoted 5 lines · On Sat, Jan 05, 2019 at 06:14:02PM +0100, [email protected] wrote:

The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

The attached backported patch should now apply to 4.14-stable tree.

--
Regards
Sudip

From f36e6a70aa0fb80b4fc971324437b76d29e19c1c Mon Sep 17 00:00:00 2001
From: Anand Jain <[email protected]>
Date: Sun, 11 Nov 2018 22:22:17 +0800
Subject: [PATCH] btrfs: dev-replace: go back to suspended state if target
device is missing

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")
---
 fs/btrfs/dev-replace.c | 2 ++
 1 file changed, 2 insertions(+)
fs/btrfs/dev-replace.c +2 -0
index 68362eddaea2..f86457713e60 100644
@@ -804,6 +804,8 @@ int btrfs_resume_dev_replace_async(struct btrfs_fs_info *fs_info)
 			   "cannot continue dev_replace, tgtdev is missing");
 		btrfs_info(fs_info,
 			   "you may cancel the operation after 'mount -o degraded'");
+		dev_replace->replace_state =
+					BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED;
 		btrfs_dev_replace_unlock(dev_replace, 1);
 		return 0;
 	}
Signature · 1 line
2.11.0
author maintainer
#2 lore raw
Quoted 10 lines · Sudip Mukherjee

Hi Greg,

Quoted 5 lines · On Sat, Jan 05, 2019 at 06:14:02PM +0100, [email protected] wrote:

The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

The attached backported patch should now apply to 4.14-stable tree.

Now applied, thanks.

greg k-h