Commit ce654b37 authored by Amir Goldstein's avatar Amir Goldstein Committed by Jan Kara

ext3: skip orphan cleanup on rocompat fs

Orphan cleanup is currently executed even if the file system has some
number of unknown ROCOMPAT features, which deletes inodes and frees
blocks, which could be very bad for some RO_COMPAT features.

This patch skips the orphan cleanup if it contains readonly compatible
features not known by this ext3 implementation, which would prevent
the fs from being mounted (or remounted) readwrite.
Signed-off-by: default avatarAmir Goldstein <amir73il@users.sf.net>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 03885ac3
...@@ -1464,6 +1464,13 @@ static void ext3_orphan_cleanup (struct super_block * sb, ...@@ -1464,6 +1464,13 @@ static void ext3_orphan_cleanup (struct super_block * sb,
return; return;
} }
/* Check if feature set allows readwrite operations */
if (EXT3_HAS_RO_COMPAT_FEATURE(sb, ~EXT3_FEATURE_RO_COMPAT_SUPP)) {
ext3_msg(sb, KERN_INFO, "Skipping orphan cleanup due to "
"unknown ROCOMPAT features");
return;
}
if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) { if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) {
if (es->s_last_orphan) if (es->s_last_orphan)
jbd_debug(1, "Errors on filesystem, " jbd_debug(1, "Errors on filesystem, "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment