aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorAllison Henderson <achender@linux.vnet.ibm.com>2011-05-15 00:19:41 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-05-15 00:19:41 -0400
commit6976a6f2acde2b0443cd64f1d08af90630e4ce81 (patch)
tree754e33f280a83ac2f843f2dcafd1b2fbffdd92ca /fs/ext4
parent44183d4231a52a797beb477f962e1d361e31299d (diff)
ext4: don't dereference null pointer when make_indexed_dir() fails
Fix for a null pointer bug found while running punch hole tests Signed-off-by: Allison Henderson <achender@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/namei.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 3c7a06e58469..b754b7721f51 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1413,6 +1413,10 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
1413 frame->at = entries; 1413 frame->at = entries;
1414 frame->bh = bh; 1414 frame->bh = bh;
1415 bh = bh2; 1415 bh = bh2;
1416
1417 ext4_handle_dirty_metadata(handle, dir, frame->bh);
1418 ext4_handle_dirty_metadata(handle, dir, bh);
1419
1416 de = do_split(handle,dir, &bh, frame, &hinfo, &retval); 1420 de = do_split(handle,dir, &bh, frame, &hinfo, &retval);
1417 if (!de) { 1421 if (!de) {
1418 /* 1422 /*
@@ -1421,8 +1425,6 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
1421 * with corrupted filesystem. 1425 * with corrupted filesystem.
1422 */ 1426 */
1423 ext4_mark_inode_dirty(handle, dir); 1427 ext4_mark_inode_dirty(handle, dir);
1424 ext4_handle_dirty_metadata(handle, dir, frame->bh);
1425 ext4_handle_dirty_metadata(handle, dir, bh);
1426 dx_release(frames); 1428 dx_release(frames);
1427 return retval; 1429 return retval;
1428 } 1430 }