]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: always assign buffer verifiers when one is provided
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 18 Oct 2018 06:20:30 +0000 (17:20 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 18 Oct 2018 06:20:30 +0000 (17:20 +1100)
commita1bbd069a8e053f0c401361a0b514d6a44f252a3
tree5362c0bf508f2ca94c3b6ca00f953ed8c16b98e8
parent4483f3c65ce387bc4e24fac0eb06d3c4719bd9cf
xfs: always assign buffer verifiers when one is provided

If a caller supplies buffer ops when trying to read a buffer and the
buffer doesn't already have buf ops assigned, ensure that the ops are
assigned to the buffer and the verifier is run on that buffer.

Note that current XFS code is careful to assign buffer ops after a
xfs_{trans_,}buf_read call in which ops were not supplied.  However, we
should apply ops defensively in case there is ever a coding mistake; and
an upcoming repair patch will need to be able to read a buffer without
assigning buf ops.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_buf.c
fs/xfs/xfs_buf.h
fs/xfs/xfs_trans_buf.c