[CRIU] [PATCH 05/22] protobuf: fsnotify -- Add fanotify entries

Cyrill Gorcunov gorcunov at openvz.org
Tue Jan 15 09:22:27 EST 2013


On Tue, Jan 15, 2013 at 06:14:07PM +0400, Pavel Emelyanov wrote:
> On 01/14/2013 08:47 PM, Cyrill Gorcunov wrote:
> > 
> > Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> > ---
> >  protobuf/fsnotify.proto | 28 ++++++++++++++++++++++++++++
> >  1 file changed, 28 insertions(+)
> > 
> 
> 
> I'm ready to merge the code. One question:
> 
> > +message fanotify_mark_entry {
> > +	required uint32		id		= 1;
> > +	required mark_type	type		= 2;
> > +
> > +	required uint64		i_ino		= 3;
> > +	required uint32		s_dev		= 4;
> > +	required uint32		mflags		= 5;
> > +	required uint32		mask		= 6;
> > +	required uint32		ignored_mask	= 7;
> > +
> > +	optional uint32		mnt_id		= 8;
> > +	optional fh_entry	f_handle	= 9;
> > +}
> 
> For what I see from patch 20 (proc parsing) if mark type is
> INODE, then all fields but mnt_id are in use. When mark type
> is MOUNT, then all fields but i_ino, s_dev and f_handle are
> in use. Maybe it's better to change this object to have
> i_ino, s_dev and f_handle to be optional as well? Like below
> 
> +message fanotify_mark_entry {
> +	required uint32		id		= 1;
> +	required mark_type	type		= 2;
> +
> +	required uint32		mflags		= 3;
> +	required uint32		mask		= 4;
> +	required uint32		ignored_mask	= 5;
> +
> +	optional uint64		i_ino		= 6;
> +	optional uint32		s_dev		= 7;
> +	optional fh_entry	f_handle	= 8;
> +	optional uint32		mnt_id		= 9;
> +}

Optional entries bloat the code and the image itself. For every
optional field there will be "has_" mark which will be stored
on image. So I thoght it doesn't worth it. But if you still
prefer optionals I can update, sure (but note that I'll have
to add code which will set has_... = true and such into
codebase).

	Cyrill


More information about the CRIU mailing list