diff options
| author | Christoph Hellwig <hch@lst.de> | 2026-06-25 15:58:32 +0200 |
|---|---|---|
| committer | Carlos Maiolino <cem@kernel.org> | 2026-07-01 11:25:36 +0200 |
| commit | 0b434b552ecd19f33e2f85ea8e55dbb65352810d (patch) | |
| tree | bcb3aeb6496798caa792ecf5ebf777926926cb76 | |
| parent | 6769087fd856889a32caf09590703813e3763575 (diff) | |
xfs: also mark the buffer stale on verifier failure in xfs_buf_submit
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>
| -rw-r--r-- | fs/xfs/xfs_buf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index a108d31996f2..0061abffcbb5 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -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); } |
