Re: [PATCH v3] selftests/mm: ksm-functional-tests: fix partial write handling
From: Andrew Morton
Date: Sun May 03 2026 - 09:23:21 EST
On Sun, 3 May 2026 15:38:40 +0530 Vineet Agarwal <agarwal.vineet2006@xxxxxxxxx> wrote:
> Update write() checks to properly detect and handle partial writes.
>
> Previously, partial writes (ret > 0 && ret != len) could be treated
> as success because write() does not set errno in this case and the
> code returned -errno. This could result in returning 0 and
> incorrectly signaling success.
>
> Fix this by verifying that write() returns the full expected length
> and treating any mismatch as failure.
Thanks. AI review asked some questions:
https://sashiko.dev/#/patchset/20260503101229.654763-1-agarwal.vineet2006@xxxxxxxxx