[LTP] syscalls/unlink09: report unsupported inode flags as TCONF
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Tue Jun 2 13:23:45 CEST 2026
Hi XiaoLei Wu,
On Tue, Jun 2, 2026 at 14:14:41 +0800, XiaoLei Wu wrote:
> syscalls/unlink09: report unsupported inode flags as TCONF
>
> If FS_IOC_GETFLAGS fails with ENOTTY, the filesystem does not support
> inode flags. This is an unsupported test configuration rather than a
> broken test setup, so report TCONF instead of TBROK.
The change is correct. ENOTTY from FS_IOC_GETFLAGS means the kernel/
filesystem does not implement the ioctl at all, which is definitionally
an unsupported test configuration, not a broken test environment. TCONF
is the right result code.
Commit message is accurate and well-structured.
> diff --git a/testcases/kernel/syscalls/unlink/unlink09.c b/testcases/kernel/syscalls/unlink/unlink09.c
> @@ -63,7 +63,7 @@ static void setup(void)
> if (TST_RET == -1 && TST_ERR == ENOTTY) {
> SAFE_CLOSE(fd_immutable);
>
> - tst_brk(TBROK, "Inode attributes not supported by '%s'",
> + tst_brk(TCONF, "Inode attributes not supported by '%s'",
> tst_device->fs_type);
> }
LGTM. When FS_IOC_GETFLAGS returns ENOTTY the filesystem does not
support inode attribute flags; the test cannot run on such a
filesystem so TCONF is correct.
---
Pre-existing issues (informational, do not affect verdict):
In setup(), after SAFE_CLOSE(fd_immutable), fd_immutable still holds
its non-(-1) value when tst_brk() is called. Because tst_brk() invokes
cleanup(), and cleanup() checks `if (fd_immutable != -1)`, it will call
setup_inode_flag() (which does FS_IOC_GETFLAGS+FS_IOC_SETFLAGS) and
SAFE_CLOSE() on an already-closed descriptor.
Fix:
SAFE_CLOSE(fd_immutable);
+ fd_immutable = -1;
tst_brk(TCONF, "Inode attributes not supported by '%s'",
tst_device->fs_type);
---
Reviewed-by: LTP AI Reviewer
LTP AI Reviewer
More information about the ltp
mailing list