From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v5 06/10] fanotify: Add helper for mark support check
Date: Wed, 2 Dec 2020 18:05:08 +0100 [thread overview]
Message-ID: <X8fJRNgQ0n4nB4lH@pevik> (raw)
In-Reply-To: <CAOQ4uxg_Kwmx1K=om9aA6Sh=+L129=YpneDW1ZLP2sL96ELNgw@mail.gmail.com>
Hi Amir, Cyril,
> On Tue, Dec 1, 2020 at 7:42 PM Petr Vorel <pvorel@suse.cz> wrote:
> > i.e. FAN_MARK_FILESYSTEM and use it in relevant tests setup().
> > The purpose is to reduce checks (cleanup).
> > NOTE: all tests check only for FAN_MARK_FILESYSTEM, but keep helper
> > generic for future use.
> > Suggested-by: Amir Goldstein <amir73il@gmail.com>
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > New in v5.
> > testcases/kernel/syscalls/fanotify/fanotify.h | 21 ++++++++++++++++
> > .../kernel/syscalls/fanotify/fanotify01.c | 12 +++++----
> > .../kernel/syscalls/fanotify/fanotify03.c | 25 +++++++++----------
> > .../kernel/syscalls/fanotify/fanotify10.c | 14 +++++------
> > .../kernel/syscalls/fanotify/fanotify13.c | 15 +++++------
> > 5 files changed, 55 insertions(+), 32 deletions(-)
> > diff --git a/testcases/kernel/syscalls/fanotify/fanotify.h b/testcases/kernel/syscalls/fanotify/fanotify.h
> > index 821e6cb29..2275a1da3 100644
> > --- a/testcases/kernel/syscalls/fanotify/fanotify.h
> > +++ b/testcases/kernel/syscalls/fanotify/fanotify.h
> > @@ -351,4 +351,25 @@ static inline void require_fanotify_fan_report_fid_supported_on_fs(const char *f
> > #define REQUIRE_FANOTIFY_FAN_REPORT_FID_SUPPORTED_ON_FS(fname) \
> > require_fanotify_fan_report_fid_supported_on_fs(__FILE__, __LINE__, (fname))
> > +static inline int fanotify_mark_supported_by_kernel(uint64_t flag)
> > +{
> > + int fd;
> > + int rval = 0;
> > +
> > + fd = SAFE_FANOTIFY_INIT(FAN_CLASS_CONTENT, O_RDONLY);
> > +
> > + if (fanotify_mark(fd, FAN_MARK_ADD | flag, FAN_ACCESS_PERM, AT_FDCWD, ".") < 0) {
> > + if (errno == EINVAL) {
> > + rval = -1;
> > + } else {
> > + tst_brk(TBROK | TERRNO,
> > + "fanotify_mark (%d, FAN_MARK_ADD, ..., FAN_ACCESS_PERM, AT_FDCWD, \".\") failed", fd);
> > + }
> You meant FAN_ACCESS.
> FAN_ACCESS_PERM requires CONFIG_FANOTIFY_ACCESS_PERMISSIONS which is not
> a requirement for most of the affected tests.
Thanks for explanation, I was thinking about it :).
> Patch set is super! it's the only issue I found, so I don't think you
> need to re-post for that.
Fixing this and Cyril notes in 04/10 and merging tonight.
Kind regards,
Petr
> Thanks,
> Amir.
next prev parent reply other threads:[~2020-12-02 17:05 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-01 17:42 [LTP] [PATCH v5 00/10] Introduce SAFE_FANOTIFY_MARK() macro + cleanup Petr Vorel
2020-12-01 17:42 ` [LTP] [PATCH v5 01/10] fanotify12: Drop incorrect hint Petr Vorel
2020-12-02 15:09 ` Cyril Hrubis
2020-12-01 17:42 ` [LTP] [PATCH v5 02/10] fanotify: Add helper for access permission check Petr Vorel
2020-12-02 15:24 ` Cyril Hrubis
2020-12-01 17:42 ` [LTP] [PATCH v5 03/10] fanotify: Add helper for event support check Petr Vorel
2020-12-02 15:36 ` Cyril Hrubis
2020-12-01 17:42 ` [LTP] [PATCH v5 04/10] fanotify: Add helper for FAN_REPORT_FID support on fs Petr Vorel
2020-12-02 15:46 ` Cyril Hrubis
2020-12-02 18:04 ` Petr Vorel
2020-12-04 10:11 ` Amir Goldstein
2020-12-04 13:47 ` Petr Vorel
2020-12-01 17:42 ` [LTP] [PATCH v5 05/10] fanotify16: Test also on FUSE Petr Vorel
2020-12-02 15:46 ` Cyril Hrubis
2020-12-01 17:42 ` [LTP] [PATCH v5 06/10] fanotify: Add helper for mark support check Petr Vorel
2020-12-02 6:27 ` Amir Goldstein
2020-12-02 15:57 ` Cyril Hrubis
2020-12-02 17:05 ` Petr Vorel [this message]
2020-12-02 15:53 ` Cyril Hrubis
2020-12-01 17:42 ` [LTP] [PATCH v5 07/10] fanotify: Introduce SAFE_FANOTIFY_MARK() macro Petr Vorel
2020-12-02 15:55 ` Cyril Hrubis
2020-12-02 15:58 ` Cyril Hrubis
2020-12-01 17:42 ` [LTP] [PATCH v5 08/10] fanotify: Use tst_brk_ in safe_fanotify_init() Petr Vorel
2020-12-02 15:55 ` Cyril Hrubis
2020-12-01 17:42 ` [LTP] [PATCH v5 09/10] fanotify: Add a pedantic check for return value Petr Vorel
2020-12-02 15:56 ` Cyril Hrubis
2020-12-01 17:42 ` [LTP] [PATCH] fanotify: Cleanup <sys/fanotify.h> use Petr Vorel
2020-12-02 16:12 ` Cyril Hrubis
2020-12-01 17:46 ` [LTP] [PATCH v5 00/10] Introduce SAFE_FANOTIFY_MARK() macro + cleanup Petr Vorel
2020-12-02 6:47 ` Amir Goldstein
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=X8fJRNgQ0n4nB4lH@pevik \
--to=pvorel@suse.cz \
--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