syscalls/file_attr01: Fix EOPNOTSUPP expectation on tmpfs
PATCH 1/1 syscalls/file_attr01: Fix EOPNOTSUPP expectation on tmpfs
The test was expecting EOPNOTSUPP when ufattr is NULL on tmpfs without xattr support. However, file_setattr() always copy structure from userspace early (via copy_struct_from_user) and returns EFAULT if the pointer is invalid, before checking filesystem xattr support.
Therefore, the EOPNOTSUPP exception is only valid for file_getattr() which does not read from ufattr early.
Restrict the EOPNOTSUPP expectation to file_getattr() (tst_variant != 0) to avoid false failures on file_setattr().
--- testcases/kernel/syscalls/file_attr/file_attr01.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/file_attr/file_attr01.c +1 -1
@@ -119,7 +119,7 @@ static void run(unsigned int i)struct tcase *tc = &tcases[i];int exp_errno = tc->exp_errno; -if (tc->ufattr == (struct file_attr **)(&null_ptr) && missing_tmpfs_xattr) +if (tc->ufattr == (struct file_attr **)(&null_ptr) && missing_tmpfs_xattr && tst_variant) exp_errno =EOPNOTSUPP ;if (tst_variant) {
Signature · 5 lines
2.55.0.654.g21b8a5bc05-goog -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Wake,
Quoted 1 line · Wake Liu
syscalls/file_attr01: Fix EOPNOTSUPP expectation on tmpfs
Verdict - Reviewed
---
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
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Wake,
where did you see this error? can you pleae provide more information?
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Andrea Cervesato via ltp
AppliedMerged, Thanks!
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp