Commit 04cb45b4 authored by Jens Axboe's avatar Jens Axboe

Merge branch 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-5.19

Pull MD fixes from Song.

* 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md:
  md/raid5-ppl: Fix argument order in bio_alloc_bioset()
  Revert "md: don't unregister sync_thread with reconfig_mutex held"
parents 2396e958 f34fdcd4
...@@ -3725,7 +3725,7 @@ static int raid_message(struct dm_target *ti, unsigned int argc, char **argv, ...@@ -3725,7 +3725,7 @@ static int raid_message(struct dm_target *ti, unsigned int argc, char **argv,
if (!strcasecmp(argv[0], "idle") || !strcasecmp(argv[0], "frozen")) { if (!strcasecmp(argv[0], "idle") || !strcasecmp(argv[0], "frozen")) {
if (mddev->sync_thread) { if (mddev->sync_thread) {
set_bit(MD_RECOVERY_INTR, &mddev->recovery); set_bit(MD_RECOVERY_INTR, &mddev->recovery);
md_reap_sync_thread(mddev, false); md_reap_sync_thread(mddev);
} }
} else if (decipher_sync_action(mddev, mddev->recovery) != st_idle) } else if (decipher_sync_action(mddev, mddev->recovery) != st_idle)
return -EBUSY; return -EBUSY;
......
...@@ -4831,7 +4831,7 @@ action_store(struct mddev *mddev, const char *page, size_t len) ...@@ -4831,7 +4831,7 @@ action_store(struct mddev *mddev, const char *page, size_t len)
flush_workqueue(md_misc_wq); flush_workqueue(md_misc_wq);
if (mddev->sync_thread) { if (mddev->sync_thread) {
set_bit(MD_RECOVERY_INTR, &mddev->recovery); set_bit(MD_RECOVERY_INTR, &mddev->recovery);
md_reap_sync_thread(mddev, true); md_reap_sync_thread(mddev);
} }
mddev_unlock(mddev); mddev_unlock(mddev);
} }
...@@ -6197,7 +6197,7 @@ static void __md_stop_writes(struct mddev *mddev) ...@@ -6197,7 +6197,7 @@ static void __md_stop_writes(struct mddev *mddev)
flush_workqueue(md_misc_wq); flush_workqueue(md_misc_wq);
if (mddev->sync_thread) { if (mddev->sync_thread) {
set_bit(MD_RECOVERY_INTR, &mddev->recovery); set_bit(MD_RECOVERY_INTR, &mddev->recovery);
md_reap_sync_thread(mddev, true); md_reap_sync_thread(mddev);
} }
del_timer_sync(&mddev->safemode_timer); del_timer_sync(&mddev->safemode_timer);
...@@ -9303,7 +9303,7 @@ void md_check_recovery(struct mddev *mddev) ...@@ -9303,7 +9303,7 @@ void md_check_recovery(struct mddev *mddev)
* ->spare_active and clear saved_raid_disk * ->spare_active and clear saved_raid_disk
*/ */
set_bit(MD_RECOVERY_INTR, &mddev->recovery); set_bit(MD_RECOVERY_INTR, &mddev->recovery);
md_reap_sync_thread(mddev, true); md_reap_sync_thread(mddev);
clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery); clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery);
clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery); clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
clear_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags); clear_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags);
...@@ -9338,7 +9338,7 @@ void md_check_recovery(struct mddev *mddev) ...@@ -9338,7 +9338,7 @@ void md_check_recovery(struct mddev *mddev)
goto unlock; goto unlock;
} }
if (mddev->sync_thread) { if (mddev->sync_thread) {
md_reap_sync_thread(mddev, true); md_reap_sync_thread(mddev);
goto unlock; goto unlock;
} }
/* Set RUNNING before clearing NEEDED to avoid /* Set RUNNING before clearing NEEDED to avoid
...@@ -9411,18 +9411,14 @@ void md_check_recovery(struct mddev *mddev) ...@@ -9411,18 +9411,14 @@ void md_check_recovery(struct mddev *mddev)
} }
EXPORT_SYMBOL(md_check_recovery); EXPORT_SYMBOL(md_check_recovery);
void md_reap_sync_thread(struct mddev *mddev, bool reconfig_mutex_held) void md_reap_sync_thread(struct mddev *mddev)
{ {
struct md_rdev *rdev; struct md_rdev *rdev;
sector_t old_dev_sectors = mddev->dev_sectors; sector_t old_dev_sectors = mddev->dev_sectors;
bool is_reshaped = false; bool is_reshaped = false;
if (reconfig_mutex_held)
mddev_unlock(mddev);
/* resync has finished, collect result */ /* resync has finished, collect result */
md_unregister_thread(&mddev->sync_thread); md_unregister_thread(&mddev->sync_thread);
if (reconfig_mutex_held)
mddev_lock_nointr(mddev);
if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) && if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) &&
!test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) && !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) &&
mddev->degraded != mddev->raid_disks) { mddev->degraded != mddev->raid_disks) {
......
...@@ -719,7 +719,7 @@ extern struct md_thread *md_register_thread( ...@@ -719,7 +719,7 @@ extern struct md_thread *md_register_thread(
extern void md_unregister_thread(struct md_thread **threadp); extern void md_unregister_thread(struct md_thread **threadp);
extern void md_wakeup_thread(struct md_thread *thread); extern void md_wakeup_thread(struct md_thread *thread);
extern void md_check_recovery(struct mddev *mddev); extern void md_check_recovery(struct mddev *mddev);
extern void md_reap_sync_thread(struct mddev *mddev, bool reconfig_mutex_held); extern void md_reap_sync_thread(struct mddev *mddev);
extern int mddev_init_writes_pending(struct mddev *mddev); extern int mddev_init_writes_pending(struct mddev *mddev);
extern bool md_write_start(struct mddev *mddev, struct bio *bi); extern bool md_write_start(struct mddev *mddev, struct bio *bi);
extern void md_write_inc(struct mddev *mddev, struct bio *bi); extern void md_write_inc(struct mddev *mddev, struct bio *bi);
......
...@@ -629,9 +629,9 @@ static void ppl_do_flush(struct ppl_io_unit *io) ...@@ -629,9 +629,9 @@ static void ppl_do_flush(struct ppl_io_unit *io)
if (bdev) { if (bdev) {
struct bio *bio; struct bio *bio;
bio = bio_alloc_bioset(bdev, 0, GFP_NOIO, bio = bio_alloc_bioset(bdev, 0,
REQ_OP_WRITE | REQ_PREFLUSH, REQ_OP_WRITE | REQ_PREFLUSH,
&ppl_conf->flush_bs); GFP_NOIO, &ppl_conf->flush_bs);
bio->bi_private = io; bio->bi_private = io;
bio->bi_end_io = ppl_flush_endio; bio->bi_end_io = ppl_flush_endio;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment