[CRIU] [PATCH] fsmptify: Filter out internal inotify bits when restoring marks

Andrew Vagin avagin at odin.com
Tue Sep 22 06:15:43 PDT 2015


On Tue, Sep 22, 2015 at 03:19:58PM +0300, Cyrill Gorcunov wrote:
> On Tue, Sep 22, 2015 at 02:27:46PM +0300, Andrew Vagin wrote:
> > >  
> > > +	/*
> > > +	 * The kernel prior 4.3 might export internal event
> > > +	 * mask bits which are not part of user-space API. It
> > > +	 * is fixed in kernel but we have to keep backward
> > > +	 * compatibility with old images. So mask out
> > > +	 * inappropriate bits (in particular fdinfo might
> > > +	 * have FS_EVENT_ON_CHILD bit set).
> > > +	 */
> > > +	mark->iwe->mask &= IN_ALL_EVENTS;
> > 
> > I think we need only exclude FS_EVENT_ON_CHILD. Otherwise we will skip a
> > new flags, when they will add into the kernel.
> 
> New flags are gonna be defined in uapi/ as well so criu is depending on which

If you will exclude only FS_EVENT_ON_CHILD, the code will work for all
kernel. The current version depends on IN_ALL_EVENTS, which can be
changed in the next kernel.

> system it's built and where it is running, in turn FS_EVENT_ON_CHILD
> is really internal one and kernel has all rights to redefine it in
> any way it prefer, we simply can't hardcode it in criu code.
> 
> It might be worth though to add some pr_info to notify a user that
> some particular bit has been removed from the mask, just for info.


More information about the CRIU mailing list