Re: [PATCH v6 4/6] selftests/mm/vm_util: robust write_file()
From: Andrew Morton
Date: Fri Mar 27 2026 - 02:05:02 EST
On Tue, 24 Mar 2026 09:33:14 +0800 Chunyu Hu <chuhu@xxxxxxxxxx> wrote:
> Add two more checks for buflen and numwritten. The buflen should be at
> least one, otherwise the 'buflen - 1' could underflow and cause trouble.
> The numwritten should be equal to 'buflen - 1'. The test will exit if
> any of these conditions aren't met.
>
> Additionally, add more print information when a write failure occurs or
> a truncated write happens, providing clearer diagnostics.
This one has no review and AI review did identify a kinda-bug. Maybe
nobody calls write_file() with buflen==1, but still worth addressing I
think.
https://sashiko.dev/#/patchset/20260324013316.2590422-1-chuhu%40redhat.com
Chunyu, could you please take a look?
Thanks.