diff options
author | Filipe David Borba Manana <fdmanana@gmail.com> | 2013-10-12 15:32:59 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-11 22:01:27 -0500 |
commit | 3c77bd94ecb4ad2653d1e3eb22295018533a1e21 (patch) | |
tree | d915ce71692d350dfee6203f9152ae01ed853bee /fs | |
parent | 361c093d7f99c3f6cbb07d5c580ce778ab418c42 (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/delayed-inode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index cbd9523ad09c..df1a496bc8d4 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c | |||
@@ -1174,8 +1174,10 @@ int btrfs_commit_inode_delayed_items(struct btrfs_trans_handle *trans, | |||
1174 | mutex_unlock(&delayed_node->mutex); | 1174 | mutex_unlock(&delayed_node->mutex); |
1175 | 1175 | ||
1176 | path = btrfs_alloc_path(); | 1176 | path = btrfs_alloc_path(); |
1177 | if (!path) | 1177 | if (!path) { |
1178 | btrfs_release_delayed_node(delayed_node); | ||
1178 | return -ENOMEM; | 1179 | return -ENOMEM; |
1180 | } | ||
1179 | path->leave_spinning = 1; | 1181 | path->leave_spinning = 1; |
1180 | 1182 | ||
1181 | block_rsv = trans->block_rsv; | 1183 | block_rsv = trans->block_rsv; |