From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
To: Yu Kuai <yukuai1@huaweicloud.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-raid@vger.kernel.org, mariusz.tkaczyk@linux.intel.com,
song@kernel.org, pmenzel@molgen.mpg.de
Cc: Himanshu Madhani <himanshu.madhani@oracle.com>,
"regressions@lists.linux.dev" <regressions@lists.linux.dev>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
Darren Kenny <darren.kenny@oracle.com>,
"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [REGRESSION] kernel panic at bitmap_get_stats+0x2b/0xa0 since 6.12
Date: Fri, 24 Jan 2025 13:43:31 +0530 [thread overview]
Message-ID: <48589759-88c1-4d13-9f08-321484180a7f@oracle.com> (raw)
In-Reply-To: <6b72aec8-cc23-27d1-38ae-827bf800f21d@huaweicloud.com>
Hi Yu Kuai,
On 24/01/25 07:48, Yu Kuai wrote:
>
>
> 在 2025/01/24 9:30, Yu Kuai 写道:
...
>>
>
> Please use this patch, I found that last patch has problem while
> testing.
>
Thanks for the patch. After applying the below patch the problem is not
reproducible anymore. The boot succeeds without panic.
Regards,
Harshit
> Thanks,
>
> diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
> index 63879582d1c3..e01c2d0479e3 100644
> --- a/drivers/md/md-bitmap.c
> +++ b/drivers/md/md-bitmap.c
> @@ -2340,7 +2340,10 @@ static int bitmap_get_stats(void *data, struct
> md_bitmap_stats *stats)
>
> if (!bitmap)
> return -ENOENT;
> -
> + if (bitmap->mddev->bitmap_info.external)
> + return -ENOENT;
> + if (!bitmap->storage.sb_page) /* no superblock */
> + return -EINVAL;
> sb = kmap_local_page(bitmap->storage.sb_page);
> stats->sync_size = le64_to_cpu(sb->sync_size);
> kunmap_local(sb);
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 94166b2e9512..c9de57701e43 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -8470,6 +8470,10 @@ static int md_seq_show(struct seq_file *seq, void
> *v)
> return 0;
>
> spin_unlock(&all_mddevs_lock);
> +
> + /* prevent bitmap to be freed after checking */
> + mutex_lock(&mddev->bitmap_info.mutex);
> +
> spin_lock(&mddev->lock);
> if (mddev->pers || mddev->raid_disks || !list_empty(&mddev-
> >disks)) {
> seq_printf(seq, "%s : ", mdname(mddev));
> @@ -8545,6 +8549,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
> seq_printf(seq, "\n");
> }
> spin_unlock(&mddev->lock);
> + mutex_unlock(&mddev->bitmap_info.mutex);
> spin_lock(&all_mddevs_lock);
>
> if (mddev == list_last_entry(&all_mddevs, struct mddev,
> all_mddevs))
>
next prev parent reply other threads:[~2025-01-24 8:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-22 21:58 Harshit Mogalapalli
2025-01-24 1:30 ` Yu Kuai
2025-01-24 2:18 ` Yu Kuai
2025-01-24 8:13 ` Harshit Mogalapalli [this message]
2025-01-24 9:11 ` Yu Kuai
2025-01-24 9:13 ` Harshit Mogalapalli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48589759-88c1-4d13-9f08-321484180a7f@oracle.com \
--to=harshit.m.mogalapalli@oracle.com \
--cc=darren.kenny@oracle.com \
--cc=himanshu.madhani@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=mariusz.tkaczyk@linux.intel.com \
--cc=pmenzel@molgen.mpg.de \
--cc=regressions@lists.linux.dev \
--cc=song@kernel.org \
--cc=stable@vger.kernel.org \
--cc=yukuai1@huaweicloud.com \
--cc=yukuai3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®