]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-analog-linux-kernel/dmurphy-analog.git/commit
xfs: set buffer ops when repair probes for btree type
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 3 Feb 2019 22:03:59 +0000 (14:03 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Sun, 3 Feb 2019 22:03:59 +0000 (14:03 -0800)
commitadd46b3b021263c02d5a7080c58e5b459479fafd
treeae5e6d00b63a34057f1014f7968e942cbfd4c42a
parent465fa17f4a303d9fdff9eac4d45f91ece92e96ca
xfs: set buffer ops when repair probes for btree type

In xrep_findroot_block, we work out the btree type and correctness of a
given block by calling different btree verifiers on root block
candidates.  However, we leave the NULL b_ops while ->verify_read
validates the block, which means that if the verifier calls
xfs_buf_verifier_error it'll crash on the null b_ops.  Fix it to set
b_ops before calling the verifier and unsetting it if the verifier
fails.

Furthermore, improve the documentation around xfs_buf_ensure_ops, which
is the function that is responsible for cleaning up the b_ops state of
buffers that go through xrep_findroot_block but don't match anything.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
fs/xfs/scrub/repair.c
fs/xfs/xfs_buf.c