]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: refactor log recovery check
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 5 Oct 2018 02:36:11 +0000 (21:36 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 5 Oct 2018 02:36:11 +0000 (21:36 -0500)
Source kernel commit: 0c60d3aa0e2d007e7f79c96c118da25f594afe02

Add a predicate to decide if the log is actively in recovery and use
that instead of open-coding a pagf_init check in the attr leaf verifier.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/libxfs_priv.h
libxfs/xfs_attr_leaf.c

index 969ebd1cdfd7a435208a9bf1c845d62bc76483c6..52aa55e53fcb859bfc8a469d36b001c97d0df38f 100644 (file)
@@ -558,7 +558,9 @@ typedef int (*xfs_rtalloc_query_range_fn)(
 int libxfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb,
                         xfs_off_t count_fsb);
 
+
 bool xfs_log_check_lsn(struct xfs_mount *, xfs_lsn_t);
+#define xfs_log_in_recovery(mp)        (false)
 
 /* xfs_icache.c */
 #define xfs_inode_set_cowblocks_tag(ip)        do { } while (0)
index 3e349ab4937fd2fccf99318ad62c9da6f274d596..3ecd5243f2e9e8d941c27b09e717ac49a46f364f 100644 (file)
@@ -237,7 +237,6 @@ xfs_attr3_leaf_verify(
        struct xfs_attr3_icleaf_hdr     ichdr;
        struct xfs_mount                *mp = bp->b_target->bt_mount;
        struct xfs_attr_leafblock       *leaf = bp->b_addr;
-       struct xfs_perag                *pag = bp->b_pag;
        struct xfs_attr_leaf_entry      *entries;
        uint16_t                        end;
        int                             i;
@@ -265,7 +264,7 @@ xfs_attr3_leaf_verify(
         * because we may have transitioned an empty shortform attr to a leaf
         * if the attr didn't fit in shortform.
         */
-       if (pag && pag->pagf_init && ichdr.count == 0)
+       if (!xfs_log_in_recovery(mp) && ichdr.count == 0)
                return __this_address;
 
        /*