From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:55840 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751972AbeDLU2g (ORCPT ); Thu, 12 Apr 2018 16:28:36 -0400 Date: Thu, 12 Apr 2018 13:28:30 -0700 From: Matthew Wilcox To: Andres Freund Cc: "Theodore Y. Ts'o" , Dave Chinner , Jeff Layton , Andreas Dilger , 20180410184356.GD3563@thunk.org, Ext4 Developers List , Linux FS Devel , "Joshua D. Drake" Subject: Re: fsync() errors is unsafe and risks data loss Message-ID: <20180412202830.GA18364@bombadil.infradead.org> 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> <20180412151646.GQ2801@thunk.org> <20180412201322.77igwnxfqbmnsxkf@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180412201322.77igwnxfqbmnsxkf@alap3.anarazel.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Apr 12, 2018 at 01:13:22PM -0700, Andres Freund wrote: > I think a per-file or even per-blockdev/fs error state that'd be > returned by fsync() would be more than sufficient. Ah; this was my suggestion to Jeff on IRC. That we add a per-superblock wb_err and then allow syncfs() to return it. So you'd open an fd on a directory (for example), and call syncfs() which would return -EIO or -ENOSPC if either of those conditions had occurred since you opened the fd. > I don't see that > that'd realistically would trigger OOM or the inability to unmount a > filesystem. Ted's referring to the current state of affairs where the writeback error is held in the inode; if we can't evict the inode because it's holding the error indicator, that can send us OOM. If instead we transfer the error indicator to the superblock, then there's no problem.