aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-raid.c
diff options
context:
space:
mode:
authorYu Kuai <[email protected]>2025-05-06 12:49:00 +0000
committerYu Kuai <[email protected]>2025-05-10 08:12:19 +0000
commit7168be3c8a6b76ba10a51615a5bdf985dd502226 (patch)
tree22d91e532d69a7ae42da1090c2622b4cf4fb3a7a /drivers/md/dm-raid.c
parentblock: export API to get the number of bdev inflight IO (diff)
downloadkernel-7168be3c8a6b76ba10a51615a5bdf985dd502226.tar.gz
kernel-7168be3c8a6b76ba10a51615a5bdf985dd502226.zip
md: record dm-raid gendisk in mddev
Following patch will use gendisk to check if there are normal IO completed or inflight, to fix a problem in mdraid that foreground IO can be starved by background sync IO in later patches. Link: https://lore.kernel.org/linux-raid/[email protected] Signed-off-by: Yu Kuai <[email protected]> Reviewed-by: Xiao Ni <[email protected]>
Diffstat (limited to 'drivers/md/dm-raid.c')
-rw-r--r--drivers/md/dm-raid.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 6adc55fd90d3..127138c61be5 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -14,6 +14,7 @@
#include "raid5.h"
#include "raid10.h"
#include "md-bitmap.h"
+#include "dm-core.h"
#include <linux/device-mapper.h>
@@ -3308,6 +3309,7 @@ size_check:
/* Disable/enable discard support on raid set. */
configure_discard_support(rs);
+ rs->md.dm_gendisk = ti->table->md->disk;
mddev_unlock(&rs->md);
return 0;
@@ -3327,6 +3329,7 @@ static void raid_dtr(struct dm_target *ti)
mddev_lock_nointr(&rs->md);
md_stop(&rs->md);
+ rs->md.dm_gendisk = NULL;
mddev_unlock(&rs->md);
if (work_pending(&rs->md.event_work))