aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-05-06 18:00:29 -0400
committerEric Sandeen <sandeen@redhat.com>2019-05-06 18:00:29 -0400
commit93ad4d9c02b56146ae2bfedad9dd440d1bc3b79e (patch)
treeaaf2b625aabae35c81a22f4dc4a64011fa7fcff7
parent82ed51db75e52697e80b5bb0150119d398520fe8 (diff)
downloadxfsprogs-dev-libxfs-5.1-sync.tar.gz
xfs: always init bma in xfs_bmapi_writelibxfs-5.1-sync
Source kernel commit: 4b0bce30f39b7733420bb8b28e340aa91c219bc1 Always init the tp/ip fields of bma in xfs_bmapi_write so that the bmapi_finish at the bottom never trips over null transaction or inode pointers. Coverity-id: 1443964 Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--libxfs/xfs_bmap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c
index 9b38d5df85..cd570fba89 100644
--- a/libxfs/xfs_bmap.c
+++ b/libxfs/xfs_bmap.c
@@ -4243,9 +4243,13 @@ xfs_bmapi_write(
struct xfs_bmbt_irec *mval, /* output: map values */
int *nmap) /* i/o: mval size/count */
{
+ struct xfs_bmalloca bma = {
+ .tp = tp,
+ .ip = ip,
+ .total = total,
+ };
struct xfs_mount *mp = ip->i_mount;
struct xfs_ifork *ifp;
- struct xfs_bmalloca bma = { NULL }; /* args for xfs_bmap_alloc */
xfs_fileoff_t end; /* end of mapped file region */
bool eof = false; /* after the end of extents */
int error; /* error return */
@@ -4313,10 +4317,6 @@ xfs_bmapi_write(
eof = true;
if (!xfs_iext_peek_prev_extent(ifp, &bma.icur, &bma.prev))
bma.prev.br_startoff = NULLFILEOFF;
- bma.tp = tp;
- bma.ip = ip;
- bma.total = total;
- bma.datatype = 0;
bma.minleft = xfs_bmapi_minleft(tp, ip, whichfork);
n = 0;