From patchwork Mon May 16 09:46:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 95703 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 078CEB6F10 for ; Mon, 16 May 2011 19:46:49 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753738Ab1EPJqr (ORCPT ); Mon, 16 May 2011 05:46:47 -0400 Received: from cantor.suse.de ([195.135.220.2]:44635 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753592Ab1EPJqr (ORCPT ); Mon, 16 May 2011 05:46:47 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 460BD95A49; Mon, 16 May 2011 11:46:46 +0200 (CEST) Received: by quack.suse.cz (Postfix, from userid 1000) id 7583D20535; Mon, 16 May 2011 11:46:25 +0200 (CEST) From: Jan Kara To: tytso@mit.edu Cc: linux-ext4@vger.kernel.org, Amir Goldstein , Jan Kara Subject: [PATCH] ext4: Fix oops in ext4_quota_off() Date: Mon, 16 May 2011 11:46:23 +0200 Message-Id: <1305539183-7181-1-git-send-email-jack@suse.cz> X-Mailer: git-send-email 1.7.1 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org When quota is not enabled when ext4_quota_off() is called, we must not dereference quota file inode since it is NULL. Check properly for this. This is a regression caused by commit 21f976975cbecbdaf23ceeacc1cab2b1c05a028e. Debugged-by: Amir Goldstein Signed-off-by: Jan Kara --- fs/ext4/super.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index a86e693..2a4a9b2 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4652,6 +4652,8 @@ static int ext4_quota_off(struct super_block *sb, int type) if (test_opt(sb, DELALLOC)) sync_filesystem(sb); + if (!inode) + goto out; /* Update modification times of quota files when userspace can * start looking at them */ handle = ext4_journal_start(inode, 1);