summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbd-Alrhman Masalkhi <abd.masalkhi@gmail.com>2026-04-23 13:13:02 +0300
committerYu Kuai <yukuai@fnnas.com>2026-04-28 15:44:38 +0300
commit408434a3245cc6ea981df4edd7fbf0be49856727 (patch)
tree3c5445f4f1555ecd0e16ec37c789ecf6a19b7c6e
parentc1a3cdb0b49fff28d90e2c33114a7c0058261f60 (diff)
downloadlinux-408434a3245cc6ea981df4edd7fbf0be49856727.tar.xz
md: use mddev_is_dm() instead of open-coding gendisk checks
Replace direct checks on mddev->gendisk with mddev_is_dm() in md_handle_request() and md_run(). Signed-off-by: Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com> Link: https://lore.kernel.org/linux-raid/20260423101303.48196-3-abd.masalkhi@gmail.com Signed-off-by: Yu Kuai <yukuai@fnnas.com>
-rw-r--r--drivers/md/md.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 7937b927d923..a4b1048adbba 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -408,7 +408,7 @@ check_suspended:
if (!mddev->pers->make_request(mddev, bio)) {
percpu_ref_put(&mddev->active_io);
- if (!mddev->gendisk && mddev->pers->prepare_suspend)
+ if (mddev_is_dm(mddev) && mddev->pers->prepare_suspend)
return false;
goto check_suspended;
}
@@ -6746,7 +6746,7 @@ int md_run(struct mddev *mddev)
}
/* dm-raid expect sync_thread to be frozen until resume */
- if (mddev->gendisk)
+ if (!mddev_is_dm(mddev))
mddev->recovery = 0;
/* may be over-ridden by personality */