Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9892d3c authored by Dave Chinner's avatar Dave Chinner Committed by Dave Chinner
Browse files

xfs: only trace buffer items if they exist



The commit 2d3d0c53 ("xfs: lobotomise xfs_trans_read_buf_map()") left
a landmine in the tracing code: trace_xfs_trans_buf_read() is now
call on all buffers that are read through this interface rather than
just buffers in transactions. For buffers outside transaction
context, bp->b_fspriv is null, and so the buf log item tracing
functions cannot be called. This causes a NULL pointer dereference
in the trace_xfs_trans_buf_read() function when tracing is turned
on.

cc: <stable@vger.kernel.org>
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 01f9882e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -327,9 +327,10 @@ xfs_trans_read_buf_map(
		return -EIO;
	}

	if (tp)
	if (tp) {
		_xfs_trans_bjoin(tp, bp, 1);
		trace_xfs_trans_read_buf(bp->b_fspriv);
	}
	*bpp = bp;
	return 0;