From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v6 3/5] Add fchmodat2 fallback definition
Date: Mon, 5 Aug 2024 17:36:43 +0200 [thread overview]
Message-ID: <20240805153643.GA27762@pevik> (raw)
In-Reply-To: <8984a9e6-6b13-4e34-a709-3d45202f03ad@suse.com>
> On 8/2/24 13:30, Petr Vorel wrote:
> > Hi Andrea,
> > > Reviewed-by: Petr Vorel <pvorel@suse.cz>
> > > Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> > > ---
> > > include/lapi/stat.h | 16 ++++++++++++++++
> > > 1 file changed, 16 insertions(+)
> > > diff --git a/include/lapi/stat.h b/include/lapi/stat.h
> > > index 3606c9eb0..8e38ecfef 100644
> > > --- a/include/lapi/stat.h
> > > +++ b/include/lapi/stat.h
> > > @@ -229,4 +229,20 @@ static inline int statx(int dirfd, const char *pathname, unsigned int flags,
> > > # define STATX_ATTR_VERITY 0x00100000
> > > #endif
> > > +#define SAFE_FCHMODAT2(dfd, filename, mode, flags) \
> > > + safe_fchmodat2(__FILE__, __LINE__, (dfd), (filename), (mode), (flags))
> > > +
> > > +static inline int safe_fchmodat2(const char *file, const int lineno,
> > > + int dfd, const char *filename, mode_t mode, int flags)
> > > +{
> > > + int ret;
> > > +
> > > + ret = tst_syscall(__NR_fchmodat2, dfd, filename, mode, flags);
> > > + if (ret == -1)
> > > + tst_brk_(file, lineno, TBROK | TERRNO, "%s(%d,%s,%d,%d) error",
> > > + __func__, dfd, filename, mode, flags);
> > I'm sorry, I overlook that errno check is not needed. tst_syscall() does it
> > (see include/lapi/syscalls.h). Please remove it before merge.
> > With this:
> > Reviewed-by: Petr Vorel <pvorel@suse.cz>
> > Kind regards,
> > Petr
> As far as I see, tst_syscall() only handles ENOSYS and invalid syscalls, so
> it makes sense to handle TBROK | TERRNO inside the safe_* function.
Yes, I'm sorry, I was wrong. But in that case handling ret < -1 is missing.
I have sent a patch fixing this.
Kind regards,
Petr
> Andrea
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-08-05 15:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 10:59 [LTP] [PATCH v6 0/5] Add fchmodat2 testing suite Andrea Cervesato
2024-08-02 10:59 ` [LTP] [PATCH v6 1/5] Add SAFE_SYMLINKAT macro Andrea Cervesato
2024-08-02 11:31 ` Petr Vorel
2024-08-02 12:20 ` Andrea Cervesato via ltp
2024-08-02 10:59 ` [LTP] [PATCH v6 2/5] Add fchmodat2 syscalls definitions Andrea Cervesato
2024-08-02 10:59 ` [LTP] [PATCH v6 3/5] Add fchmodat2 fallback definition Andrea Cervesato
2024-08-02 11:30 ` Petr Vorel
2024-08-02 11:34 ` Andrea Cervesato via ltp
2024-08-05 15:36 ` Petr Vorel [this message]
2024-08-02 10:59 ` [LTP] [PATCH v6 4/5] Add fchmodat2_01 test Andrea Cervesato
2024-08-02 11:35 ` Petr Vorel
2024-08-02 10:59 ` [LTP] [PATCH v6 5/5] Add fchmodat2_02 test Andrea Cervesato
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=20240805153643.GA27762@pevik \
--to=pvorel@suse.cz \
--cc=andrea.cervesato@suse.com \
--cc=ltp@lists.linux.it \
/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