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]
Message-ID: <CANP1eJF6dt59eEtyGu5YzLj4zt876cqy=a32wFNSh13Rho7Gag@mail.gmail.com>
Date:	Mon, 22 Sep 2014 10:30:52 -0400
From:	Milosz Tanski <milosz@...in.com>
To:	Jonathan Corbet <corbet@....net>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Christoph Hellwig <hch@...radead.org>,
	"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
	linux-aio@...ck.org, Mel Gorman <mgorman@...e.de>,
	Volker Lendecke <Volker.Lendecke@...net.de>,
	Tejun Heo <tj@...nel.org>, Jeff Moyer <jmoyer@...hat.com>,
	"Theodore Ts'o" <tytso@....edu>, Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [RFC v2 0/5] Non-blockling buffered fs read (page cache only)

On Mon, Sep 22, 2014 at 10:12 AM, Jonathan Corbet <corbet@....net> wrote:
> On Fri, 19 Sep 2014 13:33:14 -0400
> Milosz Tanski <milosz@...in.com> wrote:
>
>> >  - Non-blocking I/O has long been supported with a well-understood set
>> >    of operations - O_NONBLOCK and fcntl().  Why do we need a different
>> >    mechanism here - one that's only understood in the context of
>> >    buffered file I/O?  I assume you didn't want to implement support
>> >    for poll() and all that, but is that a good enough reason to add a
>> >    new Linux-specific non-blocking I/O technique?
>>
>> I realized that I didn't answer this question well in my other long
>> email. O_NONBLOCK doesn't work on files under any commonly used OS,
>> and people have gotten use to this behavior so I doubt we could change
>> that without breaking a lot of folks applications.
>
> So I'm not contesting this, but I am genuinely curious: do you think
> there are applications out there requesting non-blocking behavior on
> regular files that will then break if they actually get non-blocking
> behavior?  I don't suppose you have an example?
>
> Thanks,
>
> jon

Earlier in this thread Jeff pointed (
https://lkml.org/lkml/2014/9/15/942 ) to a bug in RH bugzilla (
https://bugzilla.redhat.com/show_bug.cgi?id=136057 ) when an
application (squid) reads regular disk files started returning EAGAIN
when read from (provided that they were open with O_NONBLOCK) and
since that doesn't cause readhead it spins on it forever. As far as I
know O_NONBLOCK for regular files in Linux is undefined behavior as
non of the man pages I looked at (esp. fnctl, 2 open, 3 open) specify
what happens in the case of non-network, non-fifo case (some of them
refer to file descriptors that support non-blocking operation, which
is pretty vague).

So even if squid is wrong in it's behavior (since it's undefined), a
quick google search reveals lots of mailing lists / forum posts of
people essentially describing the behavior to date. Eg. O_NONBLOCK on
regular files blocks, with select/poll/epoll always returning a ready
behavior. Based on that anecdotical evidence, I assume a decent chunk
of user apps would beak.

- Milosz

-- 
Milosz Tanski
CTO
16 East 34th Street, 15th floor
New York, NY 10016

p: 646-253-9055
e: milosz@...in.com
--
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