lkml.org 
[lkml]   [2018]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 09/11] ext4: iloc.bh cleanup in add_new_gdb()
Date
iloc.bh was taken in ext4_reserve_inode_write() and released
in ext4_mark_iloc_dirty(). It should not be released 2nd time
in rollback after failed ext4_handle_dirty_metadata(gdb_bh)

Fixes b40971426a83 ("ext4: add error checking to calls to ...") # 2.6.38

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
fs/ext4/resize.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 85158e9de7c2..aedfd6a6fcd1 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -871,7 +871,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
err = ext4_handle_dirty_metadata(handle, NULL, gdb_bh);
if (unlikely(err)) {
ext4_std_error(sb, err);
- goto exit_inode;
+ goto exit_kfree;
}
brelse(dind);

@@ -891,8 +891,9 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
return err;

exit_inode:
- kvfree(n_group_desc);
brelse(iloc.bh);
+exit_kfree:
+ kvfree(n_group_desc);
exit_dind:
brelse(dind);
exit_bh:
--
2.17.1
\
 
 \ /
  Last update: 2018-10-30 22:59    [W:0.124 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site