From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/8] xfs: clean up xfs_btree_del_cursor callers
Date: Thu, 19 Jul 2018 08:24:48 -0400 [thread overview]
Message-ID: <20180719122448.GF25672@bfoster> (raw)
In-Reply-To: <153192905779.31685.9007503975897283723.stgit@magnolia>
On Wed, Jul 18, 2018 at 08:50:57AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Less trivial cleanups of the error argument to xfs_btree_del_cursor;
> these require some minor code refactoring.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/libxfs/xfs_refcount.c | 11 +++--------
> fs/xfs/scrub/repair.c | 7 +++----
> 2 files changed, 6 insertions(+), 12 deletions(-)
>
>
> diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
> index 240a32984d13..a38e5840a73f 100644
> --- a/fs/xfs/libxfs/xfs_refcount.c
> +++ b/fs/xfs/libxfs/xfs_refcount.c
> @@ -1675,11 +1675,11 @@ xfs_refcount_recover_cow_leftovers(
> high.rc.rc_startblock = -1U;
> error = xfs_btree_query_range(cur, &low, &high,
> xfs_refcount_recover_extent, &debris);
> - if (error)
> - goto out_cursor;
> - xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
> + xfs_btree_del_cursor(cur, error);
> xfs_trans_brelse(tp, agbp);
> xfs_trans_cancel(tp);
> + if (error)
> + goto out_free;
>
> /* Now iterate the list to free the leftovers */
> list_for_each_entry_safe(rr, n, &debris, rr_list) {
> @@ -1727,11 +1727,6 @@ xfs_refcount_recover_cow_leftovers(
> kmem_free(rr);
> }
> return error;
> -
> -out_cursor:
> - xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
> - xfs_trans_brelse(tp, agbp);
> - goto out_trans;
> }
>
> /* Is there a record covering a given extent? */
> diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
> index 35c589a04fac..ea39e2bdc96a 100644
> --- a/fs/xfs/scrub/repair.c
> +++ b/fs/xfs/scrub/repair.c
> @@ -747,9 +747,9 @@ xfs_repair_dispose_btree_block(
>
> /* Can we find any other rmappings? */
> error = xfs_rmap_has_other_keys(cur, agbno, 1, oinfo, &has_other_rmap);
> + xfs_btree_del_cursor(cur, error);
> if (error)
> - goto out_cur;
> - xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
> + goto out_free;
>
> /*
> * If there are other rmappings, this block is cross linked and must
> @@ -779,8 +779,7 @@ xfs_repair_dispose_btree_block(
> return xfs_trans_roll_inode(&sc->tp, sc->ip);
> return xfs_repair_roll_ag_trans(sc);
>
> -out_cur:
> - xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
> +out_free:
> if (agf_bp != sc->sa.agf_bp)
> xfs_trans_brelse(sc->tp, agf_bp);
> return error;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-07-19 13:07 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-18 15:50 [PATCH 0/8] xfs-4.19: fixes & cleanups Darrick J. Wong
2018-07-18 15:50 ` [PATCH 1/8] xfs: check leaf attribute block freemap in verifier Darrick J. Wong
2018-07-19 12:19 ` Carlos Maiolino
2018-07-19 12:24 ` Brian Foster
2018-07-19 15:20 ` Darrick J. Wong
2018-07-19 15:25 ` [PATCH v2 " Darrick J. Wong
2018-07-19 15:30 ` Brian Foster
2018-07-19 15:46 ` Carlos Maiolino
2018-07-19 16:40 ` Christoph Hellwig
2018-07-18 15:50 ` [PATCH 2/8] xfs: return from _defer_finish with a clean transaction Darrick J. Wong
2018-07-19 12:24 ` Brian Foster
2018-07-19 16:41 ` Christoph Hellwig
2018-07-18 15:50 ` [PATCH 3/8] xfs: trivial xfs_btree_del_cursor cleanups Darrick J. Wong
2018-07-19 12:24 ` Brian Foster
2018-07-19 12:25 ` Carlos Maiolino
2018-07-19 16:43 ` Christoph Hellwig
2018-07-19 19:22 ` Darrick J. Wong
2018-07-20 16:04 ` Christoph Hellwig
2018-07-18 15:50 ` [PATCH 4/8] xfs: clean up xfs_btree_del_cursor callers Darrick J. Wong
2018-07-19 12:24 ` Brian Foster [this message]
2018-07-19 12:28 ` Carlos Maiolino
2018-07-19 16:46 ` Christoph Hellwig
2018-07-18 15:51 ` [PATCH 5/8] xfs: shorten xfs_scrub_ prefix Darrick J. Wong
2018-07-19 12:59 ` Brian Foster
2018-07-18 15:51 ` [PATCH 6/8] xfs: shorten xfs_repair_ prefix to xrep_ Darrick J. Wong
2018-07-19 12:59 ` Brian Foster
2018-07-18 15:52 ` [PATCH 7/8] xfs: shorten struct xfs_scrub_context to struct xfs_scrub Darrick J. Wong
2018-07-19 12:59 ` Brian Foster
2018-07-18 15:52 ` [PATCH 8/8] xfs: fix indentation and other whitespace problems in scrub/repair Darrick J. Wong
2018-07-19 12:59 ` Brian Foster
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=20180719122448.GF25672@bfoster \
--to=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
/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.