xfs: set firstfsb to NULLFSBLOCK before feeding it to _bmapi_write
commitc32b1ec8a266476494f04843434538cdb25d9190
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 17 Sep 2017 21:06:37 +0000 (17 14:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Sep 2017 06:19:58 +0000 (20 08:19 +0200)
treec22f5e813f7d35fbf2234d0f3b76b25a7de6d4bf
parenta6247b0189fab0edbe065ab42e76eddb2a03a631
xfs: set firstfsb to NULLFSBLOCK before feeding it to _bmapi_write

commit 4c1a67bd3606540b9b42caff34a1d5cd94b1cf65 upstream.

We must initialize the firstfsb parameter to _bmapi_write so that it
doesn't incorrectly treat stack garbage as a restriction on which AGs
it can search for free space.

Fixes-coverity-id: 1402025
Fixes-coverity-id: 1415167
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/xfs_reflink.c