From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com ([66.111.4.27]:38665 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbeDMNZi (ORCPT ); Fri, 13 Apr 2018 09:25:38 -0400 Date: Fri, 13 Apr 2018 06:25:35 -0700 From: Andres Freund To: Jeff Layton Cc: Dave Chinner , lsf-pc , Matthew Wilcox , Andreas Dilger , "Theodore Y. Ts'o" , Ext4 Developers List , Linux FS Devel , "Joshua D. Drake" Subject: Re: fsync() errors is unsafe and risks data loss Message-ID: <20180413132535.6o3ijzmk6birmvay@alap3.anarazel.de> References: <20180410220726.vunhvwuzxi5bm6e5@alap3.anarazel.de> <190CF56C-C03D-4504-8B35-5DB479801513@dilger.ca> <20180412021752.2wykkutkmzh4ikbf@alap3.anarazel.de> <20180412030248.GA8509@bombadil.infradead.org> <1523531354.4532.21.camel@redhat.com> <20180412120122.GE23861@dastard> <1523545730.4532.82.camel@redhat.com> <20180412224404.GA5572@dastard> <1523625536.4847.21.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1523625536.4847.21.camel@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, On 2018-04-13 09:18:56 -0400, Jeff Layton wrote: > Yes, I think we ought to probably do the same thing globally. It's nice > to know that xfs has already been doing this. That makes me feel better > about making this behavior the gold standard for Linux filesystems. > > So to summarize, at this point in the discussion, I think we want to > consider doing the following: > > * better reporting from syncfs (report an error when even one inode > failed to be written back since last syncfs call). We'll probably > implement this via a per-sb errseq_t in some fashion, though there are > some implementation issues to work out. > > * invalidate or clear uptodate flag on pages that experience writeback > errors, across filesystems. Encourage this as standard behavior for > filesystems and maybe add helpers to make it easier to do this. > > Did I miss anything? Would that be enough to help the Pg usecase? > > I don't see us ever being able to reasonably support its current > expectation that writeback errors will be seen on fd's that were opened > after the error occurred. That's a really thorny problem from an object > lifetime perspective. It's not perfect, but I think the amount of hacky OS specific code should be acceptable. And it does allow for a wrapper tool that can be used around backup restores etc to syncfs all the necessary filesystems. Let me mull with others for a bit. Greetings, Andres Freund