From patchwork Sun Jan 16 07:30:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Katiyar X-Patchwork-Id: 79077 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 3EC1FB6EF2 for ; Sun, 16 Jan 2011 18:30:36 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751467Ab1APHae (ORCPT ); Sun, 16 Jan 2011 02:30:34 -0500 Received: from mail-qw0-f46.google.com ([209.85.216.46]:60958 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751273Ab1APHad (ORCPT ); Sun, 16 Jan 2011 02:30:33 -0500 Received: by qwa26 with SMTP id 26so3894485qwa.19 for ; Sat, 15 Jan 2011 23:30:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to:cc :content-type; bh=61Kji5VdCt8nHor1LeO6Z3tvkQjeRTTNUWA/qv7OlnU=; b=v9EQ+DlJMWIktkXMjJ2EcFTzLtVwVcHDxCYMfbC3oZLxSxeDKtN7qDwds4TwXR2P1/ tfio6bg+vMeT/AQhYjpiAWUKDeckRESi8b19zufNpDmfcfBXJ8PHNV56Fiffq3uF4gCm zCtfMN5h4JgnCOXVavOr3/BwrJFDde391ayLs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:cc:content-type; b=ly7b6LaNV8qPwUsnlmRdrgikcOyyPbTohP6HRJnTrrInOFY/KZbONk9CIvody51FgI Yv+qxhxG3+d8RAuXGLDuTgk563Tsg/65FXrRQCPqAb3xMcxkUtrJRbFiwINjYuPuRW9o IhcPis/4lKlMeCAm3vRTe0c/Cu9Q+FjpxE/k0= Received: by 10.229.213.146 with SMTP id gw18mr2404993qcb.211.1295163033010; Sat, 15 Jan 2011 23:30:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.84.139 with HTTP; Sat, 15 Jan 2011 23:30:12 -0800 (PST) From: Manish Katiyar Date: Sat, 15 Jan 2011 23:30:12 -0800 Message-ID: Subject: [PATCH] ext4: Fix missing iput for root inode in case of all failed mount paths. To: "Theodore Ts'o" , ext4 Cc: mkatiyar@gmail.com Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Fix missing iput for root inode in case of all failed mount paths. Fixes bug#26752 Signed-off-by: Manish Katiyar --- fs/ext4/super.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index cb10a06..9570fcc 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3587,6 +3587,7 @@ no_journal: if (err) { ext4_msg(sb, KERN_ERR, "failed to initialize system " "zone (%d)", err); + iput(root); goto failed_mount4; } @@ -3595,12 +3596,15 @@ no_journal: if (err) { ext4_msg(sb, KERN_ERR, "failed to initialize mballoc (%d)", err); + iput(root); goto failed_mount4; } err = ext4_register_li_request(sb, first_not_zeroed); - if (err) + if (err) { + iput(root); goto failed_mount4; + } sbi->s_kobj.kset = ext4_kset; init_completion(&sbi->s_kobj_unregister); @@ -3609,6 +3613,7 @@ no_journal: if (err) { ext4_mb_release(sb); ext4_ext_release(sb); + iput(root); goto failed_mount4; }; @@ -3648,6 +3653,7 @@ cantfind_ext4: goto failed_mount; failed_mount4: + sb->s_root = NULL; ext4_msg(sb, KERN_ERR, "mount failed"); destroy_workqueue(EXT4_SB(sb)->dio_unwritten_wq); failed_mount_wq: