OSDN Git Service

fanotify: enable FAN_REPORT_FID init flag
authorAmir Goldstein <amir73il@gmail.com>
Thu, 10 Jan 2019 17:04:36 +0000 (19:04 +0200)
committerJan Kara <jack@suse.cz>
Thu, 7 Feb 2019 15:38:35 +0000 (16:38 +0100)
commita8b13aa20afb69161b5123b4f1acc7ea0a03d360
treefc886af970f46d54e78c9c430c9d82d0548fd108
parent5e469c830fdb5a1ebaa69b375b87f583326fd296
fanotify: enable FAN_REPORT_FID init flag

When setting up an fanotify listener, user may request to get fid
information in event instead of an open file descriptor.

The fid obtained with event on a watched object contains the file
handle returned by name_to_handle_at(2) and fsid returned by statfs(2).

Restrict FAN_REPORT_FID to class FAN_CLASS_NOTIF, because we have have
no good reason to support reporting fid on permission events.

When setting a mark, we need to make sure that the filesystem
supports encoding file handles with name_to_handle_at(2) and that
statfs(2) encodes a non-zero fsid.

Cc: <linux-api@vger.kernel.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/fanotify/fanotify_user.c
include/linux/fanotify.h