Skip to content

Commit ea99122

Browse files
author
Darrick J. Wong
committed
xfs: mask off the rtbitmap and summary inodes when metadir in use
Set the rtbitmap and summary file inumbers to NULLFSINO in the superblock and make sure they're zeroed whenever we write the superblock to disk, to mimic mkfs behavior. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent a749233 commit ea99122

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

fs/xfs/libxfs/xfs_sb.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,14 @@ xfs_validate_sb_common(
655655
void
656656
xfs_sb_quota_from_disk(struct xfs_sb *sbp)
657657
{
658+
if (xfs_sb_is_v5(sbp) &&
659+
(sbp->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_METADIR)) {
660+
sbp->sb_uquotino = NULLFSINO;
661+
sbp->sb_gquotino = NULLFSINO;
662+
sbp->sb_pquotino = NULLFSINO;
663+
return;
664+
}
665+
658666
/*
659667
* older mkfs doesn't initialize quota inodes to NULLFSINO. This
660668
* leads to in-core values having two different values for a quota
@@ -783,6 +791,8 @@ __xfs_sb_from_disk(
783791
to->sb_metadirino = be64_to_cpu(from->sb_metadirino);
784792
to->sb_rgcount = be32_to_cpu(from->sb_rgcount);
785793
to->sb_rgextents = be32_to_cpu(from->sb_rgextents);
794+
to->sb_rbmino = NULLFSINO;
795+
to->sb_rsumino = NULLFSINO;
786796
} else {
787797
to->sb_metadirino = NULLFSINO;
788798
to->sb_rgcount = 1;
@@ -805,6 +815,14 @@ xfs_sb_quota_to_disk(
805815
{
806816
uint16_t qflags = from->sb_qflags;
807817

818+
if (xfs_sb_is_v5(from) &&
819+
(from->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_METADIR)) {
820+
to->sb_uquotino = cpu_to_be64(0);
821+
to->sb_gquotino = cpu_to_be64(0);
822+
to->sb_pquotino = cpu_to_be64(0);
823+
return;
824+
}
825+
808826
to->sb_uquotino = cpu_to_be64(from->sb_uquotino);
809827

810828
/*
@@ -940,6 +958,8 @@ xfs_sb_to_disk(
940958
to->sb_metadirino = cpu_to_be64(from->sb_metadirino);
941959
to->sb_rgcount = cpu_to_be32(from->sb_rgcount);
942960
to->sb_rgextents = cpu_to_be32(from->sb_rgextents);
961+
to->sb_rbmino = cpu_to_be64(0);
962+
to->sb_rsumino = cpu_to_be64(0);
943963
}
944964
}
945965

0 commit comments

Comments
 (0)