From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751879AbdKYWsM (ORCPT ); Sat, 25 Nov 2017 17:48:12 -0500 Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:48276 "EHLO ipmail07.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751842AbdKYWsK (ORCPT ); Sat, 25 Nov 2017 17:48:10 -0500 Date: Sun, 26 Nov 2017 09:48:06 +1100 From: Dave Chinner To: David Howells Cc: Linus Torvalds , linux-afs@vger.kernel.org, linux-fsdevel , Linux Kernel Mailing List Subject: Re: [GIT PULL] afs: Fixes Message-ID: <20171125224806.GM4094@dastard> References: <26247.1511533324@warthog.procyon.org.uk> <23134.1511649343@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23134.1511649343@warthog.procyon.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 25, 2017 at 10:35:43PM +0000, David Howells wrote: > Linus Torvalds 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@fromorbit.com