linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@kernel.org>
To: Ming Lei <ming.lei@redhat.com>
Cc: brauner@kernel.org, czhong@redhat.com, dm-devel@lists.linux.dev,
	jack@suse.cz, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2] dm: restore synchronous close of device mapper block device
Date: Tue, 16 Apr 2024 23:27:29 -0400	[thread overview]
Message-ID: <Zh9BoXRYu_ZWrOsg@redhat.com> (raw)
In-Reply-To: <Zh8mx4yIGyv2InCq@fedora>

On Wed, Apr 17, 2024 at 09:32:55AM +0800, Ming Lei wrote:
> On Tue, Apr 16, 2024 at 11:28:42AM -0400, Mike Snitzer wrote:
> > From: Ming Lei <ming.lei@redhat.com>
> > 
> > 'dmsetup remove' and 'dmsetup remove_all' require synchronous bdev
> > release. Otherwise dm_lock_for_deletion() may return -EBUSY if the open
> > count is > 0, because the open count is dropped in dm_blk_close()
> > which occurs after fput() completes.
> > 
> > So if dm_blk_close() is delayed because of asynchronous fput(), this
> > device mapper device is skipped during remove, which is a regression.
> > 
> > Fix the issue by using __fput_sync().
> > 
> > Also: DM device removal has long supported being made asynchronous by
> > setting the DMF_DEFERRED_REMOVE flag on the DM device. So leverage
> > using async fput() in close_table_device() if DMF_DEFERRED_REMOVE flag
> > is set.
> 
> IMO, this way isn't necessary, because the patch is one bug fix, and we are
> supposed to recover into exact previous behavior before commit a28d893eb327
> ("md: port block device access to file") for minimizing regression risk.
> 
> But the extra change seems work.

I normally would agree but I see no real reason to avoid leveraging
async fput() for the async DM device removal use-case ;)

Mike

  reply	other threads:[~2024-04-17  3:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16  0:56 [PATCH] dm: core: put device mapper block device synchronously Ming Lei
2024-04-16 15:28 ` [PATCH v2] dm: restore synchronous close of device mapper block device Mike Snitzer
2024-04-17  1:32   ` Ming Lei
2024-04-17  3:27     ` Mike Snitzer [this message]
2024-04-18  2:31   ` Changhui Zhong

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=Zh9BoXRYu_ZWrOsg@redhat.com \
    --to=snitzer@kernel.org \
    --cc=brauner@kernel.org \
    --cc=czhong@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=ming.lei@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).