summaryrefslogtreecommitdiffstats
path: root/fs/xfs/scrub
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-11-04 05:19:24 +0100
committerDarrick J. Wong <djwong@kernel.org>2024-11-05 22:38:41 +0100
commita2c28367396a85f2d9cfb22acfcedcff08dd1c3c (patch)
treeb20a0bf81cf9b73dc83afe66c6edb7593191b2ec /fs/xfs/scrub
parentxfs: encode the rtbitmap in big endian format (diff)
downloadlinux-a2c28367396a85f2d9cfb22acfcedcff08dd1c3c.tar.xz
linux-a2c28367396a85f2d9cfb22acfcedcff08dd1c3c.zip
xfs: encode the rtsummary in big endian format
Currently, the ondisk realtime summary file counters are accessed in units of 32-bit words. There's no endian translation of the contents of this file, which means that the Bad Things Happen(tm) if you go from (say) x86 to powerpc. Since we have a new feature flag, let's take the opportunity to enforce an endianness on the file. Encode the summary information in big endian format, like most of the rest of the filesystem. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r--fs/xfs/scrub/rtsummary.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/scrub/rtsummary.c b/fs/xfs/scrub/rtsummary.c
index 8f3f69b26cad..49fc6250bafc 100644
--- a/fs/xfs/scrub/rtsummary.c
+++ b/fs/xfs/scrub/rtsummary.c
@@ -151,6 +151,11 @@ xchk_rtsum_inc(
struct xfs_mount *mp,
union xfs_suminfo_raw *v)
{
+ if (xfs_has_rtgroups(mp)) {
+ be32_add_cpu(&v->rtg, 1);
+ return be32_to_cpu(v->rtg);
+ }
+
v->old += 1;
return v->old;
}