This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch andyp-sparse
in repository gfs2-utils.
The following commit(s) were added to refs/heads/andyp-sparse by this push:
new 96063f8e libgfs2: Don't overwrite rt_{data0,data,bitbytes} when reading
rgrps
96063f8e is described below
commit 96063f8e529a0952eca83f28f1094e946c1adf70
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Jun 16 17:58:51 2021 +0100
libgfs2: Don't overwrite rt_{data0,data,bitbytes} when reading rgrps
Older filesystems have invalid data in these new rgrp fields so keep
them separate to the fields initialised from the rindex.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/libgfs2.h | 5 +++++
gfs2/libgfs2/ondisk.c | 12 ++++++------
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 3e186019..41f83b94 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -186,6 +186,11 @@ struct rgrp_tree {
uint32_t rt_data;
uint32_t rt_length;
uint32_t rt_bitbytes;
+ /* These 3 fields are duplicated between the rindex and the rgrp */
+ /* For now, duplicate them here too, until users can be reworked */
+ uint64_t rt_rg_data0;
+ uint32_t rt_rg_data;
+ uint32_t rt_rg_bitbytes;
/* Native-endian counterparts of the on-disk rgrp structs */
uint32_t rt_flags;
uint32_t rt_free;
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 3dea69ce..4daf1be1 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -160,9 +160,9 @@ void lgfs2_rgrp_in(lgfs2_rgrp_t rg, void *buf)
rg->rt_dinodes = be32_to_cpu(r->rg_dinodes);
rg->rt_skip = be32_to_cpu(r->rg_skip);
rg->rt_igeneration = be64_to_cpu(r->rg_igeneration);
- rg->rt_data0 = be64_to_cpu(r->rg_data0);
- rg->rt_data = be32_to_cpu(r->rg_data);
- rg->rt_bitbytes = be32_to_cpu(r->rg_bitbytes);
+ rg->rt_rg_data0 = be64_to_cpu(r->rg_data0);
+ rg->rt_rg_data = be32_to_cpu(r->rg_data);
+ rg->rt_rg_bitbytes = be32_to_cpu(r->rg_bitbytes);
}
void lgfs2_rgrp_out(const lgfs2_rgrp_t rg, void *buf)
@@ -177,9 +177,9 @@ void lgfs2_rgrp_out(const lgfs2_rgrp_t rg, void *buf)
r->rg_dinodes = cpu_to_be32(rg->rt_dinodes);
r->rg_skip = cpu_to_be32(rg->rt_skip);
r->rg_igeneration = cpu_to_be64(rg->rt_igeneration);
- r->rg_data0 = cpu_to_be64(rg->rt_data0);
- r->rg_data = cpu_to_be32(rg->rt_data);
- r->rg_bitbytes = cpu_to_be32(rg->rt_bitbytes);
+ r->rg_data0 = cpu_to_be64(rg->rt_rg_data0);
+ r->rg_data = cpu_to_be32(rg->rt_rg_data);
+ r->rg_bitbytes = cpu_to_be32(rg->rt_rg_bitbytes);
lgfs2_rgrp_crc_set(buf);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date