]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: only reserve space in fallocate if we have to do a preallocate
authorJosef Bacik <josef@redhat.com>
Wed, 17 Aug 2011 14:19:52 +0000 (10:19 -0400)
committerJosef Bacik <josef@redhat.com>
Wed, 19 Oct 2011 19:12:36 +0000 (15:12 -0400)
commitf577ab03e2163e9cbbc68d4c4248d96797c70be0
treeefdff83971345340faaf57823c0316962445a458
parentac66a7c8db26108735af62da88ed8246b8cd99ba
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: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Josef Bacik <josef@redhat.com>
fs/btrfs/file.c