summaryrefslogtreecommitdiff
path: root/fs/9p
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-11-12 22:09:46 +1100
committerBen Myers <bpm@sgi.com>2012-11-13 14:45:57 -0600
commit37eb17e604ac7398bbb133c82f281475d704fff7 (patch)
treeb84865d92d52d5ea18481aa5a1cb8fb0e66979ec /fs/9p
parent7bf7f352194252e6f05981d44fb8cb55668606cd (diff)
xfs: drop buffer io reference when a bad bio is built
Error handling in xfs_buf_ioapply_map() does not handle IO reference counts correctly. We increment the b_io_remaining count before building the bio, but then fail to decrement it in the failure case. This leads to the buffer never running IO completion and releasing the reference that the IO holds, so at unmount we can leak the buffer. This leak is captured by this assert failure during unmount: XFS: Assertion failed: atomic_read(&pag->pag_ref) == 0, file: fs/xfs/xfs_mount.c, line: 273 This is not a new bug - the b_io_remaining accounting has had this problem for a long, long time - it's just very hard to get a zero length bio being built by this code... Further, the buffer IO error can be overwritten on a multi-segment buffer by subsequent bio completions for partial sections of the buffer. Hence we should only set the buffer error status if the buffer is not already carrying an error status. This ensures that a partial IO error on a multi-segment buffer will not be lost. This part of the problem is a regression, however. cc: <stable@vger.kernel.org> Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/9p')
0 files changed, 0 insertions, 0 deletions