Re: [PATCH v3 00/10] upload-pack: reduce lock contention when writing packfile data
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Mar 11, 2026, 06:27 UTC
- Message-ID
- <abELa6EfYexb06Wu@pks.im>
- In-Reply-To
- <2116166d-1aa2-46e5-b912-6268ebbcad4f@kdbg.org>
On Tue, Mar 10, 2026 at 09:56:14PM +0100, Johannes Sixt wrote:
Show 19 quoted lines
> 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.
This part is basically copied from `write_in_full()`, which does the same.
> In conclusion, these patches look good.
Thanks!
Patrick