[CRIU] [PATCH 10/17] fsnotify: Add fanotify restore

Pavel Emelyanov xemul at parallels.com
Mon Dec 24 08:50:11 EST 2012


On 12/24/2012 05:47 PM, Cyrill Gorcunov wrote:
> On Mon, Dec 24, 2012 at 05:23:46PM +0400, Pavel Emelyanov wrote:
>> On 12/11/2012 01:34 AM, Cyrill Gorcunov wrote:
>>>
>>> The idea is the same as for inotify -- just open
>>> notification descriptor and hook paths on.
>>>
>>> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
>>> ---
>>>  fsnotify.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
>>>  1 file changed, 89 insertions(+), 2 deletions(-)
>>>
>>
>>
>>> +static int open_fanotify_fd(struct fsnotify_file_info *info)
>>> +{
>>> +	unsigned int faflags = info->ife->faglob->faflags;
>>> +	struct fsnotify_wd_info *wd_info;
>>> +	int ret = -1;
>>> +
>>> +	if (info->ife->flags & O_CLOEXEC)
>>> +		faflags |= FAN_CLOEXEC;
>>> +	if (info->ife->flags & O_NONBLOCK)
>>> +		faflags |= FAN_NONBLOCK;
>>> +
>>> +	ret = sys_fanotify_init(faflags, info->ife->faglob->evflags);
>>
>> faglob is optional, thus can be NULL.
>>
> 
> No, at this moment it can;t be nil.
> 
> static int verify_file_info(struct fsnotify_file_info *info)
> {
> 	FsnotifyFileEntry *ife = info->ife;
> 
> 	/*
> 	 * Old image, setup default type.
> 	 */
> 	if (unlikely(!ife->has_type)) {
> 		ife->has_type = true;
> 		ife->type = FSNOTIFY_TYPE__INOTIFY;
> 	}
> 
> 	if (ife->type == FSNOTIFY_TYPE__FANOTIFY) {
> 		if (!ife->faglob) {
> 			pr_err("Corrupted fanotify global parameters\n");
> 			return -1;
> 		}
> 	}
> 
> 	return 0;
> }

This happens in the _later_ patch. Then resort the patches.

> 	Cyrill
> .
> 




More information about the CRIU mailing list