[PATCH v2 00/17] fs: introduce new writeback error reporting and convert existing API as a wrapper around it
From: Jeff Layton
Date: Wed Apr 12 2017 - 08:10:41 EST
This is the second posting of this patchset. The basic idea with this
set is to tighten up how we handle errors that occur during writeback.
There are many places where writeback errors in the kernel can be lost
today, which can cause silent data corruption.
Also, the current method of clearing errors out of the mapping on fsync
has always been something of a problem for userland. This replaces it
with better defined semantics where userland can ensure that writeback
errors are reported on all open file descriptors.
In addition to incorporating review feedback (mostly from Neil and
Willy), this reworks the existing API for tracking writeback errors into
wrappers around the new API. That will greatly reduce the amount of code
we'll need to change in filesystem specific drivers if it turns out to
be an acceptable approach. If that does seem reasonable, then we can
probably get rid of the new API and just drop it in as replacements for
the old one.
Despite the small diffstat here this is a fairly major change to how
writeback errors are handled, and will need careful review and testing.
This works as expected with some really basic by-hand testing, and it of
course works when there are no errors in play. Once the patchset is a
bit more settled, I do still plan to roll some xfstests to validate that
this works and keeps working as expected.
Comments and feedback are welcome here.
Jeff Layton (17):
mm: drop "wait" parameter from write_one_page
mm: fix mapping_set_error call in me_pagecache_dirty
buffer: use mapping_set_error instead of setting the flag
ext2: don't test/clear AS_EIO flag
orangefs: don't call filemap_write_and_wait from fsync
mm: doc comment for scary spot in write_one_page
fs: new infrastructure for writeback error handling and reporting
fs: retrofit old error reporting API onto new infrastructure
mm: remove AS_EIO and AS_ENOSPC flags
dax: set errors in mapping when writeback fails
nilfs2: set the mapping error when calling SetPageError on writeback
mm: ensure that we set mapping error if writeout() fails
mm: don't TestClearPageError in __filemap_fdatawait_range
9p: set mapping error when writeback fails in launder_page
fuse: set mapping error in writepage_locked when it fails
cifs: set mapping error when page writeback fails in writepage or
launder_pages
cifs: remove some unneeded mapping_set_error calls
Documentation/filesystems/vfs.txt | 13 +-
fs/9p/vfs_addr.c | 5 +-
fs/btrfs/file.c | 10 +-
fs/btrfs/tree-log.c | 9 +-
fs/buffer.c | 2 +-
fs/cifs/cifsfs.c | 4 +-
fs/cifs/file.c | 14 +--
fs/cifs/inode.c | 6 +-
fs/dax.c | 4 +-
fs/exofs/dir.c | 2 +-
fs/ext2/dir.c | 2 +-
fs/ext2/file.c | 8 +-
fs/f2fs/file.c | 3 +
fs/f2fs/node.c | 6 +-
fs/fuse/file.c | 8 +-
fs/jfs/jfs_metapage.c | 4 +-
fs/minix/dir.c | 2 +-
fs/nilfs2/segment.c | 1 +
fs/open.c | 3 +
fs/orangefs/file.c | 5 +-
fs/sync.c | 5 +-
fs/sysv/dir.c | 2 +-
fs/ufs/dir.c | 2 +-
include/linux/fs.h | 24 +++-
include/linux/mm.h | 2 +-
include/linux/pagemap.h | 17 +--
ipc/shm.c | 5 +-
mm/filemap.c | 258 ++++++++++++++++++++++++++++++++------
mm/memory-failure.c | 2 +-
mm/migrate.c | 6 +-
mm/page-writeback.c | 20 +--
31 files changed, 341 insertions(+), 113 deletions(-)
--
2.9.3