This is a note to let you know that I've just added the patch titled xfs: restore shutdown check in mapped write fault path to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: xfs-restore-shutdown-check-in-mapped-write-fault-path.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Mon Jun 6 07:00:47 PM CEST 2022 From: Amir Goldstein <amir73il@xxxxxxxxx> Date: Mon, 6 Jun 2022 17:32:52 +0300 Subject: xfs: restore shutdown check in mapped write fault path To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: Sasha Levin <sashal@xxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, "Darrick J . Wong" <djwong@xxxxxxxxxx>, Christoph Hellwig <hch@xxxxxx>, Brian Foster <bfoster@xxxxxxxxxx>, Christian Brauner <brauner@xxxxxxxxxx>, Luis Chamberlain <mcgrof@xxxxxxxxxx>, Leah Rumancik <leah.rumancik@xxxxxxxxx>, Adam Manzanares <a.manzanares@xxxxxxxxxxx>, linux-xfs@xxxxxxxxxxxxxxx, stable@xxxxxxxxxxxxxxx, Eric Sandeen <sandeen@xxxxxxxxxx> Message-ID: <20220606143255.685988-6-amir73il@xxxxxxxxx> From: Brian Foster <bfoster@xxxxxxxxxx> commit e4826691cc7e5458bcb659935d0092bcf3f08c20 upstream. XFS triggers an iomap warning in the write fault path due to a !PageUptodate() page if a write fault happens to occur on a page that recently failed writeback. The iomap writeback error handling code can clear the Uptodate flag if no portion of the page is submitted for I/O. This is reproduced by fstest generic/019, which combines various forms of I/O with simulated disk failures that inevitably lead to filesystem shutdown (which then unconditionally fails page writeback). This is a regression introduced by commit f150b4234397 ("xfs: split the iomap ops for buffered vs direct writes") due to the removal of a shutdown check and explicit error return in the ->iomap_begin() path used by the write fault path. The explicit error return historically translated to a SIGBUS, but now carries on with iomap processing where it complains about the unexpected state. Restore the shutdown check to xfs_buffered_write_iomap_begin() to restore historical behavior. Fixes: f150b4234397 ("xfs: split the iomap ops for buffered vs direct writes") Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx> Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx> Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx> Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/xfs/xfs_iomap.c | 3 +++ 1 file changed, 3 insertions(+) --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -870,6 +870,9 @@ xfs_buffered_write_iomap_begin( int allocfork = XFS_DATA_FORK; int error = 0; + if (XFS_FORCED_SHUTDOWN(mp)) + return -EIO; + /* we can't use delayed allocations when using extent size hints */ if (xfs_get_extsz_hint(ip)) return xfs_direct_write_iomap_begin(inode, offset, count, Patches currently in stable-queue which might be from amir73il@xxxxxxxxx are queue-5.10/xfs-restore-shutdown-check-in-mapped-write-fault-path.patch queue-5.10/xfs-sync-lazy-sb-accounting-on-quiesce-of-read-only-mounts.patch queue-5.10/xfs-fix-incorrect-root-dquot-corruption-error-when-switching-group-project-quota-types.patch queue-5.10/xfs-force-log-and-push-ail-to-clear-pinned-inodes-when-aborting-mount.patch queue-5.10/fsnotify-fix-wrong-lockdep-annotations.patch queue-5.10/inotify-show-inotify-mask-flags-in-proc-fdinfo.patch queue-5.10/xfs-consider-shutdown-in-bmapbt-cursor-delete-assert.patch queue-5.10/xfs-set-inode-size-after-creating-symlink.patch queue-5.10/xfs-fix-chown-leaking-delalloc-quota-blocks-when-fssetxattr-fails.patch queue-5.10/xfs-assert-in-xfs_btree_del_cursor-should-take-into-account-error.patch