From: Ayush Jain <ayush.jain3@amd.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: "sfr@canb.auug.org.au" <sfr@canb.auug.org.au>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
"Karny, Wyes" <Wyes.Karny@amd.com>, Jens Axboe <axboe@kernel.dk>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"V, Narasimhan" <Narasimhan.V@amd.com>,
"Shetty, Kalpana" <Kalpana.Shetty@amd.com>,
"Shukla, Santosh" <Santosh.Shukla@amd.com>
Subject: Re: Kernel null pointer dereference on stopping raid device
Date: Thu, 15 Jun 2023 11:14:02 +0530 [thread overview]
Message-ID: <fc7b82a6-a74a-7675-7cfd-4dd9ac10543b@amd.com> (raw)
In-Reply-To: <ZInIMLlMby2aNNr1@infradead.org>
On 6/14/2023 7:31 PM, Christoph Hellwig wrote:
> On Wed, Jun 14, 2023 at 09:54:07AM +0000, Jain, Ayush wrote:
>> Patch applied cleanly on next-20230614 and resolved the issue.
>>
>> Reported-by: Ayush Jain <ayush.jain3@amd.com>
>> Tested-by: Ayush Jain <ayush.jain3@amd.com>
>
> That was just a quick hack to verify the problem. I think this is
> the proper fix, can you try it as well?
>
Sure, this works on my machine.
Tested-by: Ayush Jain <ayush.jain3@amd.com>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index ca0de7ddd9434d..da523e80a4e990 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -2467,10 +2467,12 @@ static void export_rdev(struct md_rdev *rdev, struct mddev *mddev)
>
> static void md_kick_rdev_from_array(struct md_rdev *rdev)
> {
> - bd_unlink_disk_holder(rdev->bdev, rdev->mddev->gendisk);
> + struct mddev *mddev = rdev->mddev;
> +
> + bd_unlink_disk_holder(rdev->bdev, mddev->gendisk);
> list_del_rcu(&rdev->same_set);
> pr_debug("md: unbind<%pg>\n", rdev->bdev);
> - mddev_destroy_serial_pool(rdev->mddev, rdev, false);
> + mddev_destroy_serial_pool(mddev, rdev, false);
> rdev->mddev = NULL;
> sysfs_remove_link(&rdev->kobj, "block");
> sysfs_put(rdev->sysfs_state);
> @@ -2488,7 +2490,7 @@ static void md_kick_rdev_from_array(struct md_rdev *rdev)
> INIT_WORK(&rdev->del_work, rdev_delayed_delete);
> kobject_get(&rdev->kobj);
> queue_work(md_rdev_misc_wq, &rdev->del_work);
> - export_rdev(rdev, rdev->mddev);
> + export_rdev(rdev, mddev);
> }
>
> static void export_array(struct mddev *mddev)
Thanks & Regards,
Ayush Jain
next prev parent reply other threads:[~2023-06-15 5:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-13 20:12 Kernel null pointer dereference on stopping raid device Jain, Ayush
2023-06-14 7:10 ` Ayush Jain
2023-06-14 7:22 ` Christoph Hellwig
[not found] ` <IA1PR12MB61375A452083D65B5FB815DBBA5AA@IA1PR12MB6137.namprd12.prod.outlook.com>
2023-06-14 14:01 ` Christoph Hellwig
2023-06-15 5:44 ` Ayush Jain [this message]
2023-06-15 6:03 ` Christoph Hellwig
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=fc7b82a6-a74a-7675-7cfd-4dd9ac10543b@amd.com \
--to=ayush.jain3@amd.com \
--cc=Kalpana.Shetty@amd.com \
--cc=Narasimhan.V@amd.com \
--cc=Santosh.Shukla@amd.com \
--cc=Wyes.Karny@amd.com \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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