Skip to content

Commit

Permalink
ext4: release bs.bh before re-using in ext4_xattr_block_find()
Browse files Browse the repository at this point in the history
bs.bh was taken in previous ext4_xattr_block_find() call,
it should be released before re-using

Fixes: 7e01c8e ("ext3/4: fix uninitialized bs in ...")
Signed-off-by: Vasily Averin <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
Cc: [email protected] # 2.6.26
  • Loading branch information
vaverin authored and tytso committed Nov 7, 2018
1 parent ecaaf40 commit 45ae932
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/ext4/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2395,6 +2395,8 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
error = ext4_xattr_block_set(handle, inode, &i, &bs);
} else if (error == -ENOSPC) {
if (EXT4_I(inode)->i_file_acl && !bs.s.base) {
brelse(bs.bh);
bs.bh = NULL;
error = ext4_xattr_block_find(inode, &i, &bs);
if (error)
goto cleanup;
Expand Down

0 comments on commit 45ae932

Please sign in to comment.