summaryrefslogtreecommitdiff
path: root/e2fsck
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2010-07-19 02:37:41 -0400
committerTheodore Ts'o <tytso@mit.edu>2010-07-19 02:37:41 -0400
commitdb0bdb49f49fc3dd14c12439d934a3403a3be9f1 (patch)
treeebbdc877184df5896a89d291193029d730aadd85 /e2fsck
parentefe0b401465a3ee836180614b5b435acbb84fc27 (diff)
parent58384b8fa81ce01221414a3603591b63e487609b (diff)
downloade2fsprogs-db0bdb49f49fc3dd14c12439d934a3403a3be9f1.tar.gz
Merge branch 'maint' into next
Conflicts: resize/extent.c
Diffstat (limited to 'e2fsck')
-rw-r--r--e2fsck/ea_refcount.c7
-rw-r--r--e2fsck/iscan.c2
-rw-r--r--e2fsck/unix.c4
3 files changed, 11 insertions, 2 deletions
diff --git a/e2fsck/ea_refcount.c b/e2fsck/ea_refcount.c
index 39f2db7f..b10cfffa 100644
--- a/e2fsck/ea_refcount.c
+++ b/e2fsck/ea_refcount.c
@@ -196,9 +196,14 @@ retry:
range = 0;
else if (blk > highval)
range = 1;
- else
+ else {
range = ((float) (blk - lowval)) /
(highval - lowval);
+ if (range > 0.9)
+ range = 0.9;
+ if (range < 0.1)
+ range = 0.1;
+ }
mid = low + ((int) (range * (high-low)));
}
#endif
diff --git a/e2fsck/iscan.c b/e2fsck/iscan.c
index e9fa0763..84e2cc17 100644
--- a/e2fsck/iscan.c
+++ b/e2fsck/iscan.c
@@ -51,7 +51,7 @@ static void usage(void)
static void PRS(int argc, char *argv[])
{
int flush = 0;
- char c;
+ int c;
#ifdef MTRACE
extern void *mallwatch;
#endif
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
index bae3b38c..6cb2214b 100644
--- a/e2fsck/unix.c
+++ b/e2fsck/unix.c
@@ -1061,6 +1061,8 @@ restart:
orig_retval = retval;
retval = try_open_fs(ctx, flags, io_ptr, &fs);
if ((orig_retval == 0) && retval != 0) {
+ if (fs)
+ ext2fs_close(fs);
com_err(ctx->program_name, retval,
"when using the backup blocks");
printf(_("%s: going back to original "
@@ -1448,6 +1450,8 @@ no_journal:
sb->s_mnt_count = 0;
if (!(ctx->flags & E2F_FLAG_TIME_INSANE))
sb->s_lastcheck = ctx->now;
+ memset(((char *) sb) + EXT4_S_ERR_START, 0,
+ EXT4_S_ERR_LEN);
ext2fs_mark_super_dirty(fs);
}
}