* [PATCH 0/2] s390/dasd: copy pair swap fixes
@ 2026-03-10 14:23 Stefan Haberland
2026-03-10 14:23 ` [PATCH 1/2] s390/dasd: Move quiesce state with pprc swap Stefan Haberland
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Stefan Haberland @ 2026-03-10 14:23 UTC (permalink / raw)
To: Jens Axboe
Cc: linux-block, Jan Hoeppner, linux-s390, Heiko Carstens,
Vasily Gorbik, Christian Borntraeger
Hi Jens,
Please apply the following two patches for the upcoming 7.0-rc.
Both patches are straightforward and address a rarely used code path.
While users are unlikely to encounter these issues in typical
deployments, the second patch is important as it addresses a potential
data corruption issue after a disk swap.
Best regards,
Stefan
Stefan Haberland (2):
s390/dasd: Move quiesce state with pprc swap
s390/dasd: Copy detected format information to secondary device
drivers/s390/block/dasd_eckd.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
--
2.51.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] s390/dasd: Move quiesce state with pprc swap
2026-03-10 14:23 [PATCH 0/2] s390/dasd: copy pair swap fixes Stefan Haberland
@ 2026-03-10 14:23 ` Stefan Haberland
2026-03-10 14:23 ` [PATCH 2/2] s390/dasd: Copy detected format information to secondary device Stefan Haberland
2026-03-10 14:58 ` [PATCH 0/2] s390/dasd: copy pair swap fixes Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Stefan Haberland @ 2026-03-10 14:23 UTC (permalink / raw)
To: Jens Axboe
Cc: linux-block, Jan Hoeppner, linux-s390, Heiko Carstens,
Vasily Gorbik, Christian Borntraeger
Quiesce and resume is a mechanism to suspend operations on DASD devices.
In the context of a controlled copy pair swap operation, the quiesce
operation is usually issued before the actual swap and a resume
afterwards.
During the swap operation, the underlying device is exchanged. Therefore,
the quiesce flag must be moved to the secondary device to ensure a
consistent quiesce state after the swap.
The secondary device itself cannot be suspended separately because there
is no separate block device representation for it.
Fixes: 413862caad6f ("s390/dasd: add copy pair swap capability")
Cc: stable@vger.kernel.org #6.1
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
---
drivers/s390/block/dasd_eckd.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index cb068d5e2145..2b9a8dd3ea89 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -6182,6 +6182,11 @@ static int dasd_eckd_copy_pair_swap(struct dasd_device *device, char *prim_busid
dev_name(&secondary->cdev->dev), rc);
}
+ if (primary->stopped & DASD_STOPPED_QUIESCE) {
+ dasd_device_set_stop_bits(secondary, DASD_STOPPED_QUIESCE);
+ dasd_device_remove_stop_bits(primary, DASD_STOPPED_QUIESCE);
+ }
+
/* re-enable device */
dasd_device_remove_stop_bits(primary, DASD_STOPPED_PPRC);
dasd_device_remove_stop_bits(secondary, DASD_STOPPED_PPRC);
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] s390/dasd: Copy detected format information to secondary device
2026-03-10 14:23 [PATCH 0/2] s390/dasd: copy pair swap fixes Stefan Haberland
2026-03-10 14:23 ` [PATCH 1/2] s390/dasd: Move quiesce state with pprc swap Stefan Haberland
@ 2026-03-10 14:23 ` Stefan Haberland
2026-03-10 14:58 ` [PATCH 0/2] s390/dasd: copy pair swap fixes Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Stefan Haberland @ 2026-03-10 14:23 UTC (permalink / raw)
To: Jens Axboe
Cc: linux-block, Jan Hoeppner, linux-s390, Heiko Carstens,
Vasily Gorbik, Christian Borntraeger
During online processing for a DASD device an IO operation is started to
determine the format of the device. CDL format contains specifically
sized blocks at the beginning of the disk.
For a PPRC secondary device no real IO operation is possible therefore
this IO request can not be started and this step is skipped for online
processing of secondary devices. This is generally fine since the
secondary is a copy of the primary device.
In case of an additional partition detection that is run after a swap
operation the format information is needed to properly drive partition
detection IO.
Currently the information is not passed leading to IO errors during
partition detection and a wrongly detected partition table which in turn
might lead to data corruption on the disk with the wrong partition table.
Fix by passing the format information from primary to secondary device.
Fixes: 413862caad6f ("s390/dasd: add copy pair swap capability")
Cc: stable@vger.kernel.org #6.1
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Acked-by: Eduard Shishkin <edward6@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
---
drivers/s390/block/dasd_eckd.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 2b9a8dd3ea89..14e58c336baa 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -6135,6 +6135,7 @@ static void copy_pair_set_active(struct dasd_copy_relation *copy, char *new_busi
static int dasd_eckd_copy_pair_swap(struct dasd_device *device, char *prim_busid,
char *sec_busid)
{
+ struct dasd_eckd_private *prim_priv, *sec_priv;
struct dasd_device *primary, *secondary;
struct dasd_copy_relation *copy;
struct dasd_block *block;
@@ -6155,6 +6156,9 @@ static int dasd_eckd_copy_pair_swap(struct dasd_device *device, char *prim_busid
if (!secondary)
return DASD_COPYPAIRSWAP_SECONDARY;
+ prim_priv = primary->private;
+ sec_priv = secondary->private;
+
/*
* usually the device should be quiesced for swap
* for paranoia stop device and requeue requests again
@@ -6187,6 +6191,13 @@ static int dasd_eckd_copy_pair_swap(struct dasd_device *device, char *prim_busid
dasd_device_remove_stop_bits(primary, DASD_STOPPED_QUIESCE);
}
+ /*
+ * The secondary device never got through format detection, but since it
+ * is a copy of the primary device, the format is exactly the same;
+ * therefore, the detected layout can simply be copied.
+ */
+ sec_priv->uses_cdl = prim_priv->uses_cdl;
+
/* re-enable device */
dasd_device_remove_stop_bits(primary, DASD_STOPPED_PPRC);
dasd_device_remove_stop_bits(secondary, DASD_STOPPED_PPRC);
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] s390/dasd: copy pair swap fixes
2026-03-10 14:23 [PATCH 0/2] s390/dasd: copy pair swap fixes Stefan Haberland
2026-03-10 14:23 ` [PATCH 1/2] s390/dasd: Move quiesce state with pprc swap Stefan Haberland
2026-03-10 14:23 ` [PATCH 2/2] s390/dasd: Copy detected format information to secondary device Stefan Haberland
@ 2026-03-10 14:58 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2026-03-10 14:58 UTC (permalink / raw)
To: Stefan Haberland
Cc: linux-block, Jan Hoeppner, linux-s390, Heiko Carstens,
Vasily Gorbik, Christian Borntraeger
On Tue, 10 Mar 2026 15:23:28 +0100, Stefan Haberland wrote:
> Please apply the following two patches for the upcoming 7.0-rc.
>
> Both patches are straightforward and address a rarely used code path.
> While users are unlikely to encounter these issues in typical
> deployments, the second patch is important as it addresses a potential
> data corruption issue after a disk swap.
>
> [...]
Applied, thanks!
[1/2] s390/dasd: Move quiesce state with pprc swap
commit: 40e9cd4ae8ec43b107ed2bff422a8fa39dcf4e4b
[2/2] s390/dasd: Copy detected format information to secondary device
commit: 4c527c7e030672efd788d0806d7a68972a7ba3c1
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-03-10 14:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 14:23 [PATCH 0/2] s390/dasd: copy pair swap fixes Stefan Haberland
2026-03-10 14:23 ` [PATCH 1/2] s390/dasd: Move quiesce state with pprc swap Stefan Haberland
2026-03-10 14:23 ` [PATCH 2/2] s390/dasd: Copy detected format information to secondary device Stefan Haberland
2026-03-10 14:58 ` [PATCH 0/2] s390/dasd: copy pair swap fixes Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox