diff options
author | Amir Goldstein <amir73il@gmail.com> | 2011-02-26 22:40:19 +0200 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2011-04-30 16:53:21 +0200 |
commit | 51da779c8cea43a029cf87f65dedd9a75fdc2fcb (patch) | |
tree | d897f9115222012a794c77cf539ac6d1f0b0cccd /fs | |
parent | 127e70c6c9ae94fc0d3d2b02e89f7e7c0fca40ef (diff) |
ext3: skip orphan cleanup on rocompat fs
commit ce654b37f87980d95f339080e4c3bdb2370bdf22 upstream.
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: Amir Goldstein <amir73il@users.sf.net>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext3/super.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 810bf7c834e..d7c5c6b20b5 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -1362,6 +1362,13 @@ static void ext3_orphan_cleanup (struct super_block * sb, return; } + /* Check if feature set allows readwrite operations */ + if (EXT3_HAS_RO_COMPAT_FEATURE(sb, ~EXT3_FEATURE_RO_COMPAT_SUPP)) { + printk(KERN_INFO "EXT3-fs: %s: Skipping orphan cleanup due to " + "unknown ROCOMPAT features\n", sb->s_id); + return; + } + if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) { if (es->s_last_orphan) jbd_debug(1, "Errors on filesystem, " |