Re: [PATCH v3 00/10] upload-pack: reduce lock contention when writing packfile data
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Mar 10, 2026, 20:56 UTC
- Message-ID
- <2116166d-1aa2-46e5-b912-6268ebbcad4f@kdbg.org>
- In-Reply-To
- <20260310-pks-upload-pack-write-contention-v3-0-8bc97aa3e267@pks.im>
Am 10.03.26 um 14:24 schrieb Patrick Steinhardt:
> compat/posix: introduce writev(3p) wrapper > wrapper: introduce writev(3p) wrappers
I looked at these two patches.
At first, I was thrown off by the early exits when bytes_written == 0. But I convinced myself that it makes sense:
- In the emulation, if the underlying write(2) does return 0, it makes sense to signal a partial successful write to the caller of writev. It's the best we can do when earlier blocks have already been written. A return value of 0 is strange and may be an indication of future problems, so let's just stop the work we are doing and let the upper layers deal with the problem.
- In writev_in_full we need to treat the case specially in order to guarantee forward progress. Treating it as ENOSPC is plucked out of thin air, I guess, but not unreasonable.
In conclusion, these patches look good.
-- Hannes