From 71f929e29c7d93b68071ed093e51893687f63a4a Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Wed, 15 Oct 2025 17:49:38 +0100 Subject: [PATCH] Add a TODO indicating the problems so far and what to try next (#45). --- src/pv/transfer.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 {