mbox series

[00/24] Begin removing PageError

Message ID 20220527155036.524743-1-willy@infradead.org (mailing list archive)
Headers show
Series Begin removing PageError | expand

Message

Matthew Wilcox May 27, 2022, 3:50 p.m. UTC
The approach I'm taking is to remove the checks for PageError (and
folio_test_error).  Once nobody is checking the error flag, we can safely
remove all places that set/clear it.

After this series, there are some places which still use it.  Lots of
the converted places are trivial -- they should have been checking the
uptodate flag.  The trickiest are the ones which have multiple steps
and signal "hey, something went wrong with one step in the read of this
page/folio" by setting the error flag.

I'm thinking about (ab)using PageChecked == PG_owner_priv_1 for this
purpose.  It'd be nice to be able to use page->private for this, but
that's not always available.  I know some filesystems already ascribe
a meaning to PG_owner_priv_1, but those can be distinguished by whether
the uptodate flag is set.

Thoughts?  Most of these look like good cleanups that we want to have
anyway.

Matthew Wilcox (Oracle) (24):
  block: Remove check of PageError
  afs: Remove check of PageError
  freevxfs: Remove check of PageError
  gfs: Check PageUptodate instead of PageError
  hfs: Remove check for PageError
  hfsplus: Remove check for PageError
  ntfs: Remove check for PageError
  ext2: Remove check for PageError
  nilfs2: Remove check for PageError
  ntfs: Remove check for PageError
  ntfs3: Remove check for PageError
  reiserfs: Remove check for PageError
  ufs: Remove checks for PageError
  remap_range: Remove check of uptodate flag
  jfs: Remove check for PageUptodate
  iomap: Remove test for folio error
  orangefs: Remove test for folio error
  buffer: Remove check for PageError
  nfs: Leave pages in the pagecache if readpage failed
  btrfs: Use a folio in wait_dev_supers()
  buffer: Don't test folio error in block_read_full_folio()
  squashfs: Return the actual error from squashfs_read_folio()
  hostfs: Handle page write errors correctly
  ocfs2: Use filemap_write_and_wait_range() in
    ocfs2_cow_sync_writeback()

 block/partitions/core.c |  4 ----
 fs/afs/mntpt.c          |  6 ------
 fs/btrfs/disk-io.c      | 19 ++++++++-----------
 fs/buffer.c             | 13 ++++++++-----
 fs/ext2/dir.c           |  3 +--
 fs/freevxfs/vxfs_subr.c |  6 ------
 fs/gfs2/lops.c          |  2 +-
 fs/hfs/bnode.c          |  4 ----
 fs/hfsplus/bnode.c      |  4 ----
 fs/hostfs/hostfs_kern.c |  6 +++---
 fs/iomap/buffered-io.c  |  3 ---
 fs/jfs/jfs_metapage.c   |  2 +-
 fs/nfs/read.c           |  4 ----
 fs/nilfs2/dir.c         |  2 +-
 fs/ntfs/aops.h          |  7 +------
 fs/ntfs/file.c          |  5 -----
 fs/ntfs3/ntfs_fs.h      |  7 +------
 fs/ocfs2/refcounttree.c | 42 ++++++-----------------------------------
 fs/orangefs/inode.c     |  4 +---
 fs/reiserfs/xattr.c     |  9 +--------
 fs/remap_range.c        | 11 +----------
 fs/squashfs/file.c      | 15 ++++++++-------
 fs/ufs/dir.c            |  2 +-
 fs/ufs/util.c           | 11 -----------
 24 files changed, 43 insertions(+), 148 deletions(-)

Comments

Christoph Hellwig May 28, 2022, 6:12 a.m. UTC | #1
On Fri, May 27, 2022 at 04:50:12PM +0100, Matthew Wilcox (Oracle) wrote:
> After this series, there are some places which still use it.  Lots of
> the converted places are trivial -- they should have been checking the
> uptodate flag.  The trickiest are the ones which have multiple steps
> and signal "hey, something went wrong with one step in the read of this
> page/folio" by setting the error flag.

How many of those do we have left, and how many of those can't be
changed to just return them through errors or other on-stack means?

> I'm thinking about (ab)using PageChecked == PG_owner_priv_1 for this
> purpose.  It'd be nice to be able to use page->private for this, but
> that's not always available.  I know some filesystems already ascribe
> a meaning to PG_owner_priv_1, but those can be distinguished by whether
> the uptodate flag is set.

I suspect what to do will be very ad-hoc depending on the actual user.
The first priority is probably to isolate PageError so that it is only
used for that kind of communication insid a single file system so that
all the generic uses can go away.