]> git.baikalelectronics.ru Git - kernel.git/commitdiff
dm: return early from dm_pr_call() if DM device is suspended
authorMike Snitzer <snitzer@kernel.org>
Fri, 22 Jul 2022 19:31:23 +0000 (15:31 -0400)
committerMike Snitzer <snitzer@kernel.org>
Thu, 28 Jul 2022 21:29:56 +0000 (17:29 -0400)
Otherwise PR ops may be issued while the broader DM device is being
reconfigured, etc.

Fixes: 193932c428ec ("dm: call PR reserve/unreserve on each underlying device")
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm.c

index 560ad05497a9db41e730658f46b707bbf84da936..e44415daa98fef0e715d6c88fda36ea904a16551 100644 (file)
@@ -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;