[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0903310953310.4093@localhost.localdomain>
Date: Tue, 31 Mar 2009 09:57:18 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Jens Axboe <jens.axboe@...cle.com>
cc: Ric Wheeler <rwheeler@...hat.com>,
Fernando Luis Vázquez Cao
<fernando@....ntt.co.jp>, Jeff Garzik <jeff@...zik.org>,
Christoph Hellwig <hch@...radead.org>,
Theodore Tso <tytso@....edu>, Ingo Molnar <mingo@...e.hu>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Arjan van de Ven <arjan@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Nick Piggin <npiggin@...e.de>, David Rees <drees76@...il.com>,
Jesper Krogh <jesper@...gh.cc>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
chris.mason@...cle.com, david@...morbit.com, tj@...nel.org
Subject: Re: [PATCH 1/7] block: Add block_flush_device()
On Tue, 31 Mar 2009, Jens Axboe wrote:
>
> So here's a test patch that attempts to just ignore such a failure to
> flush the caches.
I suspect you should not do it like this.
> diff --git a/fs/bio.c b/fs/bio.c
> index a040cde..79e3cec 100644
> --- a/fs/bio.c
> +++ b/fs/bio.c
> @@ -1380,7 +1380,17 @@ void bio_check_pages_dirty(struct bio *bio)
> **/
> void bio_endio(struct bio *bio, int error)
> {
> - if (error)
> + /*
> + * Special case here - hide the -EOPNOTSUPP from the driver or
> + * block layer, dump a warning the first time this happens so that
> + * the admin knows that we may not provide the ordering guarantees
> + * that are needed. Don't clear the uptodate bit.
> + */
> + if (error == -EOPNOTSUPP && bio_barrier(bio)) {
> + set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
> + blk_queue_set_noflush(bio->bi_bdev);
> + error = 0;
> + } else if (error)
I suspect this part is just wrong.
I could easily imagine a driver that returns EOPNOTSUPP only for a certain
_kind_ of bio.
For example, if the drive doesn't support FUA, then you cannot do a
serialized IO operation, but you can still mostly do a serialized op
without any IO attached to it.
IOW, the "empty flush" really _is_ special. An this check should not be in
the generic "bio_endio()" case, it should only be in the special
blkdev_issue_flush() case.
I think. No?
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists