fanotify01: fix test failure when running with nfs TMPDIR
PATCH 1/1 fanotify01: fix test failure when running with nfs TMPDIR
If TMPDIR does not support mount watches due to ENODEV, the failure to watch multiple fs would be EXDEV and not ENODEV.
Reported-by Rhythm Mahajan <[email protected]>
Signed-off-by Amir Goldstein <[email protected]>
--- testcases/kernel/syscalls/fanotify/fanotify01.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/fanotify/fanotify01.c +3 -2
@@ -375,8 +375,9 @@ static void setup(void) }if (fanotify_flags_supported_on_fs (FAN_REPORT_FID ,FAN_MARK_MOUNT ,FAN_OPEN ,"." )) { - inode_mark_fid_xdev = errno; -tst_res (TINFO ,"TMPDIR does not support reporting events with fid from multi fs" ); + inode_mark_fid_xdev = (errno ==ENODEV ) ?EXDEV : errno; +tst_res (TINFO ,"TMPDIR does not support reporting events with fid from multi fs" +" (errno = %d)" , errno); } }
Signature · 5 lines
2.34.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Amir,
Quoted 14 lines
If TMPDIR does not support mount watches due to ENODEV, the failure to watch multiple fs would be EXDEV and not ENODEV.
Reported-by Rhythm Mahajan <[email protected]>Signed-off-by Amir Goldstein <[email protected]>--- testcases/kernel/syscalls/fanotify/fanotify01.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)testcases/kernel/syscalls/fanotify/fanotify01.c +0
-0
testcases/kernel/syscalls/fanotify/fanotify01.c static void setup(void) · line 380
Quoted 8 lines
testcases/kernel/syscalls/fanotify/fanotify01.c +3
-2@@ -375,8 +375,9 @@ static void setup(void) }if (fanotify_flags_supported_on_fs (FAN_REPORT_FID ,FAN_MARK_MOUNT ,FAN_OPEN ,"." )) { - inode_mark_fid_xdev = errno; -tst_res (TINFO ,"TMPDIR does not support reporting events with fid from multi fs" ); + inode_mark_fid_xdev = (errno ==ENODEV ) ?EXDEV : errno; +tst_res (TINFO ,"TMPDIR does not support reporting events with fid from multi fs" +" (errno = %d)" , errno);
I merged with LTP specific flag TERRNO which prints both string and numeric value for errno:
tst_res(TINFO | TERRNO, "TMPDIR does not support reporting events with fid from multi fs");
Thanks for a fix!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp