linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET 0/4] vfs: actually return fs errors from ->sync_fs
@ 2022-01-26  2:18 Darrick J. Wong
  2022-01-26  2:18 ` [PATCH 1/4] vfs: make freeze_super abort when sync_filesystem returns error Darrick J. Wong
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Darrick J. Wong @ 2022-01-26  2:18 UTC (permalink / raw)
  To: djwong; +Cc: linux-xfs, linux-fsdevel, jack

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
because we only did it prior to rebooting, and best-effort was enough.

Nowadays, we've grown other callers that mandate persistence of fs
metadata, like syncfs(2) and quota sync.  Reporting internal fs errors
is critical for these functions, and we drop the errors.  Fix them, and
also fix FIFREEZE, so that userspace can't freeze broken filesystems.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=return-sync-fs-errors-5.17
---
 fs/quota/dquot.c   |   11 ++++++++---
 fs/super.c         |   19 ++++++++++++-------
 fs/sync.c          |   18 ++++++++++++------
 fs/xfs/xfs_super.c |    6 +++++-
 4 files changed, 37 insertions(+), 17 deletions(-)


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-01-27  9:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).