diff options
author | Eric Sandeen <sandeen@redhat.com> | 2016-01-04 00:10:42 -0500 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-01-04 00:10:42 -0500 |
commit | f1f96c4946590616812711ac19eb7a84be160877 (patch) | |
tree | 59ea2d205fb21e5ef7e1813164e52c6c258d2c1e /fs/xfs | |
parent | 233135b763db7c64d07b728a9c66745fb0376275 (diff) |
xfs: get mp from bma->ip in xfs_bmap code
In my earlier commit
c29aad4 xfs: pass mp to XFS_WANT_CORRUPTED_GOTO
I added some local mp variables with code which indicates that
mp might be NULL. Coverity doesn't like this now, because the
updated per-fs XFS_STATS macros dereference mp.
I don't think this is actually a problem; from what I can tell,
we cannot get to these functions with a null bma->tp, so my NULL
check was probably pointless. Still, it's not super obvious.
So switch this code to get mp from the inode on the xfs_bmalloca
structure, with no conditional, because the functions are already
using bmap->ip directly.
Addresses-Coverity-Id: 1339552
Addresses-Coverity-Id: 1339553
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 119c2422aac7..bb3c6590035e 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c | |||
@@ -1725,7 +1725,7 @@ xfs_bmap_add_extent_delay_real( | |||
1725 | int tmp_rval; /* partial logging flags */ | 1725 | int tmp_rval; /* partial logging flags */ |
1726 | struct xfs_mount *mp; | 1726 | struct xfs_mount *mp; |
1727 | 1727 | ||
1728 | mp = bma->tp ? bma->tp->t_mountp : NULL; | 1728 | mp = bma->ip->i_mount; |
1729 | ifp = XFS_IFORK_PTR(bma->ip, XFS_DATA_FORK); | 1729 | ifp = XFS_IFORK_PTR(bma->ip, XFS_DATA_FORK); |
1730 | 1730 | ||
1731 | ASSERT(bma->idx >= 0); | 1731 | ASSERT(bma->idx >= 0); |
@@ -2939,7 +2939,7 @@ xfs_bmap_add_extent_hole_real( | |||
2939 | int state; /* state bits, accessed thru macros */ | 2939 | int state; /* state bits, accessed thru macros */ |
2940 | struct xfs_mount *mp; | 2940 | struct xfs_mount *mp; |
2941 | 2941 | ||
2942 | mp = bma->tp ? bma->tp->t_mountp : NULL; | 2942 | mp = bma->ip->i_mount; |
2943 | ifp = XFS_IFORK_PTR(bma->ip, whichfork); | 2943 | ifp = XFS_IFORK_PTR(bma->ip, whichfork); |
2944 | 2944 | ||
2945 | ASSERT(bma->idx >= 0); | 2945 | ASSERT(bma->idx >= 0); |