On 1/22/24 1:12 PM, Gabriel Krisman Bertazi wrote: > Tony Solomonik <tony.solomonik@xxxxxxxxx> writes: > >> Libraries that are built on io_uring currently need to maintain a >> separate thread pool implementation when they want to truncate a file. > > I don't think it makes sense to have both ftruncate and truncate in > io_uring. One can just as easily link an open+ftruncate to have the > same semantics in one go. Yeah, see comment on the life time issue with this one as well, which is avoided with the fd variant. So if just having the ftruncate variant is good enough, that's solve that headache too. And if done like I suggested where fd must be valid and we -EINVAL on sqe->addr being set, you could always add truncate by path functionality later on top without requiring a new opcode just for that. -- Jens Axboe