diff options
author | Christoph Hellwig <hch@lst.de> | 2019-09-03 08:13:13 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-09-03 08:13:13 -0700 |
commit | eb77b23b565e7e1d2cc3a7d9e4cc186fb54e81a8 (patch) | |
tree | 68d315c1ce1e57593275eeb6b19871a4aaf7a32a /fs/xfs/libxfs/xfs_bmap.c | |
parent | 1baa2800e62d7d58c04cb871a6e4189fc3e1ccf1 (diff) | |
download | linux-eb77b23b565e7e1d2cc3a7d9e4cc186fb54e81a8.tar.gz linux-eb77b23b565e7e1d2cc3a7d9e4cc186fb54e81a8.tar.bz2 linux-eb77b23b565e7e1d2cc3a7d9e4cc186fb54e81a8.zip |
xfs: add a xfs_valid_startblock helper
Add a helper that validates the startblock is valid. This checks for a
non-zero block on the main device, but skips that check for blocks on
the realtime device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 6d97794c97c0..054b4ce30033 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -4515,7 +4515,7 @@ xfs_bmapi_convert_delalloc( if (WARN_ON_ONCE(bma.blkno == NULLFSBLOCK)) goto out_finish; error = -EFSCORRUPTED; - if (WARN_ON_ONCE(!bma.got.br_startblock && !XFS_IS_REALTIME_INODE(ip))) + if (WARN_ON_ONCE(!xfs_valid_startblock(ip, bma.got.br_startblock))) goto out_finish; XFS_STATS_ADD(mp, xs_xstrat_bytes, XFS_FSB_TO_B(mp, bma.length)); |