Messages in this thread | | | Date | Mon, 22 Sep 2014 07:25:19 -0700 | From | Christoph Hellwig <> | Subject | Re: [RFC v2 0/5] Non-blockling buffered fs read (page cache only) |
| |
On Mon, Sep 22, 2014 at 10:12:21AM -0400, Jonathan Corbet wrote: > 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?
You only have to look as far as Samba, but Jeff quoted an old lkml post earlier that had other examples.
source3/smbd/open.c:
if (first_open_attempt && lp_kernel_oplocks(SNUM(conn))) { /* * With kernel oplocks the open breaking an oplock * blocks until the oplock holder has given up the * oplock or closed the file. We prevent this by first * trying to open the file with O_NONBLOCK (see "man * fcntl" on Linux). For the second try, triggered by * an oplock break response, we do not need this * anymore. * * This is true under the assumption that only Samba * requests kernel oplocks. Once someone else like * NFSv4 starts to use that API, we will have to * modify this by communicating with the NFSv4 server. */ flags2 |= O_NONBLOCK; }
| |