Thread (11 messages) 11 messages, 3 authors, 2020-03-10

Re: Pausing md check hangs

From: Guoqing Jiang <hidden>
Date: 2020-03-10 20:27:15


On 3/10/20 4:30 PM, Georgi Nikolov wrote:
I have tried new 4.19 kernel with proposed patches with no success. Same story with md1_raid6 (last 
time it was with 5.4 and md10_raid6).
Did "cat /sys/block/mdX/md/journal_mode" still hang? I thought below change would help ...
quoted
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index 9b6da759dca2..a961d8eed73e 100644
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@ -2532,13 +2532,10 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page)
        struct r5conf *conf;
        int ret;

-       ret = mddev_lock(mddev);
-       if (ret)
-               return ret;
-
+       spin_lock(&mddev->lock);
        conf = mddev->private;
        if (!conf || !conf->log) {
-               mddev_unlock(mddev);
+               spin_unlock(&mddev->lock);
                return 0;
        }
@@ -2558,7 +2555,7 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page)
        default:
                ret = 0;
        }
-       mddev_unlock(mddev);
+       spin_unlock(&mddev->lock);
        return ret;
 }

Could you try with remove flush_workqueue(md_misc_wq) from below change? Or add some debug infos to 
see whether the hang is caused by flush_workqueue.
quoted
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4779,7 +4779,8 @@ action_store(struct mddev *mddev, const char *page, size_t len)
                if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) &&
                    mddev_lock(mddev) == 0) {
                        flush_workqueue(md_misc_wq);
-                       if (mddev->sync_thread) {
+                       if (mddev->sync_thread ||
+ test_bit(MD_RECOVERY_RUNNING,&mddev->recovery)) {
Thanks,
Guoqing
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help