Commit 5cac1131 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Andrei Vagin

fsnotify: Fix bad field name in list iterations

Surprisingly, but

offsetof(inotify_wd_entry, node) == offsetof(fanotify_mark_entry, node)

even though both structures have node field in the middle and the
fields sitting above one are totally different.

So the code works, but ... we're risking :)
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent d8dd4703
......@@ -468,7 +468,7 @@ static int dump_one_fanotify(int lfd, u32 id, const struct fd_parms *p)
goto free;
i = 0;
list_for_each_entry(we, &wd_list.list, ify.node)
list_for_each_entry(we, &wd_list.list, ffy.node)
fe.mark[i++] = &we->ffy.e;
fe.n_mark = wd_list.n;
......@@ -480,7 +480,7 @@ static int dump_one_fanotify(int lfd, u32 id, const struct fd_parms *p)
ret = pb_write_one(img_from_set(glob_imgset, CR_FD_FANOTIFY_FILE), &fe, PB_FANOTIFY_FILE);
free:
xfree(fe.mark);
list_for_each_entry_safe(we, tmp, &wd_list.list, ify.node)
list_for_each_entry_safe(we, tmp, &wd_list.list, ffy.node)
free_fanotify_mark_entry(we);
return ret;
}
......
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