summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_attr_leaf.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2016-12-09 16:56:26 +1100
committerDave Chinner <david@fromorbit.com>2016-12-09 16:56:26 +1100
commit9807b773dad4555665931d57065d7f8adab58e0f (patch)
tree1475442200af6def0e03a792311dff151ef9f331 /fs/xfs/libxfs/xfs_attr_leaf.c
parenta444d72e609062a040ed95a50e8fccfa1d58281b (diff)
parent9875258ca7ab238a08bb9ad17e0c9b9984eac7df (diff)
downloadlinux-9807b773dad4555665931d57065d7f8adab58e0f.tar.gz
linux-9807b773dad4555665931d57065d7f8adab58e0f.tar.bz2
linux-9807b773dad4555665931d57065d7f8adab58e0f.zip
Merge branch 'xfs-4.10-misc-fixes-4' into for-next
Diffstat (limited to 'fs/xfs/libxfs/xfs_attr_leaf.c')
-rw-r--r--fs/xfs/libxfs/xfs_attr_leaf.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
index 8ea91f363093..2852521fc8ec 100644
--- a/fs/xfs/libxfs/xfs_attr_leaf.c
+++ b/fs/xfs/libxfs/xfs_attr_leaf.c
@@ -253,6 +253,7 @@ xfs_attr3_leaf_verify(
{
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_attr3_icleaf_hdr ichdr;
xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
@@ -273,7 +274,12 @@ xfs_attr3_leaf_verify(
if (ichdr.magic != XFS_ATTR_LEAF_MAGIC)
return false;
}
- if (ichdr.count == 0)
+ /*
+ * In recovery there is a transient state where count == 0 is valid
+ * 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)
return false;
/* XXX: need to range check rest of attr header values */