From: Christoph Hellwig <hch@lst.de>
To: Jan Kara <jack@suse.cz>
Cc: Rabin Vincent <rabin.vincent@axis.com>,
viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, Rabin Vincent <rabinv@axis.com>,
jaxboe@kernel.dk, hch@lst.de
Subject: Re: [PATCH] block: protect iterate_bdevs() against concurrent close
Date: Tue, 15 Mar 2016 08:51:45 +0100 [thread overview]
Message-ID: <20160315075145.GA11004@lst.de> (raw)
In-Reply-To: <20160310173727.GA19795@quack.suse.cz>
On Thu, Mar 10, 2016 at 06:37:27PM +0100, Jan Kara wrote:
> Thanks for spotting the problem. The patch will fix the problem you found.
> But what prevents e.g. flusher thread from trying to writeback the block
> device inode while that gets invalidated at the same moment? I.e., the
> problem doesn't seem to be specific to iterate_bdevs() but rather hits
> anything which writes back block device inodes, right?
>
> Frankly it seems like a catch that mapping_cap_foo() requires block device
> to be open (if mapping belongs to a block device) to be safe. The trouble
> is we'd need to make inode_to_bdi() result stable while we work with the
> block device inode. Christoph, do you have any idea how to cleanly achieve
> that? All I'm able to come up with are ugly hacks...
I think the whole idea of clearing a queue from a block device
just because it's not open is the root of the problem. Or, to dive
deeper into the issue our whole object model and life time rules
between struct block_device, struct gendisk, struct request_queue and
struct backing_dev_info are rather broken. I'd done a few attempt at
sorting this out, but it's a huge task and I haven't gotten far.
I think for now the patch from Rabin should be fine.
prev parent reply other threads:[~2016-03-15 7:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-10 12:26 [PATCH] block: protect iterate_bdevs() against concurrent close Rabin Vincent
2016-03-10 17:37 ` Jan Kara
2016-03-14 17:42 ` Rabin Vincent
2016-03-15 8:23 ` Jan Kara
2016-03-15 7:51 ` Christoph Hellwig [this message]
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=20160315075145.GA11004@lst.de \
--to=hch@lst.de \
--cc=jack@suse.cz \
--cc=jaxboe@kernel.dk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rabin.vincent@axis.com \
--cc=rabinv@axis.com \
--cc=viro@zeniv.linux.org.uk \
/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).