From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: dm-devel@redhat.com, Marian Csontos <mcsontos@redhat.com>,
Zdenek Kabelac <zkabelac@redhat.com>
Subject: Re: dm-integrity: revert adc0daad366b to fix recalculation
Date: Wed, 22 Jul 2020 15:45:36 -0400 [thread overview]
Message-ID: <20200722194536.GA28682@redhat.com> (raw)
In-Reply-To: <alpine.LRH.2.02.2007221444390.6426@file01.intranet.prod.int.rdu2.redhat.com>
On Wed, Jul 22 2020 at 2:46pm -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:
> Hi Mike
>
> Please submit this to Linus and to RHEL-8.
>
> Mikulas
>
>
>
> From: Mikulas Patocka <mpatocka@redhat.com>
>
> The patch adc0daad366b62ca1bce3e2958a40b0b71a8b8b3 broke recalculation on
> dm-integrity. The patch replaces a private variable "suspending" with a
> call to "dm_suspended".
>
> The problem is that dm_suspended returns true not only during suspend, but
> also during resume. This race condition could occur:
> 1. dm_integrity_resume calls queue_work(ic->recalc_wq, &ic->recalc_work)
> 2. integrity_recalc (&ic->recalc_work) preempts the current thread
> 3. integrity_recalc calls if (unlikely(dm_suspended(ic->ti))) goto unlock_ret;
> 4. integrity_recalc exits and no recalculating is done.
>
> In order to fix this race condition, we stop using dm_suspended and start
> using the variable "suspending" (that is only set during suspend, not
> during resume).
>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Fixes: adc0daad366b ("dm: report suspended device during destroy")
> Cc: stable@vger.kernel.org # v4.18+
OK, but why not add a dm_suspending() to DM core? Could be other
future targets would like this same info right? I don't see harm in
elevating it.
Mike
next prev parent reply other threads:[~2020-07-22 19:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-22 18:46 [PATCH] dm-integrity: revert adc0daad366b to fix recalculation Mikulas Patocka
2020-07-22 19:45 ` Mike Snitzer [this message]
2020-07-22 20:02 ` Mikulas Patocka
2020-07-23 14:42 ` [PATCH v2] " Mikulas Patocka
2020-07-23 18:23 ` Mike Snitzer
2020-07-23 18:39 ` Mikulas Patocka
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=20200722194536.GA28682@redhat.com \
--to=snitzer@redhat.com \
--cc=dm-devel@redhat.com \
--cc=mcsontos@redhat.com \
--cc=mpatocka@redhat.com \
--cc=zkabelac@redhat.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 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.