linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Dmitry <dmonakhov@openvz.org>
Cc: linux-ext4@vger.kernel.org, akpm@linux-foundation.org, axboe@kernel.dk
Subject: Re: [PATCH -v2 6/6] ext4: use bio layer instead of buffer layer in mpage_da_submit_io
Date: Mon, 25 Oct 2010 08:33:53 -0400	[thread overview]
Message-ID: <20101025123353.GA16981@thunk.org> (raw)
In-Reply-To: <87tykavom7.fsf@dmon-lap.sw.ru>

On Mon, Oct 25, 2010 at 09:16:16AM +0400, Dmitry wrote:
> > +	if (bio) {
> > +		bio_get(io->io_bio);
> > +		submit_bio(io->io_op, io->io_bio);
> > +		BUG_ON(bio_flagged(io->io_bio, BIO_EOPNOTSUPP));
> Definitly this BUG_ON should be converted to ext4_error or something
> similar, otherwhise writeback attempt to removed usb-stick will be fatal
> for a whole system. IMHO it is reasonable to skip this check at all,
> because all work will be done in ext4_end_bio() anyway.
> > +		bio_put(io->io_bio);

Cut and pasted from XFS.  From what I could tell from the block I/O
layer, the only time the buffer I/O layer should return BIO_EOPNOTSUPP
is if we pass it a discard or barrier request, and we're doing neither
here.  So I don't think it should trigger on a removed usb-stick.

At the same time, it's not clear what good the BUG_ON() is doing here,
either.  So perhaps we could could drop the BUG_ON, at which point we
could drop the bio_get() and bio_put() calls, too.  To be honest I'm
not entirely sure why the XFS code does this.

Jens?  Any reason why I shouldn't just remove the bio_get(), the
BUG_ON()check, and bio_put() calls?

					- Ted

  reply	other threads:[~2010-10-25 12:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-23 20:40 [PATCH -v2 0/6] ext4: use the bio layer directly Theodore Ts'o
2010-10-23 20:40 ` [PATCH -v2 1/6] ext4: call mpage_da_submit_io() from mpage_da_map_blocks() Theodore Ts'o
2010-10-23 20:40 ` [PATCH -v2 2/6] ext4: simplify ext4_writepage() Theodore Ts'o
2010-10-23 20:40 ` [PATCH -v2 3/6] ext4: inline ext4_writepage() into mpage_da_submit_io() Theodore Ts'o
2010-10-23 20:40 ` [PATCH -v2 4/6] ext4: inline walk_page_buffers() into mpage_da_submit_io Theodore Ts'o
2010-10-23 20:40 ` [PATCH -v2 5/6] ext4: move mpage_put_bnr_to_bhs()'s functionality to mpage_da_submit_io() Theodore Ts'o
2010-10-23 20:40 ` [PATCH -v2 6/6] ext4: use bio layer instead of buffer layer in mpage_da_submit_io Theodore Ts'o
2010-10-25  5:16   ` Dmitry
2010-10-25 12:33     ` Ted Ts'o [this message]
2010-10-25 13:05       ` Dmitry
2010-10-23 23:03 ` [PATCH -v2 0/6] ext4: use the bio layer directly Ted Ts'o
2010-10-30 19:10 ` Eric Whitney

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=20101025123353.GA16981@thunk.org \
    --to=tytso@mit.edu \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=dmonakhov@openvz.org \
    --cc=linux-ext4@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 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).