Commit e755d9ab authored by Chris Mason's avatar Chris Mason

Btrfs: deal with NULL srv_rsv in the delalloc inode reservation code

btrfs_update_inode is sometimes called with a null reservation.
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent ad19db71
...@@ -640,8 +640,8 @@ static int btrfs_delayed_inode_reserve_metadata( ...@@ -640,8 +640,8 @@ static int btrfs_delayed_inode_reserve_metadata(
* Now if src_rsv == delalloc_block_rsv we'll let it just steal since * Now if src_rsv == delalloc_block_rsv we'll let it just steal since
* we're accounted for. * we're accounted for.
*/ */
if (!trans->bytes_reserved && if (!src_rsv || (!trans->bytes_reserved &&
src_rsv != &root->fs_info->delalloc_block_rsv) { src_rsv != &root->fs_info->delalloc_block_rsv)) {
ret = btrfs_block_rsv_add_noflush(root, dst_rsv, num_bytes); ret = btrfs_block_rsv_add_noflush(root, dst_rsv, num_bytes);
/* /*
* Since we're under a transaction reserve_metadata_bytes could * Since we're under a transaction reserve_metadata_bytes could
......
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