[LTP] [PATCH v3 3/5] fanotify: Introduce SAFE_FANOTIFY_MARK() macro

Petr Vorel
2020-11-25T14:16:24Z

Hi Amir,

> > > +++ b/testcases/kernel/syscalls/fanotify/fanotify01.c
> > > @@ -101,19 +101,8 @@ static void test_fanotify(unsigned int n)
> > > "failed", tc->init_flags);
> > > }

> > > - if (fanotify_mark(fd_notify, FAN_MARK_ADD | mark->flag,
> > > - FAN_ACCESS | FAN_MODIFY | FAN_CLOSE | FAN_OPEN,
> > > - AT_FDCWD, fname) < 0) {
> > > - if (errno == EINVAL && mark->flag == FAN_MARK_FILESYSTEM) {
> > > - tst_res(TCONF,
> > > - "FAN_MARK_FILESYSTEM not supported in kernel?");
> > > - return;
> > > - }

> > Here we had tst_res(TCONF, ...) followed by a return but we will can
> > tst_brk() after the change. I guess that we may skip part of the test on
> > older kernels with that change.

> That's not good. I missed that in my review.
> There are many tests where only the FAN_MARK_FILESYSTEM
> test cases are expected to result in TCONF, but the rest of the test
> cases should run.

I'm not sure if I understand you. Is my approach correct here?

Kind regards,
Petr

> In most of these tests the FAN_MARK_FILESYSTEM test cases are
> last because they were added later. This is not the case with fanotify01
> and fanotify15 and we do not want to reply on the ordering anyway.

> Thanks,
> Amir.