Hi, Song: Thanks a lot for your fix. I've tested the patch by "v4.19.149" tag from Linux kernel stable tree (kernel/git/stable/linux.git). The test runs over 1000 rounds in 24 hours without kernel crash, so the patch should fix this issue. Best Regards, Winder ________________________________________ From: Song Liu <song@xxxxxxxxxx> Sent: Monday, October 5, 2020 3:40 PM To: Sung, KoWei Cc: linux-raid@xxxxxxxxxxxxxxx; Bshara, Saeed; Duan, HanShen; Tokoyo, Hiroshi; Fortin, Mike Subject: RE: [EXTERNAL] RAID5 issue with UBUNTU 20.04.1 on my desktop CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. Hi KoWei, On Mon, Sep 28, 2020 at 10:15 AM Song Liu <song@xxxxxxxxxx> wrote: > > On Mon, Sep 21, 2020 at 5:34 PM Sung, KoWei <winders@xxxxxxxxxx> wrote: > > > > Hi, Song Liu: > > > > May I know if you're able to reproduce this issue? Thanks a lot for your help. > Could you please verify whether the following patch fixes it? If it works well, please reply with your Test-by tag. Thanks, Song diff --git i/drivers/md/raid5.c w/drivers/md/raid5.c index 66690b40818e7..39343479ac2a9 100644 --- i/drivers/md/raid5.c +++ w/drivers/md/raid5.c @@ -2585,8 +2585,6 @@ static int resize_stripes(struct r5conf *conf, int newsize) } else err = -ENOMEM; - mutex_unlock(&conf->cache_size_mutex); - conf->slab_cache = sc; conf->active_name = 1-conf->active_name; @@ -2628,6 +2626,8 @@ static int resize_stripes(struct r5conf *conf, int newsize) if (!err) conf->pool_size = newsize; + mutex_unlock(&conf->cache_size_mutex); + return err; }