Skip to content

Commit 0d56d9c

Browse files
committed
Merge tag 'md-7.0-20260127' of git://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux into for-7.0/block
Pull MD updates from Yu: "Bug Fixes: - Fix raid5_run() to return error when log_init() fails (Yu Kuai) - Fix IO hang with degraded array with llbitmap (Yu Kuai) - Fix percpu_ref not resurrected on suspend timeout in llbitmap (Yu Kuai) - Fix GPF in write_page caused by resize race (Jack Wang) - Fix NULL pointer dereference in process_metadata_update (Jiasheng Jiang) - Fix hang when stopping arrays with metadata through dm-raid (Heinz Mauelshagen) - Fix any_working flag handling in raid10_sync_request (Li Nan) Cleanups & Refactoring: - Refactor sync/recovery code path, improve error handling for badblocks, and remove unused recovery_disabled field (Li Nan) - Consolidate mddev boolean fields into mddev_flags (Yu Kuai) Improvements: - Use mempool to allocate stripe_request_ctx and make sure max_sectors is not less than io_opt in raid5 (Yu Kuai)" * tag 'md-7.0-20260127' of git://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux: (23 commits) md raid: fix hang when stopping arrays with metadata through dm-raid md-cluster: fix NULL pointer dereference in process_metadata_update md/bitmap: fix GPF in write_page caused by resize race md/md-llbitmap: fix percpu_ref not resurrected on suspend timeout md/raid5: fix IO hang with degraded array with llbitmap md: remove recovery_disabled md/raid10: cleanup skip handling in raid10_sync_request md/raid10: fix any_working flag handling in raid10_sync_request md: move finish_reshape to md_finish_sync() md: factor out sync completion update into helper md: remove MD_RECOVERY_ERROR handling and simplify resync_offset update md: update curr_resync_completed even when MD_RECOVERY_INTR is set md: mark rdev Faulty when badblocks setting fails md: break remaining operations on badblocks set failure in narrow_write_error md/raid1,raid10: support narrow_write_error when badblocks is disabled md: factor error handling out of md_done_sync into helper md/raid1: simplify uptodate handling in end_sync_write md/raid5: make sure max_sectors is not less than io_opt md/raid5: use mempool to allocate stripe_request_ctx md: merge mddev serialize_policy into mddev_flags ...
2 parents 72a4175 + cefcb92 commit 0d56d9c

13 files changed

Lines changed: 310 additions & 353 deletions

File tree

drivers/md/md-bitmap.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,7 +2085,7 @@ static void bitmap_destroy(struct mddev *mddev)
20852085
return;
20862086

20872087
bitmap_wait_behind_writes(mddev);
2088-
if (!mddev->serialize_policy)
2088+
if (!test_bit(MD_SERIALIZE_POLICY, &mddev->flags))
20892089
mddev_destroy_serial_pool(mddev, NULL);
20902090

20912091
mutex_lock(&mddev->bitmap_info.mutex);
@@ -2453,6 +2453,7 @@ static int __bitmap_resize(struct bitmap *bitmap, sector_t blocks,
24532453
memcpy(page_address(store.sb_page),
24542454
page_address(bitmap->storage.sb_page),
24552455
sizeof(bitmap_super_t));
2456+
mutex_lock(&bitmap->mddev->bitmap_info.mutex);
24562457
spin_lock_irq(&bitmap->counts.lock);
24572458
md_bitmap_file_unmap(&bitmap->storage);
24582459
bitmap->storage = store;
@@ -2560,7 +2561,7 @@ static int __bitmap_resize(struct bitmap *bitmap, sector_t blocks,
25602561
set_page_attr(bitmap, i, BITMAP_PAGE_DIRTY);
25612562
}
25622563
spin_unlock_irq(&bitmap->counts.lock);
2563-
2564+
mutex_unlock(&bitmap->mddev->bitmap_info.mutex);
25642565
if (!init) {
25652566
__bitmap_unplug(bitmap);
25662567
bitmap->mddev->pers->quiesce(bitmap->mddev, 0);
@@ -2809,7 +2810,7 @@ backlog_store(struct mddev *mddev, const char *buf, size_t len)
28092810
mddev->bitmap_info.max_write_behind = backlog;
28102811
if (!backlog && mddev->serial_info_pool) {
28112812
/* serial_info_pool is not needed if backlog is zero */
2812-
if (!mddev->serialize_policy)
2813+
if (!test_bit(MD_SERIALIZE_POLICY, &mddev->flags))
28132814
mddev_destroy_serial_pool(mddev, NULL);
28142815
} else if (backlog && !mddev->serial_info_pool) {
28152816
/* serial_info_pool is needed since backlog is not zero */

drivers/md/md-cluster.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,13 @@ static void process_metadata_update(struct mddev *mddev, struct cluster_msg *msg
549549

550550
dlm_lock_sync(cinfo->no_new_dev_lockres, DLM_LOCK_CR);
551551

552-
/* daemaon thread must exist */
553552
thread = rcu_dereference_protected(mddev->thread, true);
553+
if (!thread) {
554+
pr_warn("md-cluster: Received metadata update but MD thread is not ready\n");
555+
dlm_unlock_sync(cinfo->no_new_dev_lockres);
556+
return;
557+
}
558+
554559
wait_event(thread->wqueue,
555560
(got_lock = mddev_trylock(mddev)) ||
556561
test_bit(MD_CLUSTER_HOLDING_MUTEX_FOR_RECVD, &cinfo->state));

drivers/md/md-llbitmap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,10 @@ static int llbitmap_suspend_timeout(struct llbitmap *llbitmap, int page_idx)
712712
percpu_ref_kill(&pctl->active);
713713

714714
if (!wait_event_timeout(pctl->wait, percpu_ref_is_zero(&pctl->active),
715-
llbitmap->mddev->bitmap_info.daemon_sleep * HZ))
715+
llbitmap->mddev->bitmap_info.daemon_sleep * HZ)) {
716+
percpu_ref_resurrect(&pctl->active);
716717
return -ETIMEDOUT;
718+
}
717719

718720
return 0;
719721
}

0 commit comments

Comments
 (0)