mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 18:13:04 +00:00
btrfs: Fix early enospc because 'unused' calculated with wrong sign.
'unused' calculated with wrong sign in reserve_metadata_bytes(). This might have lead to unwanted over-reservations. Signed-off-by: Arne Jansen <sensille@gmx.net> Reviewed-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
e65e153554
commit
6f33434850
@ -3413,7 +3413,7 @@ again:
|
||||
* our reservation.
|
||||
*/
|
||||
if (unused <= space_info->total_bytes) {
|
||||
unused -= space_info->total_bytes;
|
||||
unused = space_info->total_bytes - unused;
|
||||
if (unused >= num_bytes) {
|
||||
if (!reserved)
|
||||
space_info->bytes_reserved += orig_bytes;
|
||||
|
Loading…
Reference in New Issue
Block a user