]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: adjust rtbitmap/rtsummary word updates to handle big endian values
authorDarrick J. Wong <djwong@kernel.org>
Thu, 21 Nov 2024 00:24:34 +0000 (16:24 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 24 Dec 2024 02:01:33 +0000 (18:01 -0800)
With rtgroups, the rt bitmap and summary file words are defined to be
be32 values.  Adjust repair to handle the endianness correctly.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
repair/rt.c

index 711891a724b076c47c5aebeddbf322adfc2ef29d..65d6a713f379d265ff3025797607007ac63fdaa1 100644 (file)
@@ -24,7 +24,10 @@ set_rtword(
        union xfs_rtword_raw    *word,
        xfs_rtword_t            value)
 {
-       word->old = value;
+       if (xfs_has_rtgroups(mp))
+               word->rtg = cpu_to_be32(value);
+       else
+               word->old = value;
 }
 
 static inline void
@@ -35,7 +38,10 @@ inc_sumcount(
 {
        union xfs_suminfo_raw   *p = info + index;
 
-       p->old++;
+       if (xfs_has_rtgroups(mp))
+               be32_add_cpu(&p->rtg, 1);
+       else
+               p->old++;
 }
 
 /*