[CRIU] [PATCH 05/22] protobuf: fsnotify -- Add fanotify entries
Pavel Emelyanov
xemul at parallels.com
Tue Jan 15 09:34:17 EST 2013
On 01/15/2013 06:22 PM, Cyrill Gorcunov wrote:
> 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).
Let's then do it like
message fanotify_inode_mark_entry {
required uint64 i_ino = 1;
required uint32 s_dev = 2;
required fh_entry f_handle = 3;
}
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 fanotify_inode_mark_entry ie = 6;
optional uint32 mnt_id = 7;
}
?
And in the "what's bad with v1 images" on wiki we put a
note, that it'd be great to merge pieces of inotify and
fanotify entries and do it in v2 images.
Anyway. I merge the whole set now, you send me a patch that
brings image into more consistent form. Plus patches with
code deduplication we discussed before are welcome.
> Cyrill
> .
>
More information about the CRIU
mailing list