summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2025-09-05 05:08:27 -0600
committerJens Axboe <axboe@kernel.dk>2025-09-05 05:08:27 -0600
commit743bf030947169c413a711f60cebe73f837e649f (patch)
treee0113ac9d4079b77358225e90e7c8ec55426bf0b
parent1f6b281ac501ceaa121a9bece11260aecca70865 (diff)
parent7202082b7b7a256d04ec96131c7f859df0a79f64 (diff)
Merge tag 'md-6.17-20250905' of https://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux into block-6.17
Pull MD fixes from Yu: "- fix data loss for writemostly in raid1, by Yu Kuai; - fix potentional data lost by skipping recovery, by Li Nan;" * tag 'md-6.17-20250905' of https://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux: md: prevent incorrect update of resync/recovery offset md/raid1: fix data lost for writemostly rdev
-rw-r--r--drivers/md/md.c5
-rw-r--r--drivers/md/raid1.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 1baaf52c603c..4e033c26fdd4 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -9125,6 +9125,11 @@ void md_do_sync(struct md_thread *thread)
}
action = md_sync_action(mddev);
+ if (action == ACTION_FROZEN || action == ACTION_IDLE) {
+ set_bit(MD_RECOVERY_INTR, &mddev->recovery);
+ goto skip;
+ }
+
desc = md_sync_action_name(action);
mddev->last_sync_action = action;
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 408c26398321..bf44878ec640 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1225,7 +1225,7 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio,
int i = 0;
struct bio *behind_bio = NULL;
- behind_bio = bio_alloc_bioset(NULL, vcnt, 0, GFP_NOIO,
+ behind_bio = bio_alloc_bioset(NULL, vcnt, bio->bi_opf, GFP_NOIO,
&r1_bio->mddev->bio_set);
/* discard op, we don't support writezero/writesame yet */