mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-16 17:23:55 +08:00
Btrfs: don't commit the transaction if we dont have enough pinned bytes
I noticed when running an enospc test that we would get stuck committing the transaction in check_data_space even though we truly didn't have enough space. So check to see if bytes_pinned is bigger than num_bytes, if it's not don't commit the transaction. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
This commit is contained in:
parent
3de85bb95c
commit
f2bb8f5cfb
@ -3089,6 +3089,13 @@ alloc:
|
||||
}
|
||||
goto again;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have less pinned bytes than we want to allocate then
|
||||
* don't bother committing the transaction, it won't help us.
|
||||
*/
|
||||
if (data_sinfo->bytes_pinned < bytes)
|
||||
committed = 1;
|
||||
spin_unlock(&data_sinfo->lock);
|
||||
|
||||
/* commit the current transaction and try again */
|
||||
|
Loading…
Reference in New Issue
Block a user