Skip to content
Commit 1b9c332b authored by Josef Bacik's avatar Josef Bacik
Browse files

Btrfs: only reserve space in fallocate if we have to do a preallocate



Lukas found a problem where if he tries to fallocate over the same region twice
and the first fallocate took up all the space we would fail with ENOSPC.  This
is because we reserve the total space we want to use for fallocate, regardless
of wether or not we will have to actually preallocate.  So instead move the
check into the loop where we actually have to do the preallocate.  Thanks,

Tested-by: default avatarLukas Czerner <lczerner@redhat.com>
Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
parent 5e962c78
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment