Commit 5b397377 authored by Miao Xie's avatar Miao Xie Committed by Chris Mason

Btrfs: fix unclosed transaction handle in btrfs_cont_expand

The function - btrfs_cont_expand() forgot to close the transaction handle before
it jump out the while loop. Fix it.
Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 98c9942a
...@@ -3510,15 +3510,19 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size) ...@@ -3510,15 +3510,19 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size)
err = btrfs_drop_extents(trans, inode, cur_offset, err = btrfs_drop_extents(trans, inode, cur_offset,
cur_offset + hole_size, cur_offset + hole_size,
&hint_byte, 1); &hint_byte, 1);
if (err) if (err) {
btrfs_end_transaction(trans, root);
break; break;
}
err = btrfs_insert_file_extent(trans, root, err = btrfs_insert_file_extent(trans, root,
btrfs_ino(inode), cur_offset, 0, btrfs_ino(inode), cur_offset, 0,
0, hole_size, 0, hole_size, 0, hole_size, 0, hole_size,
0, 0, 0); 0, 0, 0);
if (err) if (err) {
btrfs_end_transaction(trans, root);
break; break;
}
btrfs_drop_extent_cache(inode, hole_start, btrfs_drop_extent_cache(inode, hole_start,
last_byte - 1, 0); last_byte - 1, 0);
......
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