History log of /linux-master/samples/fanotify/fs-monitor.c
Revision Date Author Comments
# 15c72660 01-Nov-2021 Zhang Mingyu <zhang.mingyu@zte.com.cn>

samples: remove duplicate include in fs-monitor.c

'sys/types.h' included in 'samples/fanotify/fs-monitor.c'
is duplicated.It is also included on 15 line.

Link: https://lore.kernel.org/r/20211101075152.35780-1-zhang.mingyu@zte.com.cn
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Zhang Mingyu <zhang.mingyu@zte.com.cn>
Signed-off-by: Jan Kara <jack@suse.cz>


# b7eccf75 31-Oct-2021 Jan Kara <jack@suse.cz>

samples: Fix warning in fsnotify sample

The fsnotify sample code generates the following warning on powerpc:

samples/fanotify/fs-monitor.c: In function 'handle_notifications':
samples/fanotify/fs-monitor.c:68:36: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type '__u64' {aka 'long unsigned int'} [-Wformat=]
68 | printf("unexpected FAN MARK: %llx\n", event->mask);
| ~~~^ ~~~~~~~~~~~
| | |
| | __u64 {aka long unsigned int}
| long long unsigned int
| %lx

Fix the problem by explicitely typing the argument to proper type.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jan Kara <jack@suse.cz>


# 54510930 25-Oct-2021 Gabriel Krisman Bertazi <krisman@collabora.com>

samples: Add fs error monitoring example

Introduce an example of a FAN_FS_ERROR fanotify user to track filesystem
errors.

Link: https://lore.kernel.org/r/20211025192746.66445-31-krisman@collabora.com
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Jan Kara <jack@suse.cz>