Commit 19906f91 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

fsnotify: Use mnt_id when restoring mount mark

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=2974Reported-by: 's avatarAndrey Vagin <avagin@openvz.org>
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 9f415abd
......@@ -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;
}
......
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