linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/20] fs: introduce new writeback error reporting and convert existing API as a wrapper around it
@ 2017-04-24 13:22 Jeff Layton
  2017-04-24 13:22 ` [PATCH v3 01/20] mm: drop "wait" parameter from write_one_page Jeff Layton
                   ` (19 more replies)
  0 siblings, 20 replies; 49+ messages in thread
From: Jeff Layton @ 2017-04-24 13:22 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel, linux-btrfs, linux-ext4, linux-cifs,
	linux-mm, jfs-discussion, linux-xfs, cluster-devel,
	linux-f2fs-devel, v9fs-developer, osd-dev, linux-nilfs,
	linux-block
  Cc: dhowells, akpm, hch, ross.zwisler, mawilcox, jack, viro, corbet,
	neilb, clm, tytso, axboe

v3: wb_err_t -> errseq_t
    clean up places that re-set errors after calling filemap_* functions

v2: introduce wb_err_t, use atomics

Apologies for the wide posting here, but this touches a lot of areas.
This is v3 of the patchset to improve how we're tracking and reporting
errors that occur during pagecache writeback.

There are several situations where the kernel can "lose" errors that
occur during writeback, such that fsync will return success even
though it failed to write back some data previously. The basic idea
here is to have the kernel be more deliberate about the point from
which errors are checked to ensure that that doesn't happen.

Additionally, this set changes the behavior of fsync in Linux to report
writeback errors on all fds instead of just the first one. This allows
writers to reliably tell whether their data made it to the backing
device without having to coordinate fsync calls with other writers.

This set sprawls over a large swath of kernel code. I think the first 12
patches in the series are pretty straightforward and are more or less
ready for merge.

The real changes start with patch 13. That adds support for errseq_t,
builds a new writeback error tracking API on top of that, and converts
the existing code to use it. After that, there are a few cleanup patches
to eliminate some unneeded error re-setting, etc.

Unfortunately, testing this across so many filesystems is rather
difficult. I have a xfstest for block-based filesystems that uses
dm_error that I'll post soon. That works well with ext4, but btrfs and
xfs seem to go r/o soon after the first error. I also don't have a good
general method for testing this on network filesystems (yet!).

I'd like to see better testing here and am open to suggestions. I will
note that the POSIX fsync spec says this:

"It is reasonable to assert that the key aspects of fsync() are
unreasonable to test in a test suite. That does not make the function
any less valuable, just more difficult to test. [...] It would also not
be unreasonable to omit testing for fsync(), allowing it to be treated
as a quality-of-implementation issue."

Of course, they're talking about a POSIX conformance test, but I
think the same point applies here.

At this point, I'd like to start getting some of the preliminary patches
merged (the first 12 or so). Most of those aren't terribly controversial
and seem like reasonable bugfixes and cleanups. If any subsystem
maintainers want to pick those up, then please do.

After that, I'd like to get the larger changes into linux-next with an
aim for merge in v4.13 or v4.14 (depending on how testing goes).

Feedback is of course welcome!

Jeff Layton (20):
  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
  fs: check for writeback errors after syncing out buffers in
    generic_file_fsync
  orangefs: don't call filemap_write_and_wait from fsync
  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
  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
  lib: add errseq_t type and infrastructure for handling it
  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
  mm: don't TestClearPageError in __filemap_fdatawait_range
  cifs: cleanup writeback handling errors and comments
  mm: clean up error handling in write_one_page
  jbd2: don't reset error in journal_finish_inode_data_buffers
  gfs2: clean up some filemap_* calls

 Documentation/filesystems/vfs.txt |   9 +-
 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                    |  17 ++--
 fs/cifs/inode.c                   |  22 ++---
 fs/dax.c                          |   4 +-
 fs/exofs/dir.c                    |   2 +-
 fs/ext2/dir.c                     |   2 +-
 fs/ext2/file.c                    |   2 +-
 fs/f2fs/file.c                    |   3 +
 fs/f2fs/node.c                    |   6 +-
 fs/fuse/file.c                    |   8 +-
 fs/gfs2/glops.c                   |  12 +--
 fs/gfs2/lops.c                    |   4 +-
 fs/gfs2/super.c                   |   6 +-
 fs/jbd2/commit.c                  |  13 +--
 fs/jfs/jfs_metapage.c             |   4 +-
 fs/libfs.c                        |   3 +
 fs/minix/dir.c                    |   2 +-
 fs/nilfs2/segment.c               |   1 +
 fs/open.c                         |   3 +
 fs/orangefs/file.c                |   5 +-
 fs/sysv/dir.c                     |   2 +-
 fs/ufs/dir.c                      |   2 +-
 include/linux/errseq.h            |  16 +++
 include/linux/fs.h                |  41 ++++++--
 include/linux/mm.h                |   2 +-
 include/linux/pagemap.h           |  18 ++--
 lib/Makefile                      |   2 +-
 lib/errseq.c                      | 199 ++++++++++++++++++++++++++++++++++++++
 mm/filemap.c                      |  88 ++++++++++-------
 mm/memory-failure.c               |   2 +-
 mm/migrate.c                      |   6 +-
 mm/page-writeback.c               |  23 +++--
 37 files changed, 398 insertions(+), 161 deletions(-)
 create mode 100644 include/linux/errseq.h
 create mode 100644 lib/errseq.c

-- 
2.9.3

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

end of thread, other threads:[~2017-04-25 16:43 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-24 13:22 [PATCH v3 00/20] fs: introduce new writeback error reporting and convert existing API as a wrapper around it Jeff Layton
2017-04-24 13:22 ` [PATCH v3 01/20] mm: drop "wait" parameter from write_one_page Jeff Layton
2017-04-24 15:22   ` Christoph Hellwig
2017-04-24 13:22 ` [PATCH v3 02/20] mm: fix mapping_set_error call in me_pagecache_dirty Jeff Layton
2017-04-24 15:22   ` Christoph Hellwig
2017-04-24 13:22 ` [PATCH v3 03/20] buffer: use mapping_set_error instead of setting the flag Jeff Layton
2017-04-24 15:22   ` Christoph Hellwig
2017-04-24 13:22 ` [PATCH v3 04/20] fs: check for writeback errors after syncing out buffers in generic_file_fsync Jeff Layton
2017-04-24 15:23   ` Christoph Hellwig
2017-04-24 15:46   ` Jan Kara
2017-04-24 13:22 ` [PATCH v3 05/20] orangefs: don't call filemap_write_and_wait from fsync Jeff Layton
2017-04-24 15:23   ` Christoph Hellwig
2017-04-24 18:18     ` Mike Marshall
2017-04-24 13:22 ` [PATCH v3 06/20] dax: set errors in mapping when writeback fails Jeff Layton
2017-04-24 15:24   ` Christoph Hellwig
2017-04-24 15:54   ` Jan Kara
2017-04-24 19:16   ` Ross Zwisler
2017-04-24 13:22 ` [PATCH v3 07/20] nilfs2: set the mapping error when calling SetPageError on writeback Jeff Layton
2017-04-24 15:24   ` Christoph Hellwig
2017-04-24 13:22 ` [PATCH v3 08/20] mm: ensure that we set mapping error if writeout() fails Jeff Layton
2017-04-24 15:24   ` Christoph Hellwig
2017-04-24 15:56   ` Jan Kara
2017-04-24 13:22 ` [PATCH v3 09/20] 9p: set mapping error when writeback fails in launder_page Jeff Layton
2017-04-24 15:24   ` Christoph Hellwig
2017-04-24 15:57   ` Jan Kara
2017-04-24 13:22 ` [PATCH v3 10/20] fuse: set mapping error in writepage_locked when it fails Jeff Layton
2017-04-24 15:25   ` Christoph Hellwig
2017-04-24 16:04   ` Jan Kara
2017-04-24 17:14     ` Jeff Layton
2017-04-25  8:17       ` Jan Kara
2017-04-25 10:35         ` Jeff Layton
2017-04-25 11:19           ` Jan Kara
2017-04-25 16:43             ` Jeff Layton
2017-04-24 13:22 ` [PATCH v3 11/20] cifs: set mapping error when page writeback fails in writepage or launder_pages Jeff Layton
2017-04-24 15:27   ` Christoph Hellwig
2017-04-24 17:16     ` Jeff Layton
2017-04-24 13:22 ` [PATCH v3 12/20] lib: add errseq_t type and infrastructure for handling it Jeff Layton
2017-04-24 13:22 ` [PATCH v3 13/20] fs: new infrastructure for writeback error handling and reporting Jeff Layton
2017-04-24 13:22 ` [PATCH v3 14/20] fs: retrofit old error reporting API onto new infrastructure Jeff Layton
2017-04-24 13:22 ` [PATCH v3 15/20] mm: remove AS_EIO and AS_ENOSPC flags Jeff Layton
2017-04-24 13:22 ` [PATCH v3 16/20] mm: don't TestClearPageError in __filemap_fdatawait_range Jeff Layton
2017-04-24 13:22 ` [PATCH v3 17/20] cifs: cleanup writeback handling errors and comments Jeff Layton
2017-04-24 13:22 ` [PATCH v3 18/20] mm: clean up error handling in write_one_page Jeff Layton
2017-04-24 13:22 ` [PATCH v3 19/20] jbd2: don't reset error in journal_finish_inode_data_buffers Jeff Layton
2017-04-24 13:22 ` [PATCH v3 20/20] gfs2: clean up some filemap_* calls Jeff Layton
2017-04-24 14:12   ` Bob Peterson
2017-04-24 16:59     ` Jeff Layton
2017-04-24 17:41       ` Bob Peterson
2017-04-24 17:52         ` Jeff Layton

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).