From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
linux-xfs@vger.kernel.org, bfoster@redhat.com
Subject: Re: [PATCH 3/4] xfs: xfs_defer_capture should absorb remaining block reservation
Date: Mon, 28 Sep 2020 15:28:42 +1000 [thread overview]
Message-ID: <20200928052842.GE14422@dread.disaster.area> (raw)
In-Reply-To: <160125008731.174438.2552492068404088327.stgit@magnolia>
On Sun, Sep 27, 2020 at 04:41:27PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> When xfs_defer_capture extracts the deferred ops and transaction state
> from a transaction, it should absorb the remaining block reservation so
> that when we continue the dfops chain, we still have those blocks to
> use.
>
> This adds the requirement that every log intent item recovery function
> must be careful to reserve enough blocks to handle both itself and all
> defer ops that it can queue. On the other hand, this enables us to do
> away with the handwaving block estimation nonsense that was going on in
> xlog_finish_defer_ops.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---
> fs/xfs/libxfs/xfs_defer.c | 4 ++++
> fs/xfs/libxfs/xfs_defer.h | 1 +
> fs/xfs/xfs_log_recover.c | 18 +-----------------
> 3 files changed, 6 insertions(+), 17 deletions(-)
>
>
> diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
> index 0de7672fe63d..85d70f1edc1c 100644
> --- a/fs/xfs/libxfs/xfs_defer.c
> +++ b/fs/xfs/libxfs/xfs_defer.c
> @@ -574,6 +574,8 @@ xfs_defer_capture(
> list_splice_init(&tp->t_dfops, &dfc->dfc_dfops);
> dfc->dfc_tpflags = tp->t_flags & XFS_TRANS_LOWMODE;
> tp->t_flags &= ~XFS_TRANS_LOWMODE;
> + dfc->dfc_blkres = tp->t_blk_res - tp->t_blk_res_used;
> + tp->t_blk_res = tp->t_blk_res_used;
>
> return dfc;
> }
I think this needs an explanation in the function/API comment to
explain why it is being done.
Otherwise looks good.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2020-09-28 5:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-27 23:41 [PATCH v3 0/4] xfs: fix how we deal with new intents during recovery Darrick J. Wong
2020-09-27 23:41 ` [PATCH 1/4] xfs: remove xfs_defer_reset Darrick J. Wong
2020-09-28 4:42 ` Dave Chinner
2020-09-28 6:20 ` Christoph Hellwig
2020-09-28 16:43 ` Darrick J. Wong
2020-09-27 23:41 ` [PATCH 2/4] xfs: proper replay of deferred ops queued during log recovery Darrick J. Wong
2020-09-28 5:26 ` Dave Chinner
2020-09-28 6:37 ` Christoph Hellwig
2020-09-28 17:53 ` Darrick J. Wong
2020-09-28 17:47 ` Darrick J. Wong
2020-09-27 23:41 ` [PATCH 3/4] xfs: xfs_defer_capture should absorb remaining block reservation Darrick J. Wong
2020-09-28 5:28 ` Dave Chinner [this message]
2020-09-27 23:41 ` [PATCH 4/4] xfs: xfs_defer_capture should absorb remaining transaction reservation Darrick J. Wong
2020-09-28 5:52 ` Dave Chinner
2020-09-28 17:15 ` 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=20200928052842.GE14422@dread.disaster.area \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=hch@lst.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox