Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'md-7.1-20260323' of git://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux into for-7.1/block

Pull MD changes from Yu Kuia:

"Bug Fixes:
- md: suppress spurious superblock update error message for dm-raid
(Chen Cheng)
- md/raid1: fix the comparing region of interval tree (Xiao Ni)
- md/raid10: fix deadlock with check operation and nowait requests
(Josh Hunt)
- md/raid5: skip 2-failure compute when other disk is R5_LOCKED
(FengWei Shih)
- md/md-llbitmap: raise barrier before state machine transition
(Yu Kuai)
- md/md-llbitmap: skip reading rdevs that are not in_sync (Yu Kuai)

Improvements:
- md/raid5: set chunk_sectors to enable full stripe I/O splitting
(Yu Kuai)

Cleanups:
- md: remove unused mddev argument from export_rdev (Chen Cheng)
- md/raid5: remove stale md_raid5_kick_device() declaration
(Chen Cheng)
- md/raid5: move handle_stripe() comment to correct location
(Chen Cheng)"

* tag 'md-7.1-20260323' of git://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux:
md: remove unused mddev argument from export_rdev
md/raid5: move handle_stripe() comment to correct location
md/raid5: remove stale md_raid5_kick_device() declaration
md/raid1: fix the comparing region of interval tree
md/raid5: skip 2-failure compute when other disk is R5_LOCKED
md/md-llbitmap: raise barrier before state machine transition
md/md-llbitmap: skip reading rdevs that are not in_sync
md/raid5: set chunk_sectors to enable full stripe I/O splitting
md/raid10: fix deadlock with check operation and nowait requests
md: suppress spurious superblock update error message for dm-raid

+42 -39
+6 -5
drivers/md/md-llbitmap.c
··· 459 459 rdev_for_each(rdev, mddev) { 460 460 sector_t sector; 461 461 462 - if (rdev->raid_disk < 0 || test_bit(Faulty, &rdev->flags)) 462 + if (rdev->raid_disk < 0 || test_bit(Faulty, &rdev->flags) || 463 + !test_bit(In_sync, &rdev->flags)) 463 464 continue; 464 465 465 466 sector = mddev->bitmap_info.offset + ··· 1070 1069 int page_start = (start + BITMAP_DATA_OFFSET) >> PAGE_SHIFT; 1071 1070 int page_end = (end + BITMAP_DATA_OFFSET) >> PAGE_SHIFT; 1072 1071 1073 - llbitmap_state_machine(llbitmap, start, end, BitmapActionStartwrite); 1074 - 1075 1072 while (page_start <= page_end) { 1076 1073 llbitmap_raise_barrier(llbitmap, page_start); 1077 1074 page_start++; 1078 1075 } 1076 + 1077 + llbitmap_state_machine(llbitmap, start, end, BitmapActionStartwrite); 1079 1078 } 1080 1079 1081 1080 static void llbitmap_end_write(struct mddev *mddev, sector_t offset, ··· 1102 1101 int page_start = (start + BITMAP_DATA_OFFSET) >> PAGE_SHIFT; 1103 1102 int page_end = (end + BITMAP_DATA_OFFSET) >> PAGE_SHIFT; 1104 1103 1105 - llbitmap_state_machine(llbitmap, start, end, BitmapActionDiscard); 1106 - 1107 1104 while (page_start <= page_end) { 1108 1105 llbitmap_raise_barrier(llbitmap, page_start); 1109 1106 page_start++; 1110 1107 } 1108 + 1109 + llbitmap_state_machine(llbitmap, start, end, BitmapActionDiscard); 1111 1110 } 1112 1111 1113 1112 static void llbitmap_end_discard(struct mddev *mddev, sector_t offset,
+17 -15
drivers/md/md.c
··· 98 98 static int remove_and_add_spares(struct mddev *mddev, 99 99 struct md_rdev *this); 100 100 static void mddev_detach(struct mddev *mddev); 101 - static void export_rdev(struct md_rdev *rdev, struct mddev *mddev); 101 + static void export_rdev(struct md_rdev *rdev); 102 102 static void md_wakeup_thread_directly(struct md_thread __rcu **thread); 103 103 104 104 /* ··· 959 959 list_for_each_entry_safe(rdev, tmp, &delete, same_set) { 960 960 list_del_init(&rdev->same_set); 961 961 kobject_del(&rdev->kobj); 962 - export_rdev(rdev, mddev); 962 + export_rdev(rdev); 963 963 } 964 964 965 965 if (!legacy_async_del_gendisk) { ··· 2632 2632 /* just for claiming the bdev */ 2633 2633 static struct md_rdev claim_rdev; 2634 2634 2635 - static void export_rdev(struct md_rdev *rdev, struct mddev *mddev) 2635 + static void export_rdev(struct md_rdev *rdev) 2636 2636 { 2637 2637 pr_debug("md: export_rdev(%pg)\n", rdev->bdev); 2638 2638 md_rdev_clear(rdev); ··· 2788 2788 if (!md_is_rdwr(mddev)) { 2789 2789 if (force_change) 2790 2790 set_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags); 2791 - pr_err("%s: can't update sb for read-only array %s\n", __func__, mdname(mddev)); 2791 + if (!mddev_is_dm(mddev)) 2792 + pr_err_ratelimited("%s: can't update sb for read-only array %s\n", 2793 + __func__, mdname(mddev)); 2792 2794 return; 2793 2795 } 2794 2796 ··· 4850 4848 err = bind_rdev_to_array(rdev, mddev); 4851 4849 out: 4852 4850 if (err) 4853 - export_rdev(rdev, mddev); 4851 + export_rdev(rdev); 4854 4852 mddev_unlock_and_resume(mddev); 4855 4853 if (!err) 4856 4854 md_new_event(); ··· 7142 7140 rdev_for_each_list(rdev, tmp, &candidates) { 7143 7141 list_del_init(&rdev->same_set); 7144 7142 if (bind_rdev_to_array(rdev, mddev)) 7145 - export_rdev(rdev, mddev); 7143 + export_rdev(rdev); 7146 7144 } 7147 7145 autorun_array(mddev); 7148 7146 mddev_unlock_and_resume(mddev); ··· 7152 7150 */ 7153 7151 rdev_for_each_list(rdev, tmp, &candidates) { 7154 7152 list_del_init(&rdev->same_set); 7155 - export_rdev(rdev, mddev); 7153 + export_rdev(rdev); 7156 7154 } 7157 7155 mddev_put(mddev); 7158 7156 } ··· 7340 7338 pr_warn("md: %pg has different UUID to %pg\n", 7341 7339 rdev->bdev, 7342 7340 rdev0->bdev); 7343 - export_rdev(rdev, mddev); 7341 + export_rdev(rdev); 7344 7342 return -EINVAL; 7345 7343 } 7346 7344 } 7347 7345 err = bind_rdev_to_array(rdev, mddev); 7348 7346 if (err) 7349 - export_rdev(rdev, mddev); 7347 + export_rdev(rdev); 7350 7348 return err; 7351 7349 } 7352 7350 ··· 7389 7387 /* This was a hot-add request, but events doesn't 7390 7388 * match, so reject it. 7391 7389 */ 7392 - export_rdev(rdev, mddev); 7390 + export_rdev(rdev); 7393 7391 return -EINVAL; 7394 7392 } 7395 7393 ··· 7415 7413 } 7416 7414 } 7417 7415 if (has_journal || mddev->bitmap) { 7418 - export_rdev(rdev, mddev); 7416 + export_rdev(rdev); 7419 7417 return -EBUSY; 7420 7418 } 7421 7419 set_bit(Journal, &rdev->flags); ··· 7430 7428 /* --add initiated by this node */ 7431 7429 err = mddev->cluster_ops->add_new_disk(mddev, rdev); 7432 7430 if (err) { 7433 - export_rdev(rdev, mddev); 7431 + export_rdev(rdev); 7434 7432 return err; 7435 7433 } 7436 7434 } ··· 7440 7438 err = bind_rdev_to_array(rdev, mddev); 7441 7439 7442 7440 if (err) 7443 - export_rdev(rdev, mddev); 7441 + export_rdev(rdev); 7444 7442 7445 7443 if (mddev_is_clustered(mddev)) { 7446 7444 if (info->state & (1 << MD_DISK_CANDIDATE)) { ··· 7503 7501 7504 7502 err = bind_rdev_to_array(rdev, mddev); 7505 7503 if (err) { 7506 - export_rdev(rdev, mddev); 7504 + export_rdev(rdev); 7507 7505 return err; 7508 7506 } 7509 7507 } ··· 7615 7613 return 0; 7616 7614 7617 7615 abort_export: 7618 - export_rdev(rdev, mddev); 7616 + export_rdev(rdev); 7619 7617 return err; 7620 7618 } 7621 7619
+2 -2
drivers/md/raid1.c
··· 62 62 unsigned long flags; 63 63 int ret = 0; 64 64 sector_t lo = r1_bio->sector; 65 - sector_t hi = lo + r1_bio->sectors; 65 + sector_t hi = lo + r1_bio->sectors - 1; 66 66 struct serial_in_rdev *serial = &rdev->serial[idx]; 67 67 68 68 spin_lock_irqsave(&serial->serial_lock, flags); ··· 452 452 int mirror = find_bio_disk(r1_bio, bio); 453 453 struct md_rdev *rdev = conf->mirrors[mirror].rdev; 454 454 sector_t lo = r1_bio->sector; 455 - sector_t hi = r1_bio->sector + r1_bio->sectors; 455 + sector_t hi = r1_bio->sector + r1_bio->sectors - 1; 456 456 bool ignore_error = !raid1_should_handle_error(bio) || 457 457 (bio->bi_status && bio_op(bio) == REQ_OP_DISCARD); 458 458
+2 -2
drivers/md/raid10.c
··· 1184 1184 } 1185 1185 1186 1186 if (!regular_request_wait(mddev, conf, bio, r10_bio->sectors)) { 1187 - raid_end_bio_io(r10_bio); 1187 + free_r10bio(r10_bio); 1188 1188 return; 1189 1189 } 1190 1190 ··· 1372 1372 1373 1373 sectors = r10_bio->sectors; 1374 1374 if (!regular_request_wait(mddev, conf, bio, sectors)) { 1375 - raid_end_bio_io(r10_bio); 1375 + free_r10bio(r10_bio); 1376 1376 return; 1377 1377 } 1378 1378
+15 -14
drivers/md/raid5.c
··· 3916 3916 break; 3917 3917 } 3918 3918 BUG_ON(other < 0); 3919 + if (test_bit(R5_LOCKED, &sh->dev[other].flags)) 3920 + return 0; 3919 3921 pr_debug("Computing stripe %llu blocks %d,%d\n", 3920 3922 (unsigned long long)sh->sector, 3921 3923 disk_idx, other); ··· 4596 4594 async_tx_quiesce(&tx); 4597 4595 } 4598 4596 4599 - /* 4600 - * handle_stripe - do things to a stripe. 4601 - * 4602 - * We lock the stripe by setting STRIPE_ACTIVE and then examine the 4603 - * state of various bits to see what needs to be done. 4604 - * Possible results: 4605 - * return some read requests which now have data 4606 - * return some write requests which are safely on storage 4607 - * schedule a read on some buffers 4608 - * schedule a write of some buffers 4609 - * return confirmation of parity correctness 4610 - * 4611 - */ 4612 - 4613 4597 static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s) 4614 4598 { 4615 4599 struct r5conf *conf = sh->raid_conf; ··· 4889 4901 set_bit(STRIPE_HANDLE, &head_sh->state); 4890 4902 } 4891 4903 4904 + /* 4905 + * handle_stripe - do things to a stripe. 4906 + * 4907 + * We lock the stripe by setting STRIPE_ACTIVE and then examine the 4908 + * state of various bits to see what needs to be done. 4909 + * Possible results: 4910 + * return some read requests which now have data 4911 + * return some write requests which are safely on storage 4912 + * schedule a read on some buffers 4913 + * schedule a write of some buffers 4914 + * return confirmation of parity correctness 4915 + */ 4892 4916 static void handle_stripe(struct stripe_head *sh) 4893 4917 { 4894 4918 struct stripe_head_state s; ··· 7780 7780 lim.logical_block_size = mddev->logical_block_size; 7781 7781 lim.io_min = mddev->chunk_sectors << 9; 7782 7782 lim.io_opt = lim.io_min * (conf->raid_disks - conf->max_degraded); 7783 + lim.chunk_sectors = lim.io_opt >> 9; 7783 7784 lim.features |= BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE; 7784 7785 lim.discard_granularity = stripe; 7785 7786 lim.max_write_zeroes_sectors = 0;
-1
drivers/md/raid5.h
··· 801 801 } 802 802 #endif 803 803 804 - void md_raid5_kick_device(struct r5conf *conf); 805 804 int raid5_set_cache_size(struct mddev *mddev, int size); 806 805 sector_t raid5_compute_blocknr(struct stripe_head *sh, int i, int previous); 807 806 void raid5_release_stripe(struct stripe_head *sh);