Thread (2 messages) flat view 2 messages, 2 authors, 2015-03-30

Re: [PATCH v7 0/5] vfs: Non-blockling buffered fs read (page cache only)

From: Jeremy Allison <hidden>
Date: 2015-03-30 17:19:12
Also in: linux-arch, linux-fsdevel, lkml

On Mon, Mar 30, 2015 at 12:36:04AM -0700, Christoph Hellwig wrote:
On Fri, Mar 27, 2015 at 08:58:54AM -0700, Jeremy Allison wrote:
quoted
The problem with the above is that we can't tell the difference
between pread2() returning a short read because the pages are not
in cache, or because someone truncated the file. So we need some
way to differentiate this.
Is a race vs truncate really that time critical that you can't
wait for the thread pool to do the second read to notice it?
Probably not, as this is the fallback path anyway.
quoted
My preference from userspace would be for pread2() to return
EAGAIN if *all* the data requested is not available (where
'all' can be less than the size requested if the file has
been truncated in the meantime).
That is easily implementable, but I can see that for example web apps
would be happy to get as much as possible.  So if Samba can be ok
with short reads and only detecting the truncated case in the slow
path that would make life simpler.  Otherwise we might indeed need two
flags.
Simpler is better. I can live with the partial read+fallback.

Jeremy.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help