[LTP] syscalls/statx13: Add basic test for STATX_WRITE_ATOMIC on regular file

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Tue Oct 13 13:27:15 CEST 2026


Hi Gaurav,

On 12 Oct 2026, Gaurav Pathak wrote:
> syscalls/statx13: Add basic test for STATX_WRITE_ATOMIC on regular file

> #if HAVE_STRUCT_STATX_STX_ATOMIC_WRITE_UNIT_MIN
>
> #if HAVE_STRUCT_STATX_STX_ATOMIC_WRITE_UNIT_MAX_OPT

High: These probes inspect libc's struct statx, but buff.data is the
unconditionally extended statx_fallback. With glibc 2.39, a valid atomic
write response yields two TCONF results and no limit checks. Remove both
HAVE_* guards and the new, unnecessary configure probes; detect support
at runtime.

> 	if (!(buff.data.stx_attributes & STATX_ATTR_WRITE_ATOMIC))
> 		tst_brk(TCONF, "Filesystem does not support STATX_WRITE_ATOMIC");

Medium: Valid-looking limits pass even with stx_mask and
stx_attributes_mask both zero, while nonzero advertised limits with a
missing active attribute produce only TCONF. Validate both masks before
interpreting the fields, and report inconsistent advertised support as
TFAIL rather than skipping it.

> 	TST_EXP_PASS_SILENT(SAFE_STATX(AT_FDCWD, TESTFILE, 0, STATX_BASIC_STATS | STATX_WRITE_ATOMIC, &buff));

Medium: SAFE_STATX aborts with TBROK before the expectation can classify
a syscall failure; returning -1/EIO reproduces this. Since statx is the
syscall under test, call statx(..., &buff.buff) directly inside
TST_EXP_PASS_SILENT.

> 	struct ltp_statx buff;

Low: Allocate the tested syscall output through .bufs using a static
struct ltp_statx pointer and .size = sizeof(*buff), rather than a stack
struct, as required for new LTP tests.

>  * It ensures that supported filesystems (xfs and nfs) correctly report their
>  * atomic write limits to user space when queried via statx().

Low: The filesystem array tests xfs and ext4, not nfs. Describe the
actual coverage using :manpage:`statx(2)`, and document that root is
required to format and mount the test device.

Verdict - Needs revision

---
Note:

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