From: Mike Snitzer Date: Fri, 22 Jul 2022 19:31:23 +0000 (-0400) Subject: dm: return early from dm_pr_call() if DM device is suspended X-Git-Tag: v5.10.137~392 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b7e2d64d673abdecae8b8f3f44ef37820e7e8f6c;p=users%2Fdwmw2%2Flinux.git 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 Signed-off-by: Sasha Levin --- diff --git a/drivers/md/dm.c b/drivers/md/dm.c index ab0e2338e47ec..1005abf768609 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -3003,6 +3003,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;