Whamcloud - gitweb
e2fsck: discard only unused parts of inode table
authorLukas Czerner <lczerner@redhat.com>
Sun, 11 Mar 2012 16:55:45 +0000 (12:55 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 11 Mar 2012 19:38:00 +0000 (15:38 -0400)
commit57581c1064493b5eceff961b82b70cde6b41fc17
treef5f15a93005dfda3d71f89730689e61e2d4090b8
parent800766ee4a2bcdc0a32442d093d20da6ea3815ab
e2fsck: discard only unused parts of inode table

When calling e2fsck with '-E discard' option it might happen that
valid inodes are discarded accidentally. This is because we just
discard the part of inode table which lies past the free inode count.
This is terribly wrong (sorry!).

This patch fixes it so only the free parts of an inode table
is discarded, leaving used inodes intact. This was tested with highly
fragmented inode tables with block size 4k and 1k.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reported-by: Phillip Susi <psusi@ubuntu.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass5.c