Whamcloud - gitweb
e2fsck: exit from preenhalt if IO errors were encountered
authorEric Sandeen <sandeen@redhat.com>
Fri, 10 Oct 2008 22:14:08 +0000 (17:14 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 13 Oct 2008 03:12:22 +0000 (23:12 -0400)
commit79cc33628256e817610e921ddf600f72e4f879e1
tree96b1b8d322c724a90f526f623bb30430b717f9d6
parent279a000fdcfd5fa79f18c975978d1c6bfa3113a3
e2fsck: exit from preenhalt if IO errors were encountered

If a block device is read-only, e2fsck -p gets into an infinite loop
trying to preenhalt, closing and flushing the fs, which tries to flush
the cache, which gets a write error and calls preenhalt which tries to
close and flush the fs ... ad infinitum.

Per Ted's suggestion just flag the ctx as "exiting" and short-circuit
the infinite loop.

Tested by running e2fsck -p on a block device set read-only by BLKROSET.

Thanks to Vlado Potisk for reporting this.

Addresses-Red-Hat-Bugzilla: #465679

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/e2fsck.h
e2fsck/ehandler.c
e2fsck/util.c