From: "Darrick J. Wong" Subject: [PATCH 3/5] ext4: ext4_mkdir should dirty dir_block with the parent inode Date: Fri, 21 Oct 2011 14:18:12 -0700 Message-ID: <20111021211812.10784.27324.stgit@elm3c44.beaverton.ibm.com> References: <20111021211759.10784.17257.stgit@elm3c44.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: linux-ext4@vger.kernel.org, linux-kernel To: Tao Ma , Theodore Tso Return-path: Received: from e2.ny.us.ibm.com ([32.97.182.142]:54585 "EHLO e2.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753044Ab1JUVSn (ORCPT ); Fri, 21 Oct 2011 17:18:43 -0400 Received: from /spool/local by e2.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Oct 2011 17:18:41 -0400 In-Reply-To: <20111021211759.10784.17257.stgit@elm3c44.beaverton.ibm.com> Sender: linux-ext4-owner@vger.kernel.org List-ID: ext4_mkdir calls ext4_handle_dirty_metadata with dir_block and the inode "dir". Unfortunately, dir_block belongs to the newly created directory (which is "inode"), not the parent directory (which is "dir"). Fix the incorrect association. Signed-off-by: Darrick J. Wong --- fs/ext4/namei.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 6d3fab4..50c7294 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1863,7 +1863,7 @@ retry: ext4_set_de_type(dir->i_sb, de, S_IFDIR); inode->i_nlink = 2; BUFFER_TRACE(dir_block, "call ext4_handle_dirty_metadata"); - err = ext4_handle_dirty_metadata(handle, dir, dir_block); + err = ext4_handle_dirty_metadata(handle, inode, dir_block); if (err) goto out_clear_inode; err = ext4_mark_inode_dirty(handle, inode);