mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-16 07:24:39 +08:00
xfs: null out bma->prev if no previous extent
Coverity complains that we don't check the return value of xfs_iext_peek_prev_extent like we do nearly all of the time. If there is no previous extent then just null out bma->prev like we do elsewhere in the bmap code. Coverity-id: 1424057 Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
5f213ddbcb
commit
f5be08446e
@ -4014,7 +4014,8 @@ xfs_bmapi_allocate(
|
||||
if (bma->wasdel) {
|
||||
bma->length = (xfs_extlen_t)bma->got.br_blockcount;
|
||||
bma->offset = bma->got.br_startoff;
|
||||
xfs_iext_peek_prev_extent(ifp, &bma->icur, &bma->prev);
|
||||
if (!xfs_iext_peek_prev_extent(ifp, &bma->icur, &bma->prev))
|
||||
bma->prev.br_startoff = NULLFILEOFF;
|
||||
} else {
|
||||
bma->length = XFS_FILBLKS_MIN(bma->length, MAXEXTLEN);
|
||||
if (!bma->eof)
|
||||
|
Loading…
Reference in New Issue
Block a user