Commit efa760eb authored by Allison Henderson's avatar Allison Henderson Committed by Willy Tarreau

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: default avatarAllison Henderson <achender@us.ibm.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
(cherry picked from commit 6976a6f2)
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent 04b72780
......@@ -1457,6 +1457,10 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
frame->at = entries;
frame->bh = bh;
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);
if (!de) {
/*
......@@ -1465,8 +1469,6 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
* with corrupted filesystem.
*/
ext4_mark_inode_dirty(handle, dir);
ext4_handle_dirty_metadata(handle, dir, frame->bh);
ext4_handle_dirty_metadata(handle, dir, bh);
dx_release(frames);
return retval;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment