]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: Move AGI buffer type setting to xfs_read_agi
authorEric Sandeen <sandeen@sandeen.net>
Tue, 10 Jan 2017 02:18:48 +0000 (20:18 -0600)
committerEric Sandeen <sandeen@redhat.com>
Tue, 10 Jan 2017 02:18:48 +0000 (20:18 -0600)
Source kernel commit: 200237d6746faaeaf7f4ff4abbf13f3917cee60a

We've missed properly setting the buffer type for
an AGI transaction in 3 spots now, so just move it
into xfs_read_agi() and set it if we are in a transaction
to avoid the problem in the future.

This is similar to how it is done in i.e. the dir3
and attr3 read functions.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_ialloc.c

index efb37d39658b59d3d595dea16952980fcb1d5edc..31ab2a7dc8a87a2a4b038004b8bb658ac01bb289 100644 (file)
@@ -2445,8 +2445,6 @@ xfs_ialloc_log_agi(
        ASSERT(agi->agi_magicnum == cpu_to_be32(XFS_AGI_MAGIC));
 #endif
 
-       xfs_trans_buf_set_type(tp, bp, XFS_BLFT_AGI_BUF);
-
        /*
         * Compute byte offsets for the first and last fields in the first
         * region and log the agi buffer. This only logs up through
@@ -2587,6 +2585,8 @@ xfs_read_agi(
                        XFS_FSS_TO_BB(mp, 1), 0, bpp, &xfs_agi_buf_ops);
        if (error)
                return error;
+       if (tp)
+               xfs_trans_buf_set_type(tp, *bpp, XFS_BLFT_AGI_BUF);
 
        xfs_buf_set_ref(*bpp, XFS_AGI_REF);
        return 0;