From: Mike Snitzer <snitzer@redhat.com>
To: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: dm-devel@redhat.com
Subject: Re: dm: lock bd_mutex when setting device size
Date: Mon, 1 Nov 2010 09:14:56 -0400 [thread overview]
Message-ID: <20101101131455.GA30753@redhat.com> (raw)
In-Reply-To: <4CCE69E4.9030406@ce.jp.nec.com>
On Mon, Nov 01 2010 at 3:19am -0400,
Jun'ichi Nomura <j-nomura@ce.jp.nec.com> wrote:
> Hi Mike,
>
> (10/30/10 06:50), Mike Snitzer wrote:
> > Avoid taking md->bdev->bd_inode->i_mutex to update the DM block device's
> > size. Using md->bdev->bd_mutex eliminates the potential for deadlock if
> > an fsync is racing with a device resize.
> >
> > revalidate_disk() was avoided because it would flush_disk() while the DM
> > device is suspended.
> >
> > Signed-off-by: Mike Snitzer <snitzer@redhat.com>
> > Cc: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
> > ---
> > drivers/md/dm.c | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > Jun'ichi, was the following your implict Acked-by? Care to make it
> > explicit?
> > "Anyway, I think your bd_mutex patch should be fine for now and is
> > better than the current code with i_mutex, which has a real deadlock
> > issue."
>
> No, it was not an ACK.
> (This is not multipath. So I think you don't need my ack.)
Your ack is always meaningful but that is fine too.
> I'm reluctant to ack this because, as I wrote, it's prone to
> cause deadlock in future.
> But I couldn't find a real problem with the patch,
> so I'm not NACK-ing either.
dm_swap_table's md->suspend_mutex already provides adequate protection
of __set_size's i_size_write. You didn't like this because it implied:
"dm_resume is the only code which calls i_size_write() for dm device".
I don't see that as a problem at all; its a more meaningful/enforcable
rule to have in DM than something tethered to the generic bd_mutex.
I'll discuss this further with Alasdair and/or others.
Mike
next prev parent reply other threads:[~2010-11-01 13:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-19 22:07 [PATCH] dm: use revalidate_disk to update device size after set_capacity Mike Snitzer
2010-10-20 5:42 ` Jun'ichi Nomura
2010-10-28 1:16 ` Mike Snitzer
2010-10-28 12:15 ` Jun'ichi Nomura
2010-10-28 19:54 ` Mike Snitzer
2010-10-28 22:18 ` Mike Snitzer
2010-10-29 3:00 ` Jun'ichi Nomura
2010-10-29 21:50 ` dm: lock bd_mutex when setting device size Mike Snitzer
2010-11-01 7:19 ` Jun'ichi Nomura
2010-11-01 13:14 ` Mike Snitzer [this message]
2010-11-03 18:06 ` [PATCH] dm: remove extra locking when changing " 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=20101101131455.GA30753@redhat.com \
--to=snitzer@redhat.com \
--cc=dm-devel@redhat.com \
--cc=j-nomura@ce.jp.nec.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.