Whamcloud - gitweb
e2fsck: do not discard when in read only mode
authorLukas Czerner <lczerner@redhat.com>
Sun, 11 Mar 2012 19:35:06 +0000 (15:35 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 11 Mar 2012 19:38:28 +0000 (15:38 -0400)
commitf0fe5daecdb0c88afb76c23c77494bbe86e1cd2b
tree3035296461b3357a3d46b22f9117808d918d52e0
parentd2c9c42a0b1c0776afe47c9bfbddbc170d8aa036
e2fsck: do not discard when in read only mode

When argument '-n' was specified and should run in read-only mode, we
should not attempt to discard anything. In order to do that we have to
check for E2F_OPT_NO flag and clear E2F_OPT_DISCARD flag if E2F_OPT_NO
is set.

This commit fixes the problem when we would mark inode tables as zeroed
(EXT2_BG_INODE_ZEROED) even when e2fsck is running in read-only mode. We
also move the check for E2F_OPT_NO so we can clear E2F_OPT_DISCARD as
early as possible.

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
e2fsck/unix.c