Skip to content

Commit 465fa17

Browse files
Brian Fosterdjwong
authored andcommitted
xfs: end sync buffer I/O properly on shutdown error
As of commit e339dd8 ("xfs: use sync buffer I/O for sync delwri queue submission"), the delwri submission code uses sync buffer I/O for sync delwri I/O. Instead of waiting on async I/O to unlock the buffer, it uses the underlying sync I/O completion mechanism. If delwri buffer submission fails due to a shutdown scenario, an error is set on the buffer and buffer completion never occurs. This can cause xfs_buf_delwri_submit() to deadlock waiting on a completion event. We could check the error state before waiting on such buffers, but that doesn't serialize against the case of an error set via a racing I/O completion. Instead, invoke I/O completion in the shutdown case regardless of buffer I/O type. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
1 parent aa6ee4a commit 465fa17

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/xfs/xfs_buf.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,8 +1536,7 @@ __xfs_buf_submit(
15361536
xfs_buf_ioerror(bp, -EIO);
15371537
bp->b_flags &= ~XBF_DONE;
15381538
xfs_buf_stale(bp);
1539-
if (bp->b_flags & XBF_ASYNC)
1540-
xfs_buf_ioend(bp);
1539+
xfs_buf_ioend(bp);
15411540
return -EIO;
15421541
}
15431542

0 commit comments

Comments
 (0)