Skip to content

xfs, iomap: fix writeback failure handling

Dave Chinner linux-fsdevel linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3xfs: report block map corruption errors to the health tracking systemfs/xfs/libxfs/xfs_bmap.c fs/xfs/libxfs/xfs_health.h fs/xfs/xfs_health.c +2 more+73 -102 replies
2/3xfs: failed delalloc conversion results in bad extent listsfs/xfs/libxfs/xfs_bmap.c fs/xfs/xfs_icache.c fs/xfs/xfs_inode.c+23 -42 replies
3/3xfs, iomap: ->discard_folio() is broken so remove itfs/iomap/buffered-io.c fs/xfs/xfs_aops.c include/linux/iomap.h+3 -546 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchChristoph Hellwig
1/3
2/3
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] xfs, iomap: fix writeback failure handling

Hi folks,

We just had a report of a WARN in the XFS writeback code where delayed allocation was not finding a delayed allocation extent in the extent tree here:

https://bugzilla.kernel.org/show_bug.cgi?id=217030

Turns out that this is a regression that resulted from removing the dirty page invalidation on writeback error behaviour that XFS had for many, many years. Essentially, if we are not invalidating the dirty cached data on error, we should not be invalidating the delalloc extent that backs the dirty data. Bad things happen when we do that.....

This series of patches first adds Darrick's code to mark inodes as unhealthy when bad extent maps or corruption during allocation is detected.

The second patch expands on this sickness detection to cover delalloc conversion failures due to corruption detected during allocation. It then uses this sickness to trigger removal of the unconvertable delalloc extents after the VFS has discarded the cached data during inode reclaim, rather than throwing warnings and assert failures due to stray unconverted delalloc extents. Those will still happen if the inode is healthy, hence the need for ensuring we mark inodes sick correctly.

The last patch then removes xfs_discard_folio() as all it does is punch the delalloc extent incorrectly. Given that there are now no other users of ->discard_folio(), that gets removed too.

This has run for a couple of hours with the original reproducer code, whereas without these patches a current 6.2-rc7 kernel fails in seconds. No fstests regressions have been seen either, with both 1kB and 4kB block size auto group tests runs now completed.

-Dave.