[CRIU] [PATCH] fsnotify: Use longest mount point for inotify watchee

Cyrill Gorcunov gorcunov at gmail.com
Mon Oct 12 01:41:39 PDT 2015


On Mon, Oct 12, 2015 at 11:16:50AM +0300, Pavel Emelyanov wrote:
> 
> But we do know the namespace the path come from, why do we ever
> _guess_ anything instead of just going to that ns and opening
> the file there?

Because the @mnt_id we are obtaining with file handle points
to the first matching @sdev (which obviously may point to any
mountnamespace). In turn on restore when we're adding watchee
we're already in mount namespace of the process, and the @path
we saved earlier is overmounted with something else. That said
I guess that we might transfer file descriptors or switching
to target mount namespace when opening paths but this makes
code even more complex. This solution looks way more easier.


More information about the CRIU mailing list