>From 59729e0ab18a763ba36616a1025ce606a8721f1c Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 9 May 2011 16:39:34 +0200 Subject: [PATCH] ext4: Stop releasing passed bh in do_split() make_indexed_dir() needs to do error recovery on the passed bh when do_split() fails. So do not release it early in do_split(). Signed-off-by: Jan Kara --- fs/ext4/namei.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 3c7a06e..1cddab9 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1165,11 +1165,8 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, int err = 0, i; bh2 = ext4_append (handle, dir, &newblock, &err); - if (!(bh2)) { - brelse(*bh); - *bh = NULL; + if (!bh2) goto errout; - } BUFFER_TRACE(*bh, "get_write_access"); err = ext4_journal_get_write_access(handle, *bh); @@ -1235,9 +1232,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, return de; journal_error: - brelse(*bh); brelse(bh2); - *bh = NULL; ext4_std_error(dir->i_sb, err); errout: *error = err; -- 1.7.1