ext4: call ext4_handle_dirty_metadata with correct inode in ext4_dx_add_entry
authorTheodore Ts'o <tytso@mit.edu>
Wed, 31 Aug 2011 16:02:51 +0000 (12:02 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Nov 2011 17:36:34 +0000 (09:36 -0800)
commit3c607445bbf6ff07c755656df331069d753569ea
treee183069d5636a34c7500b7cd670baa407a7d772c
parent37915713a96e05b5d731b9457a0cf22ced00f36f
ext4: call ext4_handle_dirty_metadata with correct inode in ext4_dx_add_entry

commit 5930ea643805feb50a2f8383ae12eb6f10935e49 upstream.

ext4_dx_add_entry manipulates bh2 and frames[0].bh, which are two buffer_heads
that point to directory blocks assigned to the directory inode.  However, the
function calls ext4_handle_dirty_metadata with the inode of the file that's
being added to the directory, not the directory inode itself.  Therefore,
correct the code to dirty the directory buffers with the directory inode, not
the file inode.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/namei.c