Whamcloud - gitweb
e2fsck: do not discard itable if discard doen't zero data
authorLukas Czerner <lczerner@redhat.com>
Sun, 11 Mar 2012 19:36:45 +0000 (15:36 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 11 Mar 2012 19:38:40 +0000 (15:38 -0400)
commitc15386cdeed2464736f46bf1b19ec80ba8812dbf
tree0e08b1069f800d587c0b966d7045a36ef943b60c
parentf0fe5daecdb0c88afb76c23c77494bbe86e1cd2b
e2fsck: do not discard itable if discard doen't zero data

We do not want to discard inode table if the underlying device does not
return zeros when reading non-provisioned blocks. The reason is that if
the inode table is not zeroed yet, then discard would not help us since
we would have to zero it anyway. In the case that inode table was
already zeroed, then the discard would cause subsequent reads to contain
non-deterministic data so we would not be able to assume that the inode
table was zeroed and we would need to zero it again, which does not
really make sense.

This commit adds check to prevent inode table from being discarded if
the discard does not zero data.

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