mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 18:12:25 -04:00
btrfs: initialize ret to -ENOSPC at __reserve_bytes()
At space-info.c:__reserve_bytes(), instead of initializing 'ret' to 0 when it's declared and then shortly after set it to -ENOSPC under the space info's spinlock, initialize it to -ENOSPC when declaring it. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
committed by
David Sterba
parent
9d0d47d5c3
commit
3a49a54894
@@ -1599,7 +1599,7 @@ static int __reserve_bytes(struct btrfs_fs_info *fs_info,
|
||||
struct reserve_ticket ticket;
|
||||
u64 start_ns = 0;
|
||||
u64 used;
|
||||
int ret = 0;
|
||||
int ret = -ENOSPC;
|
||||
bool pending_tickets;
|
||||
|
||||
ASSERT(orig_bytes);
|
||||
@@ -1622,7 +1622,6 @@ static int __reserve_bytes(struct btrfs_fs_info *fs_info,
|
||||
async_work = &fs_info->async_reclaim_work;
|
||||
|
||||
spin_lock(&space_info->lock);
|
||||
ret = -ENOSPC;
|
||||
used = btrfs_space_info_used(space_info, true);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user