[LTP] safe_macros: Add SAFE_READ_ANY_EAGAIN
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Mon May 25 19:10:49 CEST 2026
Hi Cyril,
On Mon, 25 May 2026 17:14:48 +0200, Cyril Hrubis wrote:
--- [PATCH 1/2] safe_macros: Add SAFE_READ_ANY_EAGAIN ---
> Similarily to the safe_write() this turns the len_strict into three way
> switch with the new value SAFE_READ_ANY_EAGAIN=2 that turns EAGAIN into
> a read with a zero lenght.
s/Similarily/Similarly/, s/lenght/length/
> +enum safe_read_opts {
> + /* no lenght strictness, short reads are ok */
> + SAFE_READ_ANY = 0,
> + /* strict lenght, short reads trigger TBROK */
> + SAFE_READ_ALL = 1,
> + /* converts EAGAIN to read that returns 0 */
> + SAFE_READ_ANY_EAGAIN = 2,
> +};
Three issues here:
1. "lenght" → "length" in both comments.
2. Missing blank lines between members — safe_write_opts separates each
member with a blank line; this enum should follow the same style.
3. The double blank line before the enum (one was already there) — drop
the extra one.
> +enum safe_read_opts {
> ...
> +};
The safe_read() declaration and definition still take `char len_strict`
instead of `enum safe_read_opts len_strict`. safe_write() was updated to
use `enum safe_write_opts` — do the same here for consistency:
ssize_t safe_read(const char *file, const int lineno,
void (*cleanup_fn)(void), enum safe_read_opts len_strict,
int fildes, void *buf, size_t nbyte);
[...]
--- [PATCH 2/2] syscalls/inotify{07, 08}: Fix TBROK on older kernels ---
> When kernel fails to generate events the read returns EAGAIN and since
> we switches to SAFE_READ() the tests now TBROK when kernel does not
s/we switches/we switched/
[...]
Summary: please fix the typos in the commit messages and enum comments,
add blank lines between enum members to match safe_write_opts style,
drop the extra blank line, and update the safe_read() signature to take
enum safe_read_opts.
---
Note:
Our agent completed the review of the patch. The full review can be
found at: https://github.com/linux-test-project/ltp/actions
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list