From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: set xefi_discard when creating a deferred agfl free log intent item
Date: Thu, 22 Oct 2020 15:02:47 -0400 [thread overview]
Message-ID: <20201022190247.GA1376790@bfoster> (raw)
In-Reply-To: <20201022184649.GT9832@magnolia>
On Thu, Oct 22, 2020 at 11:46:49AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Make sure that we actually initialize xefi_discard when we're scheduling
> a deferred free of an AGFL block. This was (eventually) found by the
> UBSAN while I was banging on realtime rmap problems, but it exists in
> the upstream codebase. While we're at it, rearrange the structure to
> reduce the struct size from 64 to 56 bytes.
>
> Fixes: fcb762f5de2e ("xfs: add bmapi nodiscard flag")
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/libxfs/xfs_alloc.c | 1 +
> fs/xfs/libxfs/xfs_bmap.h | 2 +-
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index 852b536551b5..15640015be9d 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -2467,6 +2467,7 @@ xfs_defer_agfl_block(
> new->xefi_startblock = XFS_AGB_TO_FSB(mp, agno, agbno);
> new->xefi_blockcount = 1;
> new->xefi_oinfo = *oinfo;
> + new->xefi_skip_discard = false;
>
> trace_xfs_agfl_free_defer(mp, agno, 0, agbno, 1);
>
> diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h
> index e1bd484e5548..6747e97a7949 100644
> --- a/fs/xfs/libxfs/xfs_bmap.h
> +++ b/fs/xfs/libxfs/xfs_bmap.h
> @@ -52,9 +52,9 @@ struct xfs_extent_free_item
> {
> xfs_fsblock_t xefi_startblock;/* starting fs block number */
> xfs_extlen_t xefi_blockcount;/* number of blocks in extent */
> + bool xefi_skip_discard;
> struct list_head xefi_list;
> struct xfs_owner_info xefi_oinfo; /* extent owner */
> - bool xefi_skip_discard;
> };
>
> #define XFS_BMAP_MAX_NMAP 4
>
prev parent reply other threads:[~2020-10-22 19:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-22 18:46 [PATCH] xfs: set xefi_discard when creating a deferred agfl free log intent item Darrick J. Wong
2020-10-22 19:02 ` Brian Foster [this message]
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=20201022190247.GA1376790@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox