[dm-devel] Patch "dm: return early from dm_pr_call() if DM device is suspended" has been added to the 5.19-stable tree

Sasha Levin sashal at kernel.org
Sat Aug 13 20:35:19 UTC 2022


This is a note to let you know that I've just added the patch titled

    dm: return early from dm_pr_call() if DM device is suspended

to the 5.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     dm-return-early-from-dm_pr_call-if-dm-device-is-susp.patch
and it can be found in the queue-5.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable at vger.kernel.org> know about it.



commit f761fdd04c63ecd9deed7fb48930ef9bd6fb3918
Author: Mike Snitzer <snitzer at kernel.org>
Date:   Fri Jul 22 15:31:23 2022 -0400

    dm: return early from dm_pr_call() if DM device is suspended
    
    [ Upstream commit e120a5f1e78fab6223544e425015f393d90d6f0d ]
    
    Otherwise PR ops may be issued while the broader DM device is being
    reconfigured, etc.
    
    Fixes: 9c72bad1f31a ("dm: call PR reserve/unreserve on each underlying device")
    Signed-off-by: Mike Snitzer <snitzer at kernel.org>
    Signed-off-by: Sasha Levin <sashal at kernel.org>

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 2b75f1ef7386..7c5d4734f109 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -3066,6 +3066,11 @@ static int dm_call_pr(struct block_device *bdev, iterate_devices_callout_fn fn,
 		goto out;
 	ti = dm_table_get_target(table, 0);
 
+	if (dm_suspended_md(md)) {
+		ret = -EAGAIN;
+		goto out;
+	}
+
 	ret = -EINVAL;
 	if (!ti->type->iterate_devices)
 		goto out;



More information about the dm-devel mailing list