Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755625Ab0KXQx1 (ORCPT ); Wed, 24 Nov 2010 11:53:27 -0500 Received: from mail-yx0-f174.google.com ([209.85.213.174]:34298 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755551Ab0KXQxZ (ORCPT ); Wed, 24 Nov 2010 11:53:25 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=aG9ipDmyUJXx7dXBxBluUDUZtdceMYJEYVOBXzTgvD1PEsgp3q7bKGNCR27jtwypg8 Ay4KgoBT9JTgTqZzMVJpWxB0GeCgzghvt6hNcKD09XGck3UVyzMUAIPXtlxJmuBbMEdq k8yB7++yXyGO4oFApdUczg/0c73GBgqP3tlLs= From: Namhyung Kim To: Jan Kara , Andrew Morton , Andreas Dilger Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] ext3: Add more journal error check Date: Thu, 25 Nov 2010 01:53:13 +0900 Message-Id: <1290617593-4615-2-git-send-email-namhyung@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1290617593-4615-1-git-send-email-namhyung@gmail.com> References: <1290617593-4615-1-git-send-email-namhyung@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1708 Lines: 54 Check return value of ext3_journal_get_write_acccess() and ext3_journal_dirty_metadata(). Signed-off-by: Namhyung Kim --- fs/ext3/inode.c | 6 ++++-- fs/ext3/namei.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 460b6d4..1fd908d 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c @@ -2151,13 +2151,15 @@ static void ext3_clear_blocks(handle_t *handle, struct inode *inode, if (try_to_extend_transaction(handle, inode)) { if (bh) { BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata"); - ext3_journal_dirty_metadata(handle, bh); + if (ext3_journal_dirty_metadata(handle, bh)) + return; } ext3_mark_inode_dirty(handle, inode); truncate_restart_transaction(handle, inode); if (bh) { BUFFER_TRACE(bh, "retaking write access"); - ext3_journal_get_write_access(handle, bh); + if (ext3_journal_get_write_access(handle, bh)) + return; } } diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index c8415e7..4400b4e 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c @@ -1607,7 +1607,9 @@ static int ext3_dx_add_entry(handle_t *handle, struct dentry *dentry, if (err) goto journal_error; } - ext3_journal_dirty_metadata(handle, frames[0].bh); + err = ext3_journal_dirty_metadata(handle, frames[0].bh); + if (err) + goto journal_error; } de = do_split(handle, dir, &bh, frame, &hinfo, &err); if (!de) -- 1.7.0.4 -- 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/