From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:41728 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751322AbdGRJGd (ORCPT ); Tue, 18 Jul 2017 05:06:33 -0400 Date: Tue, 18 Jul 2017 11:06:26 +0200 From: Jan Kara To: Lukas Czerner Cc: Jeff Moyer , Jan Kara , 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: <20170718090626.GA2583@quack2.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170718073935.ffqoq5lc6vj4lhvx@localhost.localdomain> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 -- Jan Kara SUSE Labs, CR