From: Darrick J. Wong Date: Fri, 5 Oct 2018 02:36:11 +0000 (-0500) Subject: xfs: refactor log recovery check X-Git-Tag: v4.19.0-rc0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d780a2f24755f2ce0527a9e1a76a077f6abbe52c;p=thirdparty%2Fxfsprogs-dev.git xfs: refactor log recovery check 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 Reviewed-by: Brian Foster Reviewed-by: Carlos Maiolino Signed-off-by: Eric Sandeen --- diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 969ebd1cd..52aa55e53 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -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) diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c index 3e349ab49..3ecd5243f 100644 --- a/libxfs/xfs_attr_leaf.c +++ b/libxfs/xfs_attr_leaf.c @@ -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; /*