linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] ext4: ext4_dx_add_entry should dirty directory metadata with the directory inode
@ 2011-10-21 21:17 Darrick J. Wong
  2011-10-21 21:18 ` [PATCH 2/5] ext4: ext4_rename should dirty dir_bh with the correct directory Darrick J. Wong
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Darrick J. Wong @ 2011-10-21 21:17 UTC (permalink / raw)
  To: Tao Ma, Theodore Tso; +Cc: linux-ext4, linux-kernel

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>
---
 fs/ext4/namei.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 1c924fa..310b356 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1586,7 +1586,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
 			dxtrace(dx_show_index("node", frames[1].entries));
 			dxtrace(dx_show_index("node",
 			       ((struct dx_node *) bh2->b_data)->entries));
-			err = ext4_handle_dirty_metadata(handle, inode, bh2);
+			err = ext4_handle_dirty_metadata(handle, dir, bh2);
 			if (err)
 				goto journal_error;
 			brelse (bh2);
@@ -1612,7 +1612,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
 			if (err)
 				goto journal_error;
 		}
-		err = ext4_handle_dirty_metadata(handle, inode, frames[0].bh);
+		err = ext4_handle_dirty_metadata(handle, dir, frames[0].bh);
 		if (err) {
 			ext4_std_error(inode->i_sb, err);
 			goto cleanup;


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-10-25 13:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-21 21:17 [PATCH 1/5] ext4: ext4_dx_add_entry should dirty directory metadata with the directory inode Darrick J. Wong
2011-10-21 21:18 ` [PATCH 2/5] ext4: ext4_rename should dirty dir_bh with the correct directory Darrick J. Wong
2011-10-25 13:08   ` Ted Ts'o
2011-10-21 21:18 ` [PATCH 3/5] ext4: ext4_mkdir should dirty dir_block with the parent inode Darrick J. Wong
2011-10-25 13:09   ` Ted Ts'o
2011-10-21 21:18 ` [PATCH 4/5] ext4: Prevent stack overrun in ext4_file_open when recording last known mountpoint Darrick J. Wong
2011-10-25 13:22   ` Ted Ts'o
2011-10-21 21:18 ` [PATCH 5/5] ext4: Fix endian problem in MMP initialization Darrick J. Wong
2011-10-22 17:25   ` Andreas Dilger
2011-10-25 13:35   ` Ted Ts'o
2011-10-25 13:13 ` [PATCH 1/5] ext4: ext4_dx_add_entry should dirty directory metadata with the directory inode Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).