]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ext4: don't clear orphan list on ro mount with errors
authorEric Sandeen <sandeen@redhat.com>
Thu, 27 Sep 2012 03:30:12 +0000 (23:30 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 27 Sep 2012 03:30:12 +0000 (23:30 -0400)
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>
fs/ext4/super.c

index 51d24ead7278b37cb90719c775d840331e6d74b8..d5f4c970206017513de6ace21fb3ee472dae17d0 100644 (file)
@@ -2180,10 +2180,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;
        }