All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@sandeen.net, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Dave Chinner <dchinner@redhat.com>
Subject: [PATCH 14/14] xfs: remove unnecessary null pointer checks from _read_agf callers
Date: Mon, 24 Feb 2020 16:15:40 -0800	[thread overview]
Message-ID: <158258974094.453666.13391513694204695960.stgit@magnolia> (raw)
In-Reply-To: <158258964941.453666.10913737544282124969.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

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 <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libxfs/xfs_refcount.c |    6 ------
 1 file changed, 6 deletions(-)


diff --git a/libxfs/xfs_refcount.c b/libxfs/xfs_refcount.c
index 71d29486..b8a45b15 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. */


  parent reply	other threads:[~2020-02-25  0:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25  0:14 [PATCH v2 00/14] xfsprogs: make buffer functions return error codes Darrick J. Wong
2020-02-25  0:14 ` [PATCH 01/14] libxfs: make __cache_lookup return an error code Darrick J. Wong
2020-02-25  0:14 ` [PATCH 02/14] libxfs: make libxfs_getbuf_flags " Darrick J. Wong
2020-02-25  0:14 ` [PATCH 03/14] libxfs: make libxfs_buf_get_map " Darrick J. Wong
2020-02-25  0:14 ` [PATCH 04/14] libxfs: refactor libxfs_readbuf out of existence Darrick J. Wong
2020-02-25  0:14 ` [PATCH 05/14] libxfs: make libxfs_buf_read_map return an error code Darrick J. Wong
2020-02-25 17:55   ` Christoph Hellwig
2020-02-25 18:59     ` Darrick J. Wong
2020-02-25  0:14 ` [PATCH 06/14] xfs: make xfs_buf_read_map " Darrick J. Wong
2020-02-25  0:14 ` [PATCH 07/14] xfs: make xfs_buf_get " Darrick J. Wong
2020-02-25  0:15 ` [PATCH 08/14] xfs: make xfs_buf_get_uncached " Darrick J. Wong
2020-02-25  0:15 ` [PATCH 09/14] xfs: make xfs_buf_read " Darrick J. Wong
2020-02-25  0:15 ` [PATCH 10/14] xfs: make xfs_trans_get_buf_map " Darrick J. Wong
2020-02-25  0:15 ` [PATCH 11/14] xfs: make xfs_trans_get_buf " Darrick J. Wong
2020-02-25  0:15 ` [PATCH 12/14] xfs: remove the xfs_btree_get_buf[ls] functions Darrick J. Wong
2020-02-25  0:15 ` [PATCH 13/14] xfs: make xfs_*read_agf return EAGAIN to ALLOC_FLAG_TRYLOCK callers Darrick J. Wong
2020-02-25  0:15 ` Darrick J. Wong [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-02-20  1:44 [PATCH 00/14] xfsprogs: make buffer functions return error codes Darrick J. Wong
2020-02-20  1:45 ` [PATCH 14/14] xfs: remove unnecessary null pointer checks from _read_agf callers Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=158258974094.453666.13391513694204695960.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=dchinner@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.