]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: set xefi_discard when creating a deferred agfl free log intent item libxfs-5.10-sync-part2_2020-11-16
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 23 Oct 2020 00:03:18 +0000 (17:03 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 16 Nov 2020 17:30:04 +0000 (09:30 -0800)
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.

Fixes: fcb762f5de2e ("xfs: add bmapi nodiscard flag")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
libxfs/xfs_alloc.c
libxfs/xfs_bmap.h

index 93043d5927a37a325ea63988c91ad18bf6e9144a..92f61fae4a7083e8b670d048e657108403bc0a0b 100644 (file)
@@ -2463,6 +2463,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);
 
index e1bd484e55485411830ec5927f241c509b8ec0ab..6747e97a7949014b789981b5ef4a93648183c50c 100644 (file)
@@ -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