Skip to content

Commit 87efb79

Browse files
Mike Snitzergregkh
authored andcommitted
dm: return early from dm_pr_call() if DM device is suspended
[ 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 <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent f28d733 commit 87efb79

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/md/dm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2911,6 +2911,11 @@ static int dm_call_pr(struct block_device *bdev, iterate_devices_callout_fn fn,
29112911
goto out;
29122912
ti = dm_table_get_target(table, 0);
29132913

2914+
if (dm_suspended_md(md)) {
2915+
ret = -EAGAIN;
2916+
goto out;
2917+
}
2918+
29142919
ret = -EINVAL;
29152920
if (!ti->type->iterate_devices)
29162921
goto out;

0 commit comments

Comments
 (0)