Re: [GIT PULL] afs: Fixes

From: David Howells
Date: Sat Nov 25 2017 - 17:35:50 EST


Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> So I see in the commit message why afs needs to do this, but it's
> worth pointing out that it's
>
> (a) impossible to avoid the "inconsistent data" case for writable mmap'ed
> pages

Doesn't clear_page_dirty_for_io() write-protect the PTE for the page to be
written out, in which case ->page_mkwrite() will get called again before the
page is redirtied?

> (b) can cause some really nasty latency issues

True, but I think the most common case is a file being opened, written start
to finish and then closed. Actually, the worst-handled thing I've seen is a
shell script appending a bunch of things to a file because ->flush() syncs the
file each time it is closed:-/

What would you recommend instead? I'm currently trying and keep track of what
needs to be written so that I only write what's changed to the server, rather
than writing only whole pages.

David