diff options
| author | Chunyu Hu <chuhu@redhat.com> | 2026-04-02 09:45:41 +0800 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-04-18 00:10:54 -0700 |
| commit | a784a3a39cc58b45807083b6447fa13028fd47e7 (patch) | |
| tree | d47264cd242df186caacd25e0ba0286da99b7a2d /tools/perf/scripts/python/export-to-postgresql.py | |
| parent | 710d2f307945e892aaa147ae98232fafebe0be33 (diff) | |
selftests/mm/vm_util: robust write_file()
Add three more checks for buflen and numwritten. The buflen should be at
least two, that means at least one char and the null-end. The error case
check is added by checking numwriten < 0 instead of numwritten < 1. And
the truncate case is checked. 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.
Link: https://lore.kernel.org/20260402014543.1671131-5-chuhu@redhat.com
Signed-off-by: Chunyu Hu <chuhu@redhat.com>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Lorenzo Stoakes <ljs@kernel.org>
Cc: Nico Pache <npache@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions
