Re: [PATCH 1/7] block: Add block_flush_device()
[Posted March 31, 2009 by corbet]
From: |
| Linus Torvalds <torvalds-AT-linux-foundation.org> |
To: |
| Fernando Luis Vázquez Cao <fernando-AT-oss.ntt.co.jp>, Jens Axboe <jens.axboe-AT-oracle.com> |
Subject: |
| Re: [PATCH 1/7] block: Add block_flush_device() |
Date: |
| Mon, 30 Mar 2009 10:34:32 -0700 (PDT) |
Message-ID: |
| <alpine.LFD.2.00.0903301028400.3948@localhost.localdomain> |
Cc: |
| Jeff Garzik <jeff-AT-garzik.org>,
Christoph Hellwig <hch-AT-infradead.org>,
Theodore Tso <tytso-AT-mit.edu>, Ingo Molnar <mingo-AT-elte.hu>,
Alan Cox <alan-AT-lxorguk.ukuu.org.uk>,
Arjan van de Ven <arjan-AT-infradead.org>,
Andrew Morton <akpm-AT-linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra-AT-chello.nl>,
Nick Piggin <npiggin-AT-suse.de>, David Rees <drees76-AT-gmail.com>,
Jesper Krogh <jesper-AT-krogh.cc>,
Linux Kernel Mailing List <linux-kernel-AT-vger.kernel.org>,
chris.mason-AT-oracle.com, david-AT-fromorbit.com, tj-AT-kernel.org |
Archive‑link: | |
Article |
On Mon, 30 Mar 2009, Fernando Luis Vázquez Cao wrote:
> + int ret = 0;
> +
> + ret = blkdev_issue_flush(bdev, NULL);
> +
> + return (ret == -EOPNOTSUPP) ? 0 : ret;
Btw, why do we do that silly EOPNOTSUPP at all?
If the device doesn't support flushing, we should
- set a flag in the device saying so, and not ever try to flush again on
that device (who knows how long it took for the device to say "I can't
do this"? We don't want to keep on doing it)
- return "done". There's nothing sane the caller can do with the error
code anyway, it just has to assume that the device basically doesn't
reorder writes.
So wouldn't it be better to just fix blkdev_issue_flush() to not do those
crazy error codes?
[ The same thing probably goes for those ENXIO errors, btw. If we don't
have a bd_disk or a queue, why would the caller care about it? ]
Jens?
Linus