lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 30 Mar 2009 12:59:35 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Jeff Garzik <jeff@...zik.org>
cc:	Jens Axboe <jens.axboe@...cle.com>,
	Fernando Luis Vázquez Cao 
	<fernando@....ntt.co.jp>, 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 Mon, 30 Mar 2009, Jeff Garzik wrote:
>
> Indeed -- if the drive tells us it failed the cache flush, it seems
> self-evident that we should be passing that failure back to userspace where
> possible.

That's not what EOPNOTSUPP means!

EOPNOTSUPP doesn't mean "the cache flush failed". It just means "I don't 
support cache flushing".

No failure anywhere. See?

Maybe the operation isn't supported becasue there are no caches? Who the 
hell knows? Nobody. The layer just said "I don't support this". For 
example, maybe it just cannot translate the "flush cache" op into its own 
command set, because the thing doesn't _do_ anything like that.

For a concrete example, look at the "loop" driver. It literally returns 
EOPNOTSUPP if the filesystem doesn't have a "fsync()" thing. Ok, so it 
can't do serialization - does that mean that the caller should fail 
entirely? No. But it means that the caller cannot serialize, so now the 
caller has two choices:

 - not work at all

 - ignore it, and assume that a device without serialization is serialized 
   enough as-is.

Those are the two only choices. The caller knows that it can't flush. What 
would you _suggest_ it do? Just stop, and do nothing at all? I rally don't 
think that's a useful or valid approach.

And notice - at NO TIME did anythign actually fail. It's just that the 
particular protocol didn't support that empty flush op.

(Also note that block/blk-barrier.c really does an empty barrier command. 
If we were to be talking about a real IO with a real payload and the 
"barrier" bit set, that would be different. But we really aren't.)


		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

Powered by Openwall GNU/*/Linux Powered by OpenVZ