From patchwork Mon May 9 14:27:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 94769 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 3A32BB6F3A for ; Tue, 10 May 2011 00:28:16 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753477Ab1EIO1L (ORCPT ); Mon, 9 May 2011 10:27:11 -0400 Received: from li9-11.members.linode.com ([67.18.176.11]:49559 "EHLO test.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752809Ab1EIO1K (ORCPT ); Mon, 9 May 2011 10:27:10 -0400 Received: from root (helo=tytso-glaptop) by test.thunk.org with local-esmtp (Exim 4.69) (envelope-from ) id 1QJRQU-0004Rr-3v; Mon, 09 May 2011 14:27:10 +0000 Received: from tytso by tytso-glaptop with local (Exim 4.71) (envelope-from ) id 1QJRQS-0006VB-ES; Mon, 09 May 2011 10:27:08 -0400 From: Theodore Ts'o To: Ext4 Developers List Cc: Allison Henderson , "Theodore Ts'o" Subject: [PATCH -v2] ext4: don't dereference null pointer when make_indexed_dir() fails Date: Mon, 9 May 2011 10:27:08 -0400 Message-Id: <1304951228-24962-1-git-send-email-tytso@mit.edu> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <20110509142237.GA19811@thunk.org> References: <20110509142237.GA19811@thunk.org> X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on test.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 From: Allison Henderson Fix for a null pointer bug found while running punch hole tests Signed-off-by: Allison Henderson Signed-off-by: "Theodore Ts'o" --- fs/ext4/namei.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 3c7a06e..cc97feb 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1422,7 +1422,9 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry, */ ext4_mark_inode_dirty(handle, dir); ext4_handle_dirty_metadata(handle, dir, frame->bh); - ext4_handle_dirty_metadata(handle, dir, bh); + ext4_handle_dirty_metadata(handle, dir, bh2); + if (bh) + ext4_handle_dirty_metadata(handle, dir, bh); dx_release(frames); return retval; }