From patchwork Mon Jan 21 06:46:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 214032 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A1BB42C009F for ; Mon, 21 Jan 2013 17:46:30 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752706Ab3AUGqa (ORCPT ); Mon, 21 Jan 2013 01:46:30 -0500 Received: from li9-11.members.linode.com ([67.18.176.11]:44547 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752667Ab3AUGq3 (ORCPT ); Mon, 21 Jan 2013 01:46:29 -0500 Received: from root (helo=closure.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.80) (envelope-from ) id 1TxB9D-0004MQ-BY; Mon, 21 Jan 2013 06:46:23 +0000 Received: by closure.thunk.org (Postfix, from userid 15806) id 6AC16308146; Mon, 21 Jan 2013 01:46:21 -0500 (EST) From: Theodore Ts'o To: Ext4 Developers List Cc: Theodore Ts'o , stable@vger.kernel.org Subject: [PATCH 1/2] ext4: release sysfs kobject when failing to enable quotas on mount Date: Mon, 21 Jan 2013 01:46:20 -0500 Message-Id: <1358750781-5670-1-git-send-email-tytso@mit.edu> X-Mailer: git-send-email 1.7.12.rc0.22.gcdd159b In-Reply-To: <20130121054741.GB321@thunk.org> References: <20130121054741.GB321@thunk.org> X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org In addition, print the error returned from ext4_enable_quotas() Signed-off-by: "Theodore Ts'o" Cc: stable@vger.kernel.org Reviewed-by: Carlos Maiolino --- fs/ext4/super.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 30651bd..0a6e9d5 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4015,7 +4015,7 @@ no_journal: !(sb->s_flags & MS_RDONLY)) { err = ext4_enable_quotas(sb); if (err) - goto failed_mount7; + goto failed_mount8; } #endif /* CONFIG_QUOTA */ @@ -4042,6 +4042,8 @@ cantfind_ext4: ext4_msg(sb, KERN_ERR, "VFS: Can't find ext4 filesystem"); goto failed_mount; +failed_mount8: + kobject_del(&sbi->s_kobj); failed_mount7: ext4_unregister_li_request(sb); failed_mount6: @@ -5012,9 +5014,9 @@ static int ext4_enable_quotas(struct super_block *sb) DQUOT_USAGE_ENABLED); if (err) { ext4_warning(sb, - "Failed to enable quota (type=%d) " - "tracking. Please run e2fsck to fix.", - type); + "Failed to enable quota tracking " + "(type=%d, err=%d). Please run " + "e2fsck to fix.", type, err); return err; } }