Re: [GIT PULL] afs: Fixes

From: Dave Chinner
Date: Sat Nov 25 2017 - 17:48:18 EST


On Sat, Nov 25, 2017 at 10:35:43PM +0000, David Howells wrote:
> 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?

Yes, but page_mkwrite will only block on writeback in progress is if
the backing device says it needs stable pages. See
wait_for_stable_page(). e.g. stable pages are required if RAID is
in use, otherwise modification during IO can result in broken
on-disk parity/mirroring....

Cheers,

Dave.
--
Dave Chinner
david@xxxxxxxxxxxxx