All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: dm-devel@redhat.com, Mikulas Patocka <mpatocka@redhat.com>,
	stable@vger.kernel.org
Subject: Re: [dm-devel] [PATCH v5.10] dm: fix mempool NULL pointer race when completing IO
Date: Tue, 3 May 2022 14:32:15 -0400	[thread overview]
Message-ID: <YnF1L4opPwLvBTLJ@redhat.com> (raw)
In-Reply-To: <Ymuj0Y2A6WHOi05c@kroah.com>

On Fri, Apr 29 2022 at  4:37P -0400,
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> On Thu, Apr 28, 2022 at 12:22:26PM -0400, Mikulas Patocka wrote:
> > 
> > 
> > On Tue, 26 Apr 2022, Greg Kroah-Hartman wrote:
> > 
> > > On Thu, Apr 21, 2022 at 02:08:30PM -0400, Mikulas Patocka wrote:
> > > > Hi
> > > 
> > > Not really needed in a changelog text :)
> > > 
> > > > This is backport of patches d208b89401e0 ("dm: fix mempool NULL pointer
> > > > race when completing IO") and 9f6dc6337610 ("dm: interlock pending dm_io
> > > > and dm_wait_for_bios_completion") for the kernel 5.10.
> > > 
> > > Can you just make these 2 different patches?
> > > 
> > > > 
> > > > The bugs fixed by these patches can cause random crashing when reloading
> > > > dm table, so it is eligible for stable backport.
> > > > 
> > > > This patch is different from the upstream patches because the code
> > > > diverged significantly.
> > > > 
> > > 
> > > This change is _VERY_ different.  I would need acks from the maintainers
> > > of this code before I could accept this, along with a much more detailed
> > > description of why the original commits will not work here as well.
> > > 
> > > Same for the other backports.
> > 
> > Regarding backporting of 9f6dc633:
> > 
> > My reasoning was that introducing "md->pending_io" in the backported 
> > stable kernels is useless - it will just degrade performance by consuming 
> > one more cache line per I/O without providing any gain.
> > 
> > In the upstream kernels, Mike needs that "md->pending_io" variable for 
> > other reasons (the I/O accounting was reworked there in order to avoid 
> > some spikes with dm-crypt), but there is no need for it in the stable 
> > kernels.
> > 
> > In order to fix that race condition, all we need to do is to make sure 
> > that dm_stats_account_io is called before bio_end_io_acct - and the patch 
> > does that - it swaps them.
> > 
> > Do you still insist that this useless percpu variable must be added to the 
> > stable kernels? If you do, I can make it, but I think it's better to just 
> > swap those two functions.
> 
> I am no insisting on anything, I want the dm maintainers to agree that
> this change is acceptable to take as it is not what is in Linus's tree.
> Every time we take a "not upstream" commit, the odds are 90% that it
> ends up being wrong, so I need extra review and assurances that it is
> acceptable before I can apply it.

FYI, I've reviewed Mikulas's latest stable backport patches (not yet
posted) and provided by Reviewed-by.  So once you see them you can
trust I've looked at the changes and am fine with you picking them up.

Thanks,
Mike

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


WARNING: multiple messages have this Message-ID (diff)
From: Mike Snitzer <snitzer@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Mikulas Patocka <mpatocka@redhat.com>,
	dm-devel@redhat.com, stable@vger.kernel.org
Subject: Re: [PATCH v5.10] dm: fix mempool NULL pointer race when completing IO
Date: Tue, 3 May 2022 14:32:15 -0400	[thread overview]
Message-ID: <YnF1L4opPwLvBTLJ@redhat.com> (raw)
In-Reply-To: <Ymuj0Y2A6WHOi05c@kroah.com>

On Fri, Apr 29 2022 at  4:37P -0400,
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> On Thu, Apr 28, 2022 at 12:22:26PM -0400, Mikulas Patocka wrote:
> > 
> > 
> > On Tue, 26 Apr 2022, Greg Kroah-Hartman wrote:
> > 
> > > On Thu, Apr 21, 2022 at 02:08:30PM -0400, Mikulas Patocka wrote:
> > > > Hi
> > > 
> > > Not really needed in a changelog text :)
> > > 
> > > > This is backport of patches d208b89401e0 ("dm: fix mempool NULL pointer
> > > > race when completing IO") and 9f6dc6337610 ("dm: interlock pending dm_io
> > > > and dm_wait_for_bios_completion") for the kernel 5.10.
> > > 
> > > Can you just make these 2 different patches?
> > > 
> > > > 
> > > > The bugs fixed by these patches can cause random crashing when reloading
> > > > dm table, so it is eligible for stable backport.
> > > > 
> > > > This patch is different from the upstream patches because the code
> > > > diverged significantly.
> > > > 
> > > 
> > > This change is _VERY_ different.  I would need acks from the maintainers
> > > of this code before I could accept this, along with a much more detailed
> > > description of why the original commits will not work here as well.
> > > 
> > > Same for the other backports.
> > 
> > Regarding backporting of 9f6dc633:
> > 
> > My reasoning was that introducing "md->pending_io" in the backported 
> > stable kernels is useless - it will just degrade performance by consuming 
> > one more cache line per I/O without providing any gain.
> > 
> > In the upstream kernels, Mike needs that "md->pending_io" variable for 
> > other reasons (the I/O accounting was reworked there in order to avoid 
> > some spikes with dm-crypt), but there is no need for it in the stable 
> > kernels.
> > 
> > In order to fix that race condition, all we need to do is to make sure 
> > that dm_stats_account_io is called before bio_end_io_acct - and the patch 
> > does that - it swaps them.
> > 
> > Do you still insist that this useless percpu variable must be added to the 
> > stable kernels? If you do, I can make it, but I think it's better to just 
> > swap those two functions.
> 
> I am no insisting on anything, I want the dm maintainers to agree that
> this change is acceptable to take as it is not what is in Linus's tree.
> Every time we take a "not upstream" commit, the odds are 90% that it
> ends up being wrong, so I need extra review and assurances that it is
> acceptable before I can apply it.

FYI, I've reviewed Mikulas's latest stable backport patches (not yet
posted) and provided by Reviewed-by.  So once you see them you can
trust I've looked at the changes and am fine with you picking them up.

Thanks,
Mike

  reply	other threads:[~2022-05-03 18:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 18:08 [dm-devel] [PATCH v5.10] dm: fix mempool NULL pointer race when completing IO Mikulas Patocka
2022-04-21 18:08 ` Mikulas Patocka
2022-04-26  6:42 ` [dm-devel] " Greg Kroah-Hartman
2022-04-26  6:42   ` Greg Kroah-Hartman
2022-04-28 16:22   ` [dm-devel] " Mikulas Patocka
2022-04-28 16:22     ` Mikulas Patocka
2022-04-29  8:37     ` Greg Kroah-Hartman
2022-04-29  8:37       ` Greg Kroah-Hartman
2022-05-03 18:32       ` Mike Snitzer [this message]
2022-05-03 18:32         ` Mike Snitzer

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=YnF1L4opPwLvBTLJ@redhat.com \
    --to=snitzer@kernel.org \
    --cc=dm-devel@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=mpatocka@redhat.com \
    --cc=stable@vger.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.