[CRIU] [PATCH] fsnotify: Use mnt_id when restoring mount mark

Cyrill Gorcunov gorcunov at openvz.org
Wed May 21 00:22:39 PDT 2014


When there is a bind mount present on same mountpoint
where mark is laying the device of both mountpoints
is the same so we might end up getting wrong mountpoint.
Instead we should used mount id which is unique among
all mounpoints.

Note it's a fast fix, I need to review fsnotify code
more and make sure all corner cases are covered.

https://bugzilla.openvz.org/show_bug.cgi?id=2974

Reported-by: Andrey Vagin <avagin at openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 fsnotify.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fsnotify.c b/fsnotify.c
index eed881a2d5f5..903e5baa8f20 100644
--- a/fsnotify.c
+++ b/fsnotify.c
@@ -428,9 +428,9 @@ static int restore_one_fanotify(int fd, struct fsnotify_mark_info *mark)
 	if (fme->type == MARK_TYPE__MOUNT) {
 		struct mount_info *m;
 
-		m = lookup_mnt_sdev(fme->s_dev);
+		m = lookup_mnt_id(fme->me->mnt_id);
 		if (!m) {
-			pr_err("Can't find mount s_dev %x\n", fme->s_dev);
+			pr_err("Can't find mount mnt_id %x\n", fme->me->mnt_id);
 			return -1;
 		}
 
-- 
1.9.0



More information about the CRIU mailing list