Skip to content

Commit

Permalink
dm: return early from dm_pr_call() if DM device is suspended
Browse files Browse the repository at this point in the history
[ Upstream commit e120a5f ]

Otherwise PR ops may be issued while the broader DM device is being
reconfigured, etc.

Fixes: 9c72bad ("dm: call PR reserve/unreserve on each underlying device")
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Mike Snitzer authored and gregkh committed Aug 17, 2022
1 parent f28d733 commit 87efb79
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2911,6 +2911,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;
Expand Down

0 comments on commit 87efb79

Please sign in to comment.