@@ -404,7 +404,7 @@ static void check_is_really_dir(e2fsck_t ctx, struct problem_context *pctx,
const char *old_op;
errcode_t retval;
blk_t blk;
- int i, rec_len, not_device = 0;
+ unsigned int i, rec_len, not_device = 0;
if (LINUX_S_ISDIR(inode->i_mode) || LINUX_S_ISREG(inode->i_mode) ||
LINUX_S_ISLNK(inode->i_mode) || inode->i_block[0] == 0)
@@ -1935,7 +1935,7 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx,
bad_size = 4;
else if ((extent_fs && (inode->i_flags & EXT4_EXTENTS_FL)) &&
size >
- ((1LL << (32 + EXT2_BLOCK_SIZE_BITS(fs->super))) - 1))
+ ((1ULL << (32 + EXT2_BLOCK_SIZE_BITS(fs->super))) - 1))
/* too big for an extent-based file - 32bit ee_block */
bad_size = 6;
}
@@ -717,7 +717,7 @@ static int check_dir_block(ext2_filsys fs,
const char * old_op;
int dir_modified = 0;
int dot_state;
- int rec_len;
+ unsigned int rec_len;
blk_t block_nr = db->blk;
ext2_ino_t ino = db->ino;
ext2_ino_t subdir_parent;
@@ -855,7 +855,7 @@ out_htree:
if (((offset + rec_len) > fs->blocksize) ||
(rec_len < 12) ||
((rec_len % 4) != 0) ||
- (((dirent->name_len & 0xFF)+8) > rec_len)) {
+ (((dirent->name_len & (unsigned) 0xFF)+8) > rec_len)) {
if (fix_problem(ctx, PR_2_DIR_CORRUPTED, &cd->pctx)) {
salvage_directory(fs, dirent, prev, &offset);
dir_modified++;
@@ -29,10 +29,10 @@
/*
* Check for uninit block bitmaps and deal with them appropriately
*/
-static check_block_uninit(ext2_filsys fs, ext2fs_block_bitmap map,
+static void check_block_uninit(ext2_filsys fs, ext2fs_block_bitmap map,
dgrp_t group)
{
- int i;
+ blk_t i;
blk_t blk, super_blk, old_desc_blk, new_desc_blk;
int old_desc_blocks;
@@ -75,11 +75,10 @@ static check_block_uninit(ext2_filsys fs, ext2fs_block_bitmap map,
/*
* Check for uninit inode bitmaps and deal with them appropriately
*/
-static check_inode_uninit(ext2_filsys fs, ext2fs_inode_bitmap map,
+static void check_inode_uninit(ext2_filsys fs, ext2fs_inode_bitmap map,
dgrp_t group)
{
- int i;
- ext2_ino_t ino;
+ ext2_ino_t i, ino;
if (!(EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) ||
@@ -119,7 +119,7 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group,
start_blk = group_blk;
if (flexbg_size) {
- int prev_block = 0;
+ blk_t prev_block = 0;
if (group && fs->group_desc[group-1].bg_block_bitmap)
prev_block = fs->group_desc[group-1].bg_block_bitmap;
start_blk = flexbg_offset(fs, group, prev_block, bmap,
@@ -147,7 +147,7 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group,
}
if (flexbg_size) {
- int prev_block = 0;
+ blk_t prev_block = 0;
if (group && fs->group_desc[group-1].bg_inode_bitmap)
prev_block = fs->group_desc[group-1].bg_inode_bitmap;
start_blk = flexbg_offset(fs, group, prev_block, bmap,
@@ -17,6 +17,7 @@
#if HAVE_ERRNO_H
#include <errno.h>
#endif
+#include <time.h>
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
@@ -176,8 +176,7 @@ errout:
*/
static void fix_uninit_block_bitmaps(ext2_filsys fs)
{
- int i;
- blk_t blk, super_blk, old_desc_blk, new_desc_blk;
+ blk_t i, blk, super_blk, old_desc_blk, new_desc_blk;
int old_desc_blocks;
dgrp_t g;
@@ -1375,8 +1374,8 @@ errout:
struct istruct {
ext2_resize_t rfs;
errcode_t err;
- unsigned long max_dirs;
- int num;
+ unsigned int max_dirs;
+ unsigned int num;
};
static int check_and_change_inodes(ext2_ino_t dir,
I've just checked the following into e2fsprogs git tree. - Ted commit a057b2332f5780b71018630f18f2619480118c5d Author: Theodore Ts'o <tytso@mit.edu> Date: Sun Nov 16 10:03:00 2008 -0500 Fix various signed/unsigned gcc warnings Some of these could affect filesystems between 2^31 and 2^32-1 blocks. Thanks to Valerie Aurora Henson for pointing out the problems in lib/ext2fs/alloc_tables.c, which led me to do a "make gcc-wall" scan over the source tree. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html