diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/inode.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 4bbceb928aff..f1c4bceed072 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -3327,7 +3327,7 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size) | |||
3327 | u64 hint_byte = 0; | 3327 | u64 hint_byte = 0; |
3328 | hole_size = last_byte - cur_offset; | 3328 | hole_size = last_byte - cur_offset; |
3329 | 3329 | ||
3330 | trans = btrfs_start_transaction(root, 2); | 3330 | trans = btrfs_start_transaction(root, 3); |
3331 | if (IS_ERR(trans)) { | 3331 | if (IS_ERR(trans)) { |
3332 | err = PTR_ERR(trans); | 3332 | err = PTR_ERR(trans); |
3333 | break; | 3333 | break; |
@@ -3337,6 +3337,7 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size) | |||
3337 | cur_offset + hole_size, | 3337 | cur_offset + hole_size, |
3338 | &hint_byte, 1); | 3338 | &hint_byte, 1); |
3339 | if (err) { | 3339 | if (err) { |
3340 | btrfs_update_inode(trans, root, inode); | ||
3340 | btrfs_end_transaction(trans, root); | 3341 | btrfs_end_transaction(trans, root); |
3341 | break; | 3342 | break; |
3342 | } | 3343 | } |
@@ -3346,6 +3347,7 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size) | |||
3346 | 0, hole_size, 0, hole_size, | 3347 | 0, hole_size, 0, hole_size, |
3347 | 0, 0, 0); | 3348 | 0, 0, 0); |
3348 | if (err) { | 3349 | if (err) { |
3350 | btrfs_update_inode(trans, root, inode); | ||
3349 | btrfs_end_transaction(trans, root); | 3351 | btrfs_end_transaction(trans, root); |
3350 | break; | 3352 | break; |
3351 | } | 3353 | } |
@@ -3353,6 +3355,7 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size) | |||
3353 | btrfs_drop_extent_cache(inode, hole_start, | 3355 | btrfs_drop_extent_cache(inode, hole_start, |
3354 | last_byte - 1, 0); | 3356 | last_byte - 1, 0); |
3355 | 3357 | ||
3358 | btrfs_update_inode(trans, root, inode); | ||
3356 | btrfs_end_transaction(trans, root); | 3359 | btrfs_end_transaction(trans, root); |
3357 | } | 3360 | } |
3358 | free_extent_map(em); | 3361 | free_extent_map(em); |