]>
Commit | Line | Data |
---|---|---|
f1755e8a GKH |
1 | From 5930ea643805feb50a2f8383ae12eb6f10935e49 Mon Sep 17 00:00:00 2001 |
2 | From: Theodore Ts'o <tytso@mit.edu> | |
3 | Date: Wed, 31 Aug 2011 12:02:51 -0400 | |
4 | Subject: ext4: call ext4_handle_dirty_metadata with correct inode in ext4_dx_add_entry | |
5 | ||
6 | From: Theodore Ts'o <tytso@mit.edu> | |
7 | ||
8 | commit 5930ea643805feb50a2f8383ae12eb6f10935e49 upstream. | |
9 | ||
10 | ext4_dx_add_entry manipulates bh2 and frames[0].bh, which are two buffer_heads | |
11 | that point to directory blocks assigned to the directory inode. However, the | |
12 | function calls ext4_handle_dirty_metadata with the inode of the file that's | |
13 | being added to the directory, not the directory inode itself. Therefore, | |
14 | correct the code to dirty the directory buffers with the directory inode, not | |
15 | the file inode. | |
16 | ||
17 | Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> | |
18 | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> | |
19 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
20 | ||
21 | --- | |
22 | fs/ext4/namei.c | 4 ++-- | |
23 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
24 | ||
25 | --- a/fs/ext4/namei.c | |
26 | +++ b/fs/ext4/namei.c | |
27 | @@ -1586,7 +1586,7 @@ static int ext4_dx_add_entry(handle_t *h | |
28 | dxtrace(dx_show_index("node", frames[1].entries)); | |
29 | dxtrace(dx_show_index("node", | |
30 | ((struct dx_node *) bh2->b_data)->entries)); | |
31 | - err = ext4_handle_dirty_metadata(handle, inode, bh2); | |
32 | + err = ext4_handle_dirty_metadata(handle, dir, bh2); | |
33 | if (err) | |
34 | goto journal_error; | |
35 | brelse (bh2); | |
36 | @@ -1612,7 +1612,7 @@ static int ext4_dx_add_entry(handle_t *h | |
37 | if (err) | |
38 | goto journal_error; | |
39 | } | |
40 | - err = ext4_handle_dirty_metadata(handle, inode, frames[0].bh); | |
41 | + err = ext4_handle_dirty_metadata(handle, dir, frames[0].bh); | |
42 | if (err) { | |
43 | ext4_std_error(inode->i_sb, err); | |
44 | goto cleanup; |