summaryrefslogtreecommitdiff
path: root/misc/e2fuzz.c
diff options
context:
space:
mode:
authorAndreas Dilger <adilger@whamcloud.com>2020-02-06 18:09:39 -0700
committerTheodore Ts'o <tytso@mit.edu>2020-02-29 18:26:38 -0500
commit382ed4a1c2b60acb9db7631e86dda207bde6076e (patch)
treec41e4d4412123c5d789f650179f07f4aeea865e0 /misc/e2fuzz.c
parent74fbba1ff1074333eedaa3ed46597294641bf6b8 (diff)
downloade2fsprogs-382ed4a1c2b60acb9db7631e86dda207bde6076e.tar.gz
e2fsck: use proper types for variables
Use ext2_ino_t instead of ino_t for referencing inode numbers. Use loff_t for for file offsets, and dgrp_t for group numbers. Cast products to ssize_t before multiplication to avoid overflow. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Reviewed-by: Shilong Wang <wshilong@ddn.com> Lustre-bug-id: https://jira.whamcloud.com/browse/LU-13197 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'misc/e2fuzz.c')
-rw-r--r--misc/e2fuzz.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/e2fuzz.c b/misc/e2fuzz.c
index 8576d4ee..7c0f776f 100644
--- a/misc/e2fuzz.c
+++ b/misc/e2fuzz.c
@@ -181,9 +181,9 @@ static int process_fs(const char *fsname)
int flags, fd;
ext2_filsys fs = NULL;
ext2fs_block_bitmap corrupt_map;
- off_t hsize, count, off, offset, corrupt_bytes;
+ loff_t hsize, count, off, offset, corrupt_bytes;
unsigned char c;
- off_t i;
+ loff_t i;
/* If mounted rw, force dryrun mode */
ret = ext2fs_check_if_mounted(fsname, &flags);
@@ -277,8 +277,8 @@ static int process_fs(const char *fsname)
c |= 0x80;
if (verbose)
printf("Corrupting byte %lld in block %lld to 0x%x\n",
- (long long) off % fs->blocksize,
- (long long) off / fs->blocksize, c);
+ off % fs->blocksize,
+ off / fs->blocksize, c);
if (dryrun)
continue;
#ifdef HAVE_PWRITE64