On Mon 31 Aug 2020 04:01:27 PM CEST, Nir Soffer wrote: > If fallocate() is not supported, posix_fallocate() falls back to > inefficient allocation, writing one byte for every 4k bytes[1]. This is > very slow compared with writing zeros. In oVirt we measured ~400% > improvement in allocation time when replacing posix_fallocate() with > manually writing zeroes[2]. > > We also know that posix_fallocated() does not work well when using OFD > locks[3]. We don't know the reason yet for this issue yet. > > Change preallocate_falloc() to use fallocate() instead of > posix_falloate(), and fall back to full preallocation if not > supported.
> case PREALLOC_MODE_FALLOC: > result = preallocate_falloc(fd, current_length, offset, errp); > - goto out; > + if (result != -ENOTSUP) > + goto out; > + /* If fallocate() is not supported, fallback to full preallocation. > */ With the missing braces in this if statement, Reviewed-by: Alberto Garcia <be...@igalia.com> Berto