diff options
author | Filipe David Borba Manana <fdmanana@gmail.com> | 2013-09-09 20:49:43 +0200 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-12 03:53:15 +0100 |
commit | e84cc14213e2c81ae5a2da341a9da0d58a1dbfad (patch) | |
tree | 52839177644fbec66a4b782392147cde76a36676 | |
parent | Btrfs: fix sync fs to actually wait for all data to be persisted (diff) | |
download | linux-e84cc14213e2c81ae5a2da341a9da0d58a1dbfad.tar.xz linux-e84cc14213e2c81ae5a2da341a9da0d58a1dbfad.zip |
Btrfs: don't leak block group on error
In extent-tree.c:btrfs_write_dirty_block_groups(), if the call to
write_one_cache_group() failed, we would return without putting
the block group first.
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>
-rw-r--r-- | fs/btrfs/extent-tree.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 55b537fcb81a..54ee542c705e 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3317,10 +3317,9 @@ again: last = cache->key.objectid + cache->key.offset; err = write_one_cache_group(trans, root, path, cache); + btrfs_put_block_group(cache); if (err) /* File system offline */ goto out; - - btrfs_put_block_group(cache); } while (1) { |