From 840194be7872d9176c7f92932bd5f8f2918e3ecb Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Wed, 20 Nov 2024 16:24:34 -0800 Subject: [PATCH] xfs_repair: adjust rtbitmap/rtsummary word updates to handle big endian values 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" Reviewed-by: Christoph Hellwig --- repair/rt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/repair/rt.c b/repair/rt.c index 711891a7..65d6a713 100644 --- a/repair/rt.c +++ b/repair/rt.c @@ -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++; } /* -- 2.47.2