Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933369Ab1CZALA (ORCPT ); Fri, 25 Mar 2011 20:11:00 -0400 Received: from kroah.org ([198.145.64.141]:35880 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933308Ab1CZAG3 (ORCPT ); Fri, 25 Mar 2011 20:06:29 -0400 X-Mailbox-Line: From gregkh@clark.kroah.org Fri Mar 25 17:04:57 2011 Message-Id: <20110326000457.715454813@clark.kroah.org> User-Agent: quilt/0.48-16.4 Date: Fri, 25 Mar 2011 17:03:50 -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: [18/35] ext3: skip orphan cleanup on rocompat fs In-Reply-To: <20110326000509.GA29736@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1542 Lines: 47 2.6.33-longterm review patch. If anyone has any objections, please let us know. ------------------ 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 @@ -1440,6 +1440,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)) { + 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 (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/