diff options
author | Josef Bacik <josef@toxicpanda.com> | 2018-07-19 17:49:51 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-05 10:16:22 +0300 |
commit | 8e46b7744059f62258fe07574e22070371b09071 (patch) | |
tree | c541707b975883fbc16836707d1cb371d00ed991 /fs/btrfs | |
parent | 4c41a07aeead2a0808b245f36ecc8db9af7cd6a8 (diff) | |
download | linux-8e46b7744059f62258fe07574e22070371b09071.tar.xz |
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>
Diffstat (limited to 'fs/btrfs')
-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 3f5fc150c2b7..b2937b645b62 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4281,7 +4281,7 @@ static int flush_space(struct btrfs_root *root, break; } - return ret; + return 0; } static inline u64 |