Skip to contentSkip to conversation

syscalls/fanotify10: Require kernel v4.19

PATCH New Petr Vorel 4 participants 8 messages Nov 6, 2018 – Nov 12, 2018 Stable branch

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 syscalls/fanotify10: Require kernel v4.19

FAN_MARK_INODE and FAN_MARK_MOUNT were added in v4.19-rc2:
d54f4fba889b fanotify: add API to attach/detach super block mark

Fixes 16f127f4a syscalls/fanotify10: new test for mount ignore mask
---
 testcases/kernel/syscalls/fanotify/fanotify10.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
testcases/kernel/syscalls/fanotify/fanotify10.c +2 -1
index 2b96de2f1..bfc60cf89 100644
@@ -298,7 +298,8 @@ static struct tst_test test = {
 	.mount_device = 1,
 	.mntpoint = MOUNT_PATH,
 	.needs_tmpdir = 1,
-	.needs_root = 1
+	.needs_root = 1,
+	.min_kver = "4.19",
 };
 
 #else
Signature · 1 line
2.19.1
#1 lore raw

PATCH 1/1 syscalls/fanotify10: Require kernel v4.19

Hi!

Quoted 4 lines

FAN_MARK_INODE and FAN_MARK_MOUNT were added in v4.19-rc2:
d54f4fba889b fanotify: add API to attach/detach super block mark

Fixes 16f127f4a syscalls/fanotify10: new test for mount ignore mask

I would slightly prefer handling whatever error we get from fanotify so that the test would also work in a case that the functionality would get backported to older kernel. But if that's not easily done we may as well go for the kernel version detection.

Quoted 22 lines
---
 testcases/kernel/syscalls/fanotify/fanotify10.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
testcases/kernel/syscalls/fanotify/fanotify10.c +2 -1
index 2b96de2f1..bfc60cf89 100644
@@ -298,7 +298,8 @@ static struct tst_test test = {
 	.mount_device = 1,
 	.mntpoint = MOUNT_PATH,
 	.needs_tmpdir = 1,
-	.needs_root = 1
+	.needs_root = 1,
+	.min_kver = "4.19",
 };
 
 #else
Signature · 1 line
2.19.1
Signature · 2 lines
Cyril Hrubis
[email protected]
author
#2 lore raw

PATCH 1/1 syscalls/fanotify10: Require kernel v4.19

Hi,

Quoted 9 lines
Quoted 4 lines

FAN_MARK_INODE and FAN_MARK_MOUNT were added in v4.19-rc2:
d54f4fba889b fanotify: add API to attach/detach super block mark

Fixes 16f127f4a syscalls/fanotify10: new test for mount ignore mask

I would slightly prefer handling whatever error we get from fanotify so that the test would also work in a case that the functionality would get backported to older kernel. But if that's not easily done we may as well go for the kernel version detection.

Make sense. Amir, any idea, how to do that?

Quoted 1 line

testcases/kernel/syscalls/fanotify/fanotify10.c static struct tst_test test = { · line 302

Quoted 1 line
testcases/kernel/syscalls/fanotify/fanotify10.c +1 -0
+	.min_kver = "4.19",

Kind regards,
Petr

#3 lore raw

PATCH 1/1 syscalls/fanotify10: Require kernel v4.19

Quoted 6 lines · Petr Vorel

Hi,

Quoted 2 lines
Quoted 2 lines

FAN_MARK_INODE and FAN_MARK_MOUNT were added in v4.19-rc2:
d54f4fba889b fanotify: add API to attach/detach super block mark

Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Fixes 16f127f4a syscalls/fanotify10: new test for mount ignore mask

I would slightly prefer handling whatever error we get from fanotify so that the test would also work in a case that the functionality would get backported to older kernel. But if that's not easily done we may as well go for the kernel version detection.

Make sense. Amir, any idea, how to do that?

There must be some confusion.
FAN_MARK_MOUNT was NOT added in v4.19-rc2.
It has been there from the start.
FAN_MARK_INODE was NOT added either
the define FAN_MARK_INODE 0 is just a convenience readability define it does not change the API.

You may be confusing with FAN_MARK_FILESYSTEM just was just added in kernel v4.20-rc1. The extension of tests to cover FAN_MARK_FILESYSTEM is waiting in my queue:
https://github.com/amir73il/ltp/commits/fanotify_sb

And it already includes runtime checks for FAN_MARK_FILESYSTEM support.

Did I miss anything?

Thanks,
Amir.

author
#4 lore raw

PATCH 1/1 syscalls/fanotify10: Require kernel v4.19

Hi Amir,

Quoted 6 lines

There must be some confusion.
FAN_MARK_MOUNT was NOT added in v4.19-rc2.
It has been there from the start.
FAN_MARK_INODE was NOT added either
the define FAN_MARK_INODE 0 is just a convenience readability define it does not change the API.

I'm sorry, you're right.

Quoted 10 lines

You may be confusing with FAN_MARK_FILESYSTEM just was just added in kernel v4.20-rc1. The extension of tests to cover FAN_MARK_FILESYSTEM is waiting in my queue:
https://github.com/amir73il/ltp/commits/fanotify_sb

And it already includes runtime checks for FAN_MARK_FILESYSTEM support.

Did I miss anything?

Testing your branch on older kernel, fanotify10 fails earlier than new TCONF checks:

tst_device.c:83: INFO: Found free device '/dev/loop0'
tst_mkfs.c:90: INFO: Formatting /dev/loop0 with ext2 opts='' extra opts=''
mke2fs 1.44.2 (14-May-2018)
tst_test.c:1085: INFO: Timeout per run is 0h 05m 00s
fanotify10.c:233: INFO: Test #0: ignore mount events created on a specific file fanotify10.c:221: PASS: group 0 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 1 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 2 got event: mask 20 pid=6942 fd=12
fanotify10.c:299: PASS: group 0 (prio 1) with FAN_MARK_MOUNT and FAN_MARK_INODE ignore mask got no event fanotify10.c:299: PASS: group 1 (prio 1) with FAN_MARK_MOUNT and FAN_MARK_INODE ignore mask got no event fanotify10.c:299: PASS: group 2 (prio 1) with FAN_MARK_MOUNT and FAN_MARK_INODE ignore mask got no event fanotify10.c:299: PASS: group 0 (prio 2) with FAN_MARK_MOUNT and FAN_MARK_INODE ignore mask got no event fanotify10.c:299: PASS: group 1 (prio 2) with FAN_MARK_MOUNT and FAN_MARK_INODE ignore mask got no event fanotify10.c:299: PASS: group 2 (prio 2) with FAN_MARK_MOUNT and FAN_MARK_INODE ignore mask got no event fanotify10.c:233: INFO: Test #1: don't ignore mount events created on another file fanotify10.c:221: PASS: group 0 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 1 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 2 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 0 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 1 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 2 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 0 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 1 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 2 got event: mask 20 pid=6942 fd=12
fanotify10.c:233: INFO: Test #2: ignore inode events created on a specific mount point fanotify10.c:221: PASS: group 0 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 1 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 2 got event: mask 20 pid=6942 fd=12
fanotify10.c:293: FAIL: group 0 (prio 1) with FAN_MARK_INODE and FAN_MARK_MOUNT ignore mask got event fanotify10.c:293: FAIL: group 1 (prio 1) with FAN_MARK_INODE and FAN_MARK_MOUNT ignore mask got event fanotify10.c:293: FAIL: group 2 (prio 1) with FAN_MARK_INODE and FAN_MARK_MOUNT ignore mask got event fanotify10.c:293: FAIL: group 0 (prio 2) with FAN_MARK_INODE and FAN_MARK_MOUNT ignore mask got event fanotify10.c:293: FAIL: group 1 (prio 2) with FAN_MARK_INODE and FAN_MARK_MOUNT ignore mask got event fanotify10.c:293: FAIL: group 2 (prio 2) with FAN_MARK_INODE and FAN_MARK_MOUNT ignore mask got event fanotify10.c:233: INFO: Test #3: don't ignore inode events created on another mount point fanotify10.c:221: PASS: group 0 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 1 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 2 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 0 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 1 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 2 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 0 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 1 got event: mask 20 pid=6942 fd=12
fanotify10.c:221: PASS: group 2 got event: mask 20 pid=6942 fd=12
fanotify10.c:233: INFO: Test #4: ignore fs events created on a specific file fanotify10.c:162: CONF: FAN_MARK_FILESYSTEM not supported in kernel?
fanotify10.c:233: INFO: Test #5: don't ignore mount events created on another file fanotify10.c:162: CONF: FAN_MARK_FILESYSTEM not supported in kernel?
fanotify10.c:233: INFO: Test #6: ignore fs events created on a specific mount point fanotify10.c:162: CONF: FAN_MARK_FILESYSTEM not supported in kernel?
fanotify10.c:233: INFO: Test #7: don't ignore fs events created on another mount point fanotify10.c:162: CONF: FAN_MARK_FILESYSTEM not supported in kernel?

Summary:

passed   30
failed   6
skipped  4

warnings 0

Kind regards,
Petr

#5 lore raw

PATCH 1/1 syscalls/fanotify10: Require kernel v4.19

Quoted 17 lines · Petr Vorel

Hi Amir,

Quoted 6 lines

There must be some confusion.
FAN_MARK_MOUNT was NOT added in v4.19-rc2.
It has been there from the start.
FAN_MARK_INODE was NOT added either
the define FAN_MARK_INODE 0 is just a convenience readability define it does not change the API.

I'm sorry, you're right.

Quoted 5 lines

You may be confusing with FAN_MARK_FILESYSTEM just was just added in kernel v4.20-rc1. The extension of tests to cover FAN_MARK_FILESYSTEM is waiting in my queue:
https://github.com/amir73il/ltp/commits/fanotify_sb

Quoted 5 lines
Quoted 4 lines

And it already includes runtime checks for FAN_MARK_FILESYSTEM support.

Did I miss anything?

Testing your branch on older kernel, fanotify10 fails earlier than new TCONF

Because fanotify10 checks for a bug that existed since the beginning and fixed by 9bdda4e9cf2d fsnotify: fix ignore mask logic in fsnotify(). So test SHOULD fail until the backported patch is applied to the old kernel.

The patch does not apply cleanly to kernels <= v4.17. Tested backport patch for v4.14.y attached.

Thanks,
Amir.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-backport-fsnotify-fix-ignore-mask-logic-in-fsnotify.patch
Type: text/x-patch
Size: 2236 bytes
Desc: not available
URL: <http://lists.linux.it/pipermail/ltp/attachments/20181106/2894ab23/attachment.bin>

maintainer Applied
#6 lore raw

PATCH 1/1 syscalls/fanotify10: Require kernel v4.19

Quoted 22 lines · Amir Goldstein
Quoted 21 lines · Petr Vorel

Hi Amir,

Quoted 6 lines

There must be some confusion.
FAN_MARK_MOUNT was NOT added in v4.19-rc2.
It has been there from the start.
FAN_MARK_INODE was NOT added either
the define FAN_MARK_INODE 0 is just a convenience readability define it does not change the API.

I'm sorry, you're right.

Quoted 10 lines

You may be confusing with FAN_MARK_FILESYSTEM just was just added in kernel v4.20-rc1. The extension of tests to cover FAN_MARK_FILESYSTEM is waiting in my queue:
https://github.com/amir73il/ltp/commits/fanotify_sb

And it already includes runtime checks for FAN_MARK_FILESYSTEM support.

Did I miss anything?

Quoted 8 lines
Quoted 1 line

Testing your branch on older kernel, fanotify10 fails earlier than new TCONF

Because fanotify10 checks for a bug that existed since the beginning and fixed by 9bdda4e9cf2d fsnotify: fix ignore mask logic in fsnotify(). So test SHOULD fail until the backported patch is applied to the old kernel.

The patch does not apply cleanly to kernels <= v4.17. Tested backport patch for v4.14.y attached.

Queued for 4.14, thanks Amir.

--
Thanks,
Sasha

author
#7 lore raw

PATCH 1/1 syscalls/fanotify10: Require kernel v4.19

In reply to Amir Goldstein

Hi Amir,

Quoted 9 lines
Quoted 2 lines
Quoted 1 line

Did I miss anything?

Testing your branch on older kernel, fanotify10 fails earlier than new TCONF

Because fanotify10 checks for a bug that existed since the beginning and fixed by 9bdda4e9cf2d fsnotify: fix ignore mask logic in fsnotify(). So test SHOULD fail until the backported patch is applied to the old kernel.

The patch does not apply cleanly to kernels <= v4.17. Tested backport patch for v4.14.y attached.

Thanks for info and Cc us for your patch in kernel.

Quoted 2 lines

Thanks,
Amir.

Kind regards,
Petr