Skip to content

Commit 3139100

Browse files
committed
Merge tag 'md-6.15-20250416' of https://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux into block-6.15
Pull MD fixes from Yu: "- fix raid10 missing discard IO accounting (Yu Kuai) - fix bitmap stats for bitmap file (Zheng Qixing) - fix oops while reading all member disks failed during check/repair (Meir Elisha)" * tag 'md-6.15-20250416' of https://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux: md/raid1: Add check for missing source disk in process_checks() md/md-bitmap: fix stats collection for external bitmaps md/raid10: fix missing discard IO accounting
2 parents 8158665 + b7c178d commit 3139100

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

drivers/md/md-bitmap.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,9 +2357,8 @@ static int bitmap_get_stats(void *data, struct md_bitmap_stats *stats)
23572357

23582358
if (!bitmap)
23592359
return -ENOENT;
2360-
if (bitmap->mddev->bitmap_info.external)
2361-
return -ENOENT;
2362-
if (!bitmap->storage.sb_page) /* no superblock */
2360+
if (!bitmap->mddev->bitmap_info.external &&
2361+
!bitmap->storage.sb_page)
23632362
return -EINVAL;
23642363
sb = kmap_local_page(bitmap->storage.sb_page);
23652364
stats->sync_size = le64_to_cpu(sb->sync_size);

drivers/md/raid1.c

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,14 +2200,9 @@ static int fix_sync_read_error(struct r1bio *r1_bio)
22002200
if (!rdev_set_badblocks(rdev, sect, s, 0))
22012201
abort = 1;
22022202
}
2203-
if (abort) {
2204-
conf->recovery_disabled =
2205-
mddev->recovery_disabled;
2206-
set_bit(MD_RECOVERY_INTR, &mddev->recovery);
2207-
md_done_sync(mddev, r1_bio->sectors, 0);
2208-
put_buf(r1_bio);
2203+
if (abort)
22092204
return 0;
2210-
}
2205+
22112206
/* Try next page */
22122207
sectors -= s;
22132208
sect += s;
@@ -2346,10 +2341,21 @@ static void sync_request_write(struct mddev *mddev, struct r1bio *r1_bio)
23462341
int disks = conf->raid_disks * 2;
23472342
struct bio *wbio;
23482343

2349-
if (!test_bit(R1BIO_Uptodate, &r1_bio->state))
2350-
/* ouch - failed to read all of that. */
2351-
if (!fix_sync_read_error(r1_bio))
2344+
if (!test_bit(R1BIO_Uptodate, &r1_bio->state)) {
2345+
/*
2346+
* ouch - failed to read all of that.
2347+
* No need to fix read error for check/repair
2348+
* because all member disks are read.
2349+
*/
2350+
if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) ||
2351+
!fix_sync_read_error(r1_bio)) {
2352+
conf->recovery_disabled = mddev->recovery_disabled;
2353+
set_bit(MD_RECOVERY_INTR, &mddev->recovery);
2354+
md_done_sync(mddev, r1_bio->sectors, 0);
2355+
put_buf(r1_bio);
23522356
return;
2357+
}
2358+
}
23532359

23542360
if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
23552361
process_checks(r1_bio);

drivers/md/raid10.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,6 +1735,7 @@ static int raid10_handle_discard(struct mddev *mddev, struct bio *bio)
17351735
* The discard bio returns only first r10bio finishes
17361736
*/
17371737
if (first_copy) {
1738+
md_account_bio(mddev, &bio);
17381739
r10_bio->master_bio = bio;
17391740
set_bit(R10BIO_Discard, &r10_bio->state);
17401741
first_copy = false;

0 commit comments

Comments
 (0)