Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932929Ab1CZACM (ORCPT ); Fri, 25 Mar 2011 20:02:12 -0400 Received: from kroah.org ([198.145.64.141]:48893 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932880Ab1CYX6P (ORCPT ); Fri, 25 Mar 2011 19:58:15 -0400 X-Mailbox-Line: From gregkh@clark.kroah.org Fri Mar 25 16:56:37 2011 Message-Id: <20110325235637.287872930@clark.kroah.org> User-Agent: quilt/0.48-16.4 Date: Fri, 25 Mar 2011 16:55:45 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Amir Goldstein , Jan Kara Subject: [08/23] ext3: skip orphan cleanup on rocompat fs References: <20110325235537.660072281@clark.kroah.org> Content-Disposition: inline; filename=ext3-skip-orphan-cleanup-on-rocompat-fs.patch In-Reply-To: <20110325235654.GA24416@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1458 Lines: 43 From: Amir Goldstein 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 Signed-off-by: Jan Kara Signed-off-by: Greg Kroah-Hartman --- fs/ext3/super.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -1404,6 +1404,13 @@ static void ext3_orphan_cleanup (struct 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, " -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/