diff options
author | Eric Sandeen <sandeen@redhat.com> | 2012-09-26 23:30:12 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-09-26 23:30:12 -0400 |
commit | c25f9bc6143f4cb4dc31d2ad7a6fe4e4005fc414 (patch) | |
tree | 35b45f146ece8fdd2deb6a62739f685e74bf18ab /fs/ext4 | |
parent | b794e7a6ebfbddb819b0e75ab59ada6b08a285f2 (diff) | |
download | linux-c25f9bc6143f4cb4dc31d2ad7a6fe4e4005fc414.tar.bz2 |
ext4: don't clear orphan list on ro mount with errors
If the file system contains errors and it is being mounted read-only,
don't clear the orphan list. We should minimize changes to the file
system if it is mounted read-only.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/super.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 7bef0a4bc518..a53a23aef5e3 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2177,10 +2177,12 @@ static void ext4_orphan_cleanup(struct super_block *sb, } if (EXT4_SB(sb)->s_mount_state & EXT4_ERROR_FS) { - if (es->s_last_orphan) + /* don't clear list on RO mount w/ errors */ + if (es->s_last_orphan && !(s_flags & MS_RDONLY)) { jbd_debug(1, "Errors on filesystem, " "clearing orphan list.\n"); - es->s_last_orphan = 0; + es->s_last_orphan = 0; + } jbd_debug(1, "Skipping orphan recovery on fs with errors.\n"); return; } |