From: Darrick J. Wong Date: Sat, 14 Mar 2020 03:04:09 +0000 (-0400) Subject: xfs: remove unnecessary null pointer checks from _read_agf callers X-Git-Tag: v5.6.0-rc0~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=74b654b465d6c1e1181d36c3485e5ff1756985a1;p=users%2Fhch%2Fxfsprogs.git xfs: remove unnecessary null pointer checks from _read_agf callers Source kernel commit: 706b8c5bc70391be510a5454f307db90b622b279 Drop the null buffer pointer checks in all code that calls xfs_alloc_read_agf and doesn't pass XFS_ALLOC_FLAG_TRYLOCK because they're no longer necessary. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_refcount.c b/libxfs/xfs_refcount.c index 71d294865..b8a45b159 100644 --- a/libxfs/xfs_refcount.c +++ b/libxfs/xfs_refcount.c @@ -1176,8 +1176,6 @@ xfs_refcount_finish_one( XFS_ALLOC_FLAG_FREEING, &agbp); if (error) return error; - if (XFS_IS_CORRUPT(tp->t_mountp, !agbp)) - return -EFSCORRUPTED; rcur = xfs_refcountbt_init_cursor(mp, tp, agbp, agno); if (!rcur) { @@ -1717,10 +1715,6 @@ xfs_refcount_recover_cow_leftovers( error = xfs_alloc_read_agf(mp, tp, agno, 0, &agbp); if (error) goto out_trans; - if (!agbp) { - error = -ENOMEM; - goto out_trans; - } cur = xfs_refcountbt_init_cursor(mp, tp, agbp, agno); /* Find all the leftover CoW staging extents. */