diff options
| author | Maurizio Lombardi <mlombard@redhat.com> | 2020-11-13 11:44:40 +0100 |
|---|---|---|
| committer | Maurizio Lombardi <mlombard@redhat.com> | 2020-11-23 19:02:58 +0100 |
| commit | 3176671662bda79d4b4059b8cc22b4b31a6547e0 (patch) | |
| tree | ba2aa1430298d0e86488fb09c673fa1c440b8fb1 /systemd | |
| parent | 2c3eccac082a2980aaed371a1fdf0efc6a49dd59 (diff) | |
| download | targetcli-3176671662bda79d4b4059b8cc22b4b31a6547e0.tar.gz | |
fileio backstore: fix sparse file creation
fallocate() can't be used to create sparse files because it
actually preallocates all the disk space that will be used by the file
backstore, sparse files do not have preallocated disk space
by definition.
We must therefore use ftruncate().
We can, on the other hand, use fallocate() to create non-sparse
files and fall back to the slower "while() fwrite()" if we
are running on Python version < 3.3 where fallocate() is not available
Fixes 3bd4d8ef7c9b154c53e8b8dd863a570bce7f5c2c
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Diffstat (limited to 'systemd')
0 files changed, 0 insertions, 0 deletions
