All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, jack@suse.com
Subject: Re: [PATCHSET 0/4] vfs: actually return fs errors from ->sync_fs
Date: Thu, 27 Jan 2022 10:11:03 +0100	[thread overview]
Message-ID: <20220127091103.yfmqj3u3fzxegrq3@wittgenstein> (raw)
In-Reply-To: <20220126180507.GB13499@magnolia>

On Wed, Jan 26, 2022 at 10:05:07AM -0800, Darrick J. Wong wrote:
> On Wed, Jan 26, 2022 at 09:21:53AM +0100, Christian Brauner wrote:
> > On Tue, Jan 25, 2022 at 06:18:09PM -0800, Darrick J. Wong wrote:
> > > Hi all,
> > > 
> > > While auditing the VFS code, I noticed that while ->sync_fs is allowed
> > > to return error codes to reflect some sort of internal filesystem error,
> > > none of the callers actually check the return value.  Back when this
> > > callout was introduced for sync_filesystem in 2.5 this didn't matter
> > 
> > (Also, it looks like that most(/none?) of the filesystems that
> > implemented ->sync_fs around 2.5/2.6 (ext3, jfs, jffs2, reiserfs etc.)
> > actually did return an error?
> 
> Yes, some of them do -- ext4 will bubble up jbd2 errors and the results
> of flushing the bdev write cache.
> 
> > In fact, 5.8 seems to be the first kernel to report other errors than
> > -EBADF since commit 735e4ae5ba28 ("vfs: track per-sb writeback errors
> > and report them to syncfs"?)
> 
> Yeah.  I think the bdev pagecache flush might occasionally return errors
> if there happened to be dirty pages, but (a) that doesn't help XFS which
> has its own buffer cache and (b) that doesn't capture the state "fs has
> errored out but media is fine".
> 
> As it is I think the ext4 syncfs needs to start returning EIO if someone
> forced a shutdown, and probably some auditing for dropped error codes
> due to the 'traditional' vfs behavior.  btrfs probably ought to return
> the result of filemap_flush too.

Makes sense. Fwiw,
Acked-by: Christian Brauner <brauner@kernel.org>

      reply	other threads:[~2022-01-27  9:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26  2:18 [PATCHSET 0/4] vfs: actually return fs errors from ->sync_fs Darrick J. Wong
2022-01-26  2:18 ` [PATCH 1/4] vfs: make freeze_super abort when sync_filesystem returns error Darrick J. Wong
2022-01-26 10:43   ` Jan Kara
2022-01-26 17:01   ` Christoph Hellwig
2022-01-26  2:18 ` [PATCH 2/4] vfs: make sync_filesystem return errors from ->sync_fs Darrick J. Wong
2022-01-26 10:44   ` Jan Kara
2022-01-26 17:01   ` Christoph Hellwig
2022-01-26  2:18 ` [PATCH 3/4] quota: make dquot_quota_sync " Darrick J. Wong
2022-01-26 10:45   ` Jan Kara
2022-01-26 17:03   ` Christoph Hellwig
2022-01-26  2:18 ` [PATCH 4/4] xfs: return errors in xfs_fs_sync_fs Darrick J. Wong
2022-01-26 10:45   ` Jan Kara
2022-01-26 17:03   ` Christoph Hellwig
2022-01-26  8:21 ` [PATCHSET 0/4] vfs: actually return fs errors from ->sync_fs Christian Brauner
2022-01-26 18:05   ` Darrick J. Wong
2022-01-27  9:11     ` Christian Brauner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220127091103.yfmqj3u3fzxegrq3@wittgenstein \
    --to=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=jack@suse.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.