Whamcloud - gitweb
e2fsck: correctly propagate error from journal to superblock
authorTheodore Ts'o <tytso@mit.edu>
Mon, 11 Jun 2012 03:35:43 +0000 (23:35 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 11 Jun 2012 03:35:43 +0000 (23:35 -0400)
commit63b3913dbc0bc7cdf8a63f3bdb0c8d7d605e9a40
treec64f1b2699df7526cdafc023b87eead30fd2182e
parent2ae58b6d5c73e044f3d498feea5d81892af2671f
e2fsck: correctly propagate error from journal to superblock

If the file system is mounted read-only after a file system error has
been detected, the fact that an error occurred is written to the
journal.  This is important because while the journal is getting
replayed, the error indication in the superblock may very well get
overwritten.

Unfortunately, the code to propagate the error indication from the
journal to superblock was broken because this was being done before
the old file system handle is thrown away and the file system is
re-opened to ensure that no stale data is in the file system handle.
As a result, the error indication in the superblock was never written
out.

To fix this, we need to move the check if the journal's error
indicator has been set after the file system has been freed and
re-open.

Reported-by: Ken Sumrall <ksumrall@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/journal.c