Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f334348 authored by Arne Jansen's avatar Arne Jansen Committed by Chris Mason
Browse files

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: default avatarArne Jansen <sensille@gmx.net>
Reviewed-by: default avatarJosef Bacik <josef@redhat.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent e65e1535
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3413,7 +3413,7 @@ static int reserve_metadata_bytes(struct btrfs_trans_handle *trans,
	 * 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;