Btrfs: don't leak delayed node on path allocation failure

If the path allocation failed, we would return without decrementing
the reference count in the delayed node we got before, resulting
in a leak.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
Filipe David Borba Manana 2013-10-12 20:32:59 +01:00 committed by Chris Mason
parent 361c093d7f
commit 3c77bd94ec
1 changed files with 3 additions and 1 deletions

View File

@ -1174,8 +1174,10 @@ int btrfs_commit_inode_delayed_items(struct btrfs_trans_handle *trans,
mutex_unlock(&delayed_node->mutex);
path = btrfs_alloc_path();
if (!path)
if (!path) {
btrfs_release_delayed_node(delayed_node);
return -ENOMEM;
}
path->leave_spinning = 1;
block_rsv = trans->block_rsv;