diff options
author | Josef Bacik <josef@toxicpanda.com> | 2018-07-19 10:49:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-05 09:18:37 +0200 |
commit | 685d7af55fcc6595aedce7bc91b1f5f25ff88301 (patch) | |
tree | 7f6bd609f2ffb6d47b091d800db44f45e0b92d30 | |
parent | 951461680e88afb347cfb1e53255cd1b50187e2e (diff) | |
download | linux-stable-685d7af55fcc6595aedce7bc91b1f5f25ff88301.tar.gz linux-stable-685d7af55fcc6595aedce7bc91b1f5f25ff88301.tar.bz2 linux-stable-685d7af55fcc6595aedce7bc91b1f5f25ff88301.zip |
btrfs: don't leak ret from do_chunk_alloc
commit 4559b0a71749c442d34f7cfb9e72c9e58db83948 upstream.
If we're trying to make a data reservation and we have to allocate a
data chunk we could leak ret == 1, as do_chunk_alloc() will return 1 if
it allocated a chunk. Since the end of the function is the success path
just return 0.
CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/btrfs/extent-tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 982a9d509817..493c7354ec0b 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4128,7 +4128,7 @@ commit_trans: data_sinfo->flags, bytes, 1); spin_unlock(&data_sinfo->lock); - return ret; + return 0; } /* |