aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/buffer_head.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2017-07-07 18:55:17 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2017-07-07 18:55:17 -0700
commitcd87d867920155911d0d2e6485b769d853547750 (patch)
tree8f9a2c8e14204eeb8823ff67a94e3386e4313120 /include/linux/buffer_head.h
parentxfs: rename MAXPATHLEN to XFS_SYMLINK_MAXLEN (diff)
downloadlinux-dev-cd87d867920155911d0d2e6485b769d853547750.tar.xz
linux-dev-cd87d867920155911d0d2e6485b769d853547750.zip
xfs: don't crash on unexpected holes in dir/attr btrees
In quite a few places we call xfs_da_read_buf with a mappedbno that we don't control, then assume that the function passes back either an error code or a buffer pointer. Unfortunately, if mappedbno == -2 and bno maps to a hole, we get a return code of zero and a NULL buffer, which means that we crash if we actually try to use that buffer pointer. This happens immediately when we set the buffer type for transaction context. Therefore, check that we have no error code and a non-NULL bp before trying to use bp. This patch is a follow-up to an incomplete fix in 96a3aefb8ffde231 ("xfs: don't crash if reading a directory results in an unexpected hole"). Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'include/linux/buffer_head.h')
0 files changed, 0 insertions, 0 deletions