]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: also mark the buffer stale on verifier failure in xfs_buf_submit
authorChristoph Hellwig <hch@lst.de>
Thu, 25 Jun 2026 13:58:32 +0000 (15:58 +0200)
committerCarlos Maiolino <cem@kernel.org>
Wed, 1 Jul 2026 09:25:36 +0000 (11:25 +0200)
We should treat the buffer that caused a shutdown the same as handling
buffers after a shutdown, so use the same stale && !DONE logic here.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_buf.c

index a108d31996f2715606514e436189ef180ea56c0c..0061abffcbb5ca690abbe56836e90c1c599aebfb 100644 (file)
@@ -1383,8 +1383,10 @@ xfs_buf_submit(
         * state here rather than mount state to avoid corrupting the log tail
         * on shutdown.
         */
-       if (bp->b_mount->m_log && xlog_is_shutdown(bp->b_mount->m_log))
+       if (bp->b_mount->m_log && xlog_is_shutdown(bp->b_mount->m_log)) {
+               xfs_buf_ioerror(bp, -EIO);
                goto ioerror;
+       }
 
        if (bp->b_flags & XBF_WRITE)
                xfs_buf_wait_unpin(bp);
@@ -1396,8 +1398,9 @@ xfs_buf_submit(
        bp->b_error = 0;
 
        if ((bp->b_flags & XBF_WRITE) && !xfs_buf_verify_write(bp)) {
+               /* ->verify_write should have set b_error already */
                xfs_force_shutdown(bp->b_mount, SHUTDOWN_CORRUPT_INCORE);
-               goto end_io;
+               goto ioerror;
        }
 
        /* In-memory targets are directly mapped, no I/O required. */
@@ -1410,7 +1413,6 @@ xfs_buf_submit(
 ioerror:
        bp->b_flags &= ~XBF_DONE;
        xfs_buf_stale(bp);
-       xfs_buf_ioerror(bp, -EIO);
 end_io:
        xfs_buf_ioend(bp);
 }