mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 16:07:39 +00:00
fanotify: fix incorrect fmode_t casts
[ Upstream commit dccd855771
]
Fixes sparce warnings:
fs/notify/fanotify/fanotify_user.c:267:63: sparse:
warning: restricted fmode_t degrades to integer
fs/notify/fanotify/fanotify_user.c:1351:28: sparse:
warning: restricted fmode_t degrades to integer
FMODE_NONTIFY have bitwise fmode_t type and requires __force attribute
for any casts.
Signed-off-by: Vasily Averin <vvs@openvz.org>
Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/9adfd6ac-1b89-791e-796b-49ada3293985@openvz.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8657e8ea23
commit
6cfc81c6ac
1 changed files with 2 additions and 2 deletions
|
@ -264,7 +264,7 @@ static int create_fd(struct fsnotify_group *group, struct path *path,
|
|||
* originally opened O_WRONLY.
|
||||
*/
|
||||
new_file = dentry_open(path,
|
||||
group->fanotify_data.f_flags | FMODE_NONOTIFY,
|
||||
group->fanotify_data.f_flags | __FMODE_NONOTIFY,
|
||||
current_cred());
|
||||
if (IS_ERR(new_file)) {
|
||||
/*
|
||||
|
@ -1329,7 +1329,7 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
|
|||
(!(fid_mode & FAN_REPORT_NAME) || !(fid_mode & FAN_REPORT_FID)))
|
||||
return -EINVAL;
|
||||
|
||||
f_flags = O_RDWR | FMODE_NONOTIFY;
|
||||
f_flags = O_RDWR | __FMODE_NONOTIFY;
|
||||
if (flags & FAN_CLOEXEC)
|
||||
f_flags |= O_CLOEXEC;
|
||||
if (flags & FAN_NONBLOCK)
|
||||
|
|
Loading…
Reference in a new issue