diff options
author | Mike Snitzer <snitzer@kernel.org> | 2022-07-22 21:31:23 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2022-07-28 23:29:56 +0200 |
commit | e120a5f1e78fab6223544e425015f393d90d6f0d (patch) | |
tree | f6b1810588487a27d8285a47dfa5cd6270f4fe1d /drivers/md/dm.c | |
parent | dm thin: fix use-after-free crash in dm_sm_register_threshold_callback (diff) | |
download | linux-e120a5f1e78fab6223544e425015f393d90d6f0d.tar.xz linux-e120a5f1e78fab6223544e425015f393d90d6f0d.zip |
dm: return early from dm_pr_call() if DM device is suspended
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@kernel.org>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r-- | drivers/md/dm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 560ad05497a9..e44415daa98f 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -3096,6 +3096,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; |