[LTP] [PATCH 3/4] syscalls/fanotify15: Add a test case for inode marks
Amir Goldstein
amir73il@gmail.com
Sat May 2 15:17:07 CEST 2020
On Sat, May 2, 2020 at 10:10 AM Matthew Bobrowski
<mbobrowski@mbobrowski.org> wrote:
>
> On Tue, Apr 21, 2020 at 09:50:01AM +0300, Amir Goldstein wrote:
> > + tst_res(TINFO,
> > + "Test #%d: FAN_REPORT_FID with mark type: %s",
> > + number, mark->name);
> >
> > - if (fanotify_mark(fanotify_fd, FAN_MARK_ADD | FAN_MARK_FILESYSTEM,
> > +
>
> A nit, but there's an unnecessary extra whiteline here.
>
> > + if (fanotify_mark(fanotify_fd, FAN_MARK_ADD | mark->flag, tc->mask |
> > FAN_CREATE | FAN_DELETE | FAN_MOVE |
> > - FAN_MODIFY | FAN_DELETE_SELF | FAN_ONDIR,
> > + FAN_MODIFY | FAN_ONDIR,
> > AT_FDCWD, TEST_DIR) == -1) {
> > if (errno == ENODEV)
> > tst_brk(TCONF,
> > "FAN_REPORT_FID not supported on %s "
> > "filesystem", tst_device->fs_type);
> > tst_brk(TBROK | TERRNO,
> > - "fanotify_mark(%d, FAN_MARK_ADD | FAN_MARK_FILESYSTEM, "
> > + "fanotify_mark(%d, FAN_MARK_ADD | %s, "
> > "FAN_CREATE | FAN_DELETE | FAN_MOVE | "
> > - "FAN_MODIFY | FAN_DELETE_SELF | FAN_ONDIR, "
> > + "FAN_MODIFY | FAN_ONDIR, "
> > "AT_FDCWD, %s) failed",
> > - fanotify_fd, TEST_DIR);
> > + fanotify_fd, mark->name, TEST_DIR);
>
> I see that you've removed the FAN_DELETE_SELF mask here, although
> should we consider adding tc->mask here too for the sake of
> correctness?
Sure, I added " | 0x%x" for the extra tc->mask and also
enhanced the TINFO in the beginning of the test case to disaply
more explicit text like this:
"FAN_REPORT_FID on filesystem including FAN_DELETE_SELF",
"FAN_REPORT_FID on directory with FAN_EVENT_ON_CHILD",
Thanks,
Amir.
More information about the ltp
mailing list