diff --git a/src/pv/transfer.c b/src/pv/transfer.c index f487335..d2af274 100644 --- a/src/pv/transfer.c +++ b/src/pv/transfer.c @@ -710,6 +710,19 @@ static int pv__transfer_write(pvstate_t state, bool *eof_in, bool *eof_out, long debug("%s: %s", "output lseek() failed", strerror(errno)); state->transfer.output_not_seekable = true; } else if (0 != ftruncate(state->control.output_fd, output_offset)) { + /* TODO: don't ftruncate() immediately. */ + /* + * On XFS filesystems it looks like + * this can actually make a sparse + * file take up more space than a + * regular file, though it's not + * obvious yet whether the + * ftruncate() is causing it or just + * the lseek(). + * + * Maybe just ftruncate() at the end + * of the program. + */ debug("%s: %s", "output ftruncate() failed", strerror(errno)); state->transfer.output_not_seekable = true; } else {