[PATCH] fsnotify: Open handle with O_PATH

Cyrill Gorcunov gorcunov at openvz.org
Mon Feb 24 08:44:40 PST 2014


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: Andrew Vagin <avagin at parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
Acked-by: Andrew Vagin <avagin at parallels.com>
---
 fsnotify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fsnotify.c b/fsnotify.c
index 3f5ef6280bc8..476fb2620bd0 100644
--- a/fsnotify.c
+++ b/fsnotify.c
@@ -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)
 		pr_perror("Can't open file handle for 0x%08x:0x%016lx",
 				s_dev, i_ino);
-- 
1.8.3.1


--UfEAyuTBtIjiZzX6--


More information about the CRIU mailing list