From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:35780 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751380AbdGRJcT (ORCPT ); Tue, 18 Jul 2017 05:32:19 -0400 Date: Tue, 18 Jul 2017 11:32:15 +0200 From: Lukas Czerner To: Jan Kara Cc: Jeff Moyer , linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk Subject: Re: [PATCH v2] fs: Fix page cache inconsistency when mixing buffered and AIO DIO Message-ID: <20170718093215.f7ze3h3ytmbb7slq@localhost.localdomain> References: <1499959036-9275-1-git-send-email-lczerner@redhat.com> <1500046823-25256-1-git-send-email-lczerner@redhat.com> <20170717151228.GG18199@quack2.suse.cz> <20170717152812.46yqfot6jkoqqgax@localhost.localdomain> <20170718073935.ffqoq5lc6vj4lhvx@localhost.localdomain> <20170718090626.GA2583@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170718090626.GA2583@quack2.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Jul 18, 2017 at 11:06:26AM +0200, Jan Kara wrote: > On Tue 18-07-17 09:39:35, Lukas Czerner wrote: > > On Mon, Jul 17, 2017 at 11:39:09AM -0400, Jeff Moyer wrote: > > > Lukas Czerner writes: > > > > > > > About the error case, is it not possible that some data has already been > > > > writtent to the disk despite the error ? > > > > > > Yes, it's possible. However, that data is in an inconsistent state, so > > > it shouldn't be read, anyway. > > > > I think it can be read if we wrote into already allocated space. > > > > > > > > Now, in the non-async path, we do the invalidation unconditionally, so I > > > could go either way on this. I don't think it's going to matter for > > > performance or data integrity. > > > > That's part of the reason why I did it unconditionaly as well, however > > Jan is right that ret would be negative. The way to fix it would differ > > depending on whether I am right about reading partially written data > > from AIO that failed. We still want to invalidate in that case. > > Frankly, I don't think it really matters so I'd go for not invalidating > anything on error just out of philosophy: "There's something weird going > on, bail out as quickly as you can." > > Honza Fair enough, thanks! -Lukas > -- > Jan Kara > SUSE Labs, CR