This is an automated email from the git hooks/post-receive script.
agruenba pushed a commit to branch agruenba-extents
in repository gfs2-utils.
commit 0562776c5c49fba9fbbabd0fec0d0fe375e9ad33
Author: Andreas Gruenbacher <agruenba(a)redhat.com>
AuthorDate: Wed Apr 21 21:21:24 2021 +0200
fsck.gfs2: Minor data type cleanups
The on-disk height is an unsigned 16-bit value, so turn both height and i into
an unsigned int in check_metatree to avoid confusion. Similarly, turn i into
an unsigned int in free_metalist.
In metawalk_check_data and undo_check_data, turn ptr_end into a uint64_t
pointer.
Signed-off-by: Andreas Gruenbacher <agruenba(a)redhat.com>
---
gfs2/fsck/metawalk.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 820ffcc1..adaa4df7 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -1139,7 +1139,7 @@ int check_inode_eattr(struct gfs2_inode *ip, struct metawalk_fxns
*pass)
*/
static void free_metalist(struct gfs2_inode *ip, osi_list_t *mlp)
{
- int i;
+ unsigned int i;
struct gfs2_buffer_head *nbh;
for (i = 0; i < GFS2_MAX_META_HEIGHT; i++) {
@@ -1403,14 +1403,14 @@ static int metawalk_check_data(struct gfs2_inode *ip, struct
metawalk_fxns *pass
int error = 0, rc = 0;
uint64_t block, *ptr;
uint64_t *ptr_start = (uint64_t *)(bh->b_data + hdr_size(bh, height));
- char *ptr_end = (bh->b_data + ip->i_sbd->bsize);
+ uint64_t *ptr_end = (uint64_t *)(bh->b_data + ip->i_sbd->bsize);
uint64_t metablock = bh->b_blocknr;
/* If there isn't much pointer corruption check the pointers */
log_debug("Processing data blocks for inode 0x%llx, metadata block
0x%llx.\n",
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)bh->b_blocknr);
- for (ptr = ptr_start ; (char *)ptr < ptr_end && !fsck_abort; ptr++) {
+ for (ptr = ptr_start ; ptr < ptr_end && !fsck_abort; ptr++) {
if (!*ptr)
continue;
@@ -1474,14 +1474,14 @@ static int undo_check_data(struct gfs2_inode *ip, struct
metawalk_fxns *pass,
struct error_block *error_blk, int error)
{
uint64_t *ptr_start = (uint64_t *)(bh->b_data + hdr_size(bh, height));
- char *ptr_end = bh->b_data + ip->i_sbd->bsize;
+ uint64_t *ptr_end = (uint64_t *)(bh->b_data + ip->i_sbd->bsize);
uint64_t metablock = bh->b_blocknr;
int rc = 0;
uint64_t block, *ptr;
int found_error_blk = 0;
/* If there isn't much pointer corruption check the pointers */
- for (ptr = ptr_start ; (char *)ptr < ptr_end && !fsck_abort; ptr++) {
+ for (ptr = ptr_start ; ptr < ptr_end && !fsck_abort; ptr++) {
if (!*ptr)
continue;
@@ -1532,12 +1532,11 @@ static unsigned int should_check(struct gfs2_buffer_head *bh,
unsigned int heigh
*/
int check_metatree(struct gfs2_inode *ip, struct metawalk_fxns *pass)
{
-
+ unsigned int height = ip->i_di.di_height;
osi_list_t metalist[GFS2_MAX_META_HEIGHT];
osi_list_t *list, *tmp;
struct gfs2_buffer_head *bh;
- uint32_t height = ip->i_di.di_height;
- int i;
+ unsigned int i;
uint64_t blks_checked = 0;
int error, rc;
int metadata_clean = 0;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date