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>
This commit is contained in:
parent
44183d4231
commit
6976a6f2ac
1 changed files with 4 additions and 2 deletions
|
@ -1413,6 +1413,10 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
|
||||||
frame->at = entries;
|
frame->at = entries;
|
||||||
frame->bh = bh;
|
frame->bh = bh;
|
||||||
bh = bh2;
|
bh = bh2;
|
||||||
|
|
||||||
|
ext4_handle_dirty_metadata(handle, dir, frame->bh);
|
||||||
|
ext4_handle_dirty_metadata(handle, dir, bh);
|
||||||
|
|
||||||
de = do_split(handle,dir, &bh, frame, &hinfo, &retval);
|
de = do_split(handle,dir, &bh, frame, &hinfo, &retval);
|
||||||
if (!de) {
|
if (!de) {
|
||||||
/*
|
/*
|
||||||
|
@ -1421,8 +1425,6 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
|
||||||
* with corrupted filesystem.
|
* with corrupted filesystem.
|
||||||
*/
|
*/
|
||||||
ext4_mark_inode_dirty(handle, dir);
|
ext4_mark_inode_dirty(handle, dir);
|
||||||
ext4_handle_dirty_metadata(handle, dir, frame->bh);
|
|
||||||
ext4_handle_dirty_metadata(handle, dir, bh);
|
|
||||||
dx_release(frames);
|
dx_release(frames);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue