From patchwork Fri Oct 21 21:18:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 121067 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 00EBF1007D1 for ; Sat, 22 Oct 2011 08:19:07 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752680Ab1JUVSj (ORCPT ); Fri, 21 Oct 2011 17:18:39 -0400 Received: from e34.co.us.ibm.com ([32.97.110.152]:58401 "EHLO e34.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752796Ab1JUVSi (ORCPT ); Fri, 21 Oct 2011 17:18:38 -0400 Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Oct 2011 15:18:36 -0600 Received: from d03relay03.boulder.ibm.com ([9.17.195.228]) by e34.co.us.ibm.com ([192.168.1.134]) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Oct 2011 15:18:10 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9LLI81s091738; Fri, 21 Oct 2011 15:18:08 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9LLI7N9012424; Fri, 21 Oct 2011 15:18:08 -0600 Received: from elm3c44.beaverton.ibm.com ([9.47.69.44]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p9LLI6rm012313; Fri, 21 Oct 2011 15:18:07 -0600 Subject: [PATCH 2/5] ext4: ext4_rename should dirty dir_bh with the correct directory To: Tao Ma , Theodore Tso From: "Darrick J. Wong" Cc: linux-ext4@vger.kernel.org, linux-kernel Date: Fri, 21 Oct 2011 14:18:06 -0700 Message-ID: <20111021211806.10784.76743.stgit@elm3c44.beaverton.ibm.com> In-Reply-To: <20111021211759.10784.17257.stgit@elm3c44.beaverton.ibm.com> References: <20111021211759.10784.17257.stgit@elm3c44.beaverton.ibm.com> User-Agent: StGit/0.15 MIME-Version: 1.0 x-cbid: 11102121-1780-0000-0000-00000064A269 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org When ext4_rename performs a directory rename (move), dir_bh is a buffer that is modified to update the '..' link in the directory being moved (old_inode). However, ext4_handle_dirty_metadata is called with the old parent directory inode (old_dir) and dir_bh, which is incorrect because dir_bh does not belong to the parent inode. Fix this error. Signed-off-by: Darrick J. Wong --- fs/ext4/namei.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 310b356..6d3fab4 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2530,7 +2530,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, PARENT_INO(dir_bh->b_data, new_dir->i_sb->s_blocksize) = cpu_to_le32(new_dir->i_ino); BUFFER_TRACE(dir_bh, "call ext4_handle_dirty_metadata"); - retval = ext4_handle_dirty_metadata(handle, old_dir, dir_bh); + retval = ext4_handle_dirty_metadata(handle, old_inode, dir_bh); if (retval) { ext4_std_error(old_dir->i_sb, retval); goto end_rename;