Linux Test Project
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: linuxtestproject.agent@gmail.com
Cc: ltp@lists.linux.it
Subject: Re: [LTP] fs/acl: Add ACL_USER_OBJ permission test
Date: Mon, 15 Jun 2026 09:04:05 +0000	[thread overview]
Message-ID: <6a2fc007.05603459.3d8ad6.7d03@mx.google.com> (raw)
In-Reply-To: <20260615083322.4126-1-linuxtestproject.agent@gmail.com>

Hi Sachin,

> 
> The errno check for EOPNOTSUPP happens after acl_free() and
> cleanup_testfile(). cleanup_testfile() calls unlink() internally,
> and POSIX does not guarantee that errno is preserved after a
> successful syscall. If unlink() clobbers errno, the EOPNOTSUPP
> check silently fails and the test reports TBROK instead of TCONF.
> 
> test_chmod_acl() in the same file checks errno first:
> 
>     if (acl_set_file(...) < 0) {
>         if (errno == EOPNOTSUPP) {
>             acl_free(acl);
>             cleanup_testfile();
>             tst_brk(TCONF | TERRNO, ...);
>         }
>         acl_free(acl);
>         cleanup_testfile();
>         tst_brk(TBROK | TERRNO, ...);
>     }
> 
> Could test_chown_acl() use the same pattern?

This is correct, but it's also true that TERRNO is printing
errno with its description, so the example is wrong. If any
syscall after acl_set_file() will fail, we will print the errno
of rmdir() or unlink().

You need to save the errno using TEST().

Also, please don't define SAFE_* macros inside the tests, their
are part of the core library and they should not be defined out
of it. Instead, use inline functions.

Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-06-15  9:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-15  7:25 [LTP] [PATCH v10 0/8] Convert shell-based ACL test (tacl_xattr.sh) to C Sachin Sant
2026-06-15  7:25 ` [LTP] [PATCH v10 1/8] fs/acl: Add ACL_USER_OBJ permission test Sachin Sant
2026-06-15  8:33   ` [LTP] " linuxtestproject.agent
2026-06-15  9:04     ` Andrea Cervesato via ltp [this message]
2026-06-15  9:29       ` Andrea Cervesato via ltp
2026-06-15 11:25       ` Sachin Sant
2026-06-15 12:07         ` Andrea Cervesato via ltp
2026-06-15  7:25 ` [LTP] [PATCH v10 2/8] fs/acl: Add ACL mask interaction tests Sachin Sant
2026-06-15  7:25 ` [LTP] [PATCH v10 3/8] fs/acl: Add ACL_OTHER permission test Sachin Sant
2026-06-15  7:25 ` [LTP] [PATCH v10 4/8] fs/acl: Add default ACL inheritance test Sachin Sant
2026-06-15  7:25 ` [LTP] [PATCH v10 5/8] fs/acl: Add chmod/chown ACL interaction tests Sachin Sant
2026-06-15  7:25 ` [LTP] [PATCH v10 6/8] fs/acl: Add ACL symlink operations test Sachin Sant
2026-06-15  7:25 ` [LTP] [PATCH v10 7/8] fs/acl: Add extended attributes test Sachin Sant
2026-06-15  7:25 ` [LTP] [PATCH v10 8/8] fs/acl: Remove old shell-based ACL test Sachin Sant
  -- strict thread matches above, loose matches on Subject: below --
2026-06-16  4:54 [LTP] [PATCH v12 1/8] fs/acl: Add ACL_USER_OBJ permission test Sachin Sant
2026-06-16  8:39 ` [LTP] " linuxtestproject.agent
2026-06-15 15:15 [LTP] [PATCH v11 1/8] " Sachin Sant
2026-06-15 18:35 ` [LTP] " linuxtestproject.agent
2026-06-15  5:29 [LTP] [PATCH v9 1/8] " Sachin Sant
2026-06-15  6:32 ` [LTP] " linuxtestproject.agent
2026-06-13  9:05 [LTP] [PATCH v8 1/8] " Sachin Sant
2026-06-13 10:36 ` [LTP] " linuxtestproject.agent
2026-06-12 17:19 [LTP] [PATCH v7 1/8] " Sachin Sant
2026-06-12 19:13 ` [LTP] " linuxtestproject.agent
2026-06-12 10:24 [LTP] [PATCH v6 1/8] " Sachin Sant
2026-06-12 12:27 ` [LTP] " linuxtestproject.agent
2026-06-08  9:21 [LTP] [PATCH v5 1/8] " Sachin Sant
2026-06-08 11:01 ` [LTP] " linuxtestproject.agent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a2fc007.05603459.3d8ad6.7d03@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=linuxtestproject.agent@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox