Commit e15914fb authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

fsnotify: Open handle with O_PATH, v2

Otherwise if the mark is set up on link we end
with -ELOOP error trying to open it. Thus, use
O_PATH pointing the kernel that we're not going
to read/write this descriptor.
Repored-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 6209ff45
......@@ -114,7 +114,7 @@ static int open_handle(unsigned int s_dev, unsigned long i_ino,
goto out;
}
fd = sys_open_by_handle_at(mntfd, (void *)&handle, 0);
fd = sys_open_by_handle_at(mntfd, (void *)&handle, O_PATH);
if (fd < 0) {
errno = -fd;
pr_perror("Can't open file handle for 0x%08x:0x%016lx",
......
......@@ -29,4 +29,8 @@ struct f_owner_ex {
# define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
#endif
#ifndef O_PATH
# define O_PATH 010000000
#endif
#endif /* __CR_ASM_GENERIC_FCNTL_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment