lkml.org 
[lkml]   [2009]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/7] block: Add block_flush_device()


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-03-30 19:53    [from the cache]
©2003-2011 Jasper Spaans