summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2014-04-28 10:07:16 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-05-04 23:15:49 -0400
commitcd84e9a337987658b8508fac2e4de4bd52e4b48d (patch)
treedde6f7832eb63a8532c0968096900b32287214a7
parentd51072af0a9c458e12391be0639a129ede1d2931 (diff)
downloade2fsprogs-cd84e9a337987658b8508fac2e4de4bd52e4b48d.tar.gz
resize2fs: fix inode table move for the backwards move case
In the case where the new location of the inode table is before the old inode table, the optimization which tries to optimize zero block moves breaks. Fix it. This fixes a bug that was tickled by the reproduction described in the previous commit. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--resize/resize2fs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index 0d968faf..c672cdbe 100644
--- a/resize/resize2fs.c
+++ b/resize/resize2fs.c
@@ -1869,6 +1869,8 @@ static errcode_t move_itables(ext2_resize_t rfs)
if (!diff)
continue;
+ if (diff < 0)
+ diff = 0;
retval = io_channel_read_blk64(fs->io, old_blk,
fs->inode_blocks_per_group,