summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/libxfs')
-rw-r--r--fs/xfs/libxfs/xfs_sb.c31
-rw-r--r--fs/xfs/libxfs/xfs_types.c2
2 files changed, 32 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index 488f1dfbbe12..fb59294c3e6c 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -571,6 +571,25 @@ __xfs_sb_from_disk(
/* Convert on-disk flags to in-memory flags? */
if (convert_xquota)
xfs_sb_quota_from_disk(to);
+
+ if (to->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_METADIR) {
+ /*
+ * Set metadirino here and null out the in-core fields for
+ * the other inodes because metadir initialization will load
+ * them later.
+ */
+ to->sb_metadirino = be64_to_cpu(from->sb_rbmino);
+ to->sb_rbmino = NULLFSINO;
+ to->sb_rsumino = NULLFSINO;
+
+ /*
+ * We don't have to worry about quota inode conversion here
+ * because metadir requires a v5 filesystem.
+ */
+ to->sb_uquotino = NULLFSINO;
+ to->sb_gquotino = NULLFSINO;
+ to->sb_pquotino = NULLFSINO;
+ }
}
void
@@ -718,6 +737,18 @@ xfs_sb_to_disk(
to->sb_lsn = cpu_to_be64(from->sb_lsn);
if (from->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_META_UUID)
uuid_copy(&to->sb_meta_uuid, &from->sb_meta_uuid);
+
+ if (from->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_METADIR) {
+ /*
+ * Save metadirino here and null out the on-disk fields for
+ * the other inodes, at least until we reuse the fields.
+ */
+ to->sb_rbmino = cpu_to_be64(from->sb_metadirino);
+ to->sb_rsumino = cpu_to_be64(NULLFSINO);
+ to->sb_uquotino = cpu_to_be64(NULLFSINO);
+ to->sb_gquotino = cpu_to_be64(NULLFSINO);
+ to->sb_pquotino = cpu_to_be64(NULLFSINO);
+ }
}
/*
diff --git a/fs/xfs/libxfs/xfs_types.c b/fs/xfs/libxfs/xfs_types.c
index d12dc9a4bdb9..6099c7c3291c 100644
--- a/fs/xfs/libxfs/xfs_types.c
+++ b/fs/xfs/libxfs/xfs_types.c
@@ -201,7 +201,7 @@ xfs_verify_dir_ino(
struct xfs_mount *mp,
xfs_ino_t ino)
{
- if (xfs_internal_inum(mp, ino))
+ if (!xfs_has_metadir(mp) && xfs_internal_inum(mp, ino))
return false;
return xfs_verify_ino(mp, ino);
}