All of lore.kernel.org
 help / color / mirror / Atom feed
From: jkhsjdhjs <jkhsjdhjs@totally.rip>
To: Song Liu <song@kernel.org>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: Re: NULL pointer dereference in blk_queue_flag_set
Date: Wed, 2 Feb 2022 13:50:44 +0100	[thread overview]
Message-ID: <858fc88b-40fe-5bb4-e9be-e8b5f66ff562@totally.rip> (raw)
In-Reply-To: <CAPhsuW5H1uROu868FhS5MNXuP=nS_=6b8zUrFv4jBjPEA=joPQ@mail.gmail.com>

Hey Song,

thanks for the quick reply! I applied your patch on top of 5.17-rc2 and 
it fixes the issue:

[   15.394670] device-mapper: raid: Loading target version 1.15.1
[   15.395216] device-mapper: raid: Ignoring chunk size parameter for RAID 1
[   15.395224] device-mapper: raid: Choosing default region size of 4MiB
[   15.399865] md/raid1:mdX: active with 2 out of 2 mirrors

Best Regards,

Leon

On 02.02.22 07:57, Song Liu wrote:
> Hi Leon,
>
> On Tue, Feb 1, 2022 at 2:15 PM jkhsjdhjs <jkhsjdhjs@totally.rip> wrote:
>> Dear Song Liu,
>>
>> my kernel (5.17-rc2) experiences a NULL pointer dereference when
>> activating an LDM (Windows Logical Disk Manager) on Arch Linux using
>> ldmtool [1]. I have attached the relevant excerpt of dmesg. This bug
>> causes my LDM RAID to fail activating (see ldmtool-status.txt and
>> lsblk.txt). Since this worked fine with 5.16 I bisected the kernel and
>> found, that commit f51d46d0e7cb5b8494aa534d276a9d8915a2443d [2]
>> introduced the issue.
>>
>> I'm not sure what else to add, if there's more information I can
>> provide, please tell me. Otherwise I'll happily assist in fixing this
>> issue - if there's something I can do.
> Thanks for the report! And sorry for the bug.
>
> For the next step, could you please test whether the following change
> fixes the issue?
>
> Best,
> Song
>
> diff --git i/drivers/md/md.c w/drivers/md/md.c
> index 854cbf4234aa..18e987c644c6 100644
> --- i/drivers/md/md.c
> +++ w/drivers/md/md.c
> @@ -5868,10 +5868,6 @@ int md_run(struct mddev *mddev)
>                  nowait = nowait && blk_queue_nowait(bdev_get_queue(rdev->bdev));
>          }
>
> -       /* Set the NOWAIT flags if all underlying devices support it */
> -       if (nowait)
> -               blk_queue_flag_set(QUEUE_FLAG_NOWAIT, mddev->queue);
> -
>          if (!bioset_initialized(&mddev->bio_set)) {
>                  err = bioset_init(&mddev->bio_set, BIO_POOL_SIZE, 0,
> BIOSET_NEED_BVECS);
>                  if (err)
> @@ -6009,6 +6005,10 @@ int md_run(struct mddev *mddev)
>                  else
>                          blk_queue_flag_clear(QUEUE_FLAG_NONROT, mddev->queue);
>                  blk_queue_flag_set(QUEUE_FLAG_IO_STAT, mddev->queue);
> +
> +               /* Set the NOWAIT flags if all underlying devices support it */
> +               if (nowait)
> +                       blk_queue_flag_set(QUEUE_FLAG_NOWAIT, mddev->queue);
>          }
>          if (pers->sync_request) {
>                  if (mddev->kobj.sd &&

  reply	other threads:[~2022-02-02 12:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 22:15 NULL pointer dereference in blk_queue_flag_set jkhsjdhjs
2022-02-02  6:57 ` Song Liu
2022-02-02 12:50   ` jkhsjdhjs [this message]
2022-02-02 16:57     ` Song Liu
2022-02-02 17:55       ` jkhsjdhjs
2022-02-02 18:24         ` Song Liu

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=858fc88b-40fe-5bb4-e9be-e8b5f66ff562@totally.rip \
    --to=jkhsjdhjs@totally.rip \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.