[CRIU] [PATCH 6/7] inotify: Use ghost files if the watchee is a deleted file

Pavel Emelyanov xemul at parallels.com
Wed Dec 5 08:16:57 EST 2012


On 12/05/2012 05:12 PM, Cyrill Gorcunov wrote:
> On Wed, Dec 05, 2012 at 05:02:49PM +0400, Cyrill Gorcunov wrote:
>> On Wed, Dec 05, 2012 at 04:48:28PM +0400, Pavel Emelyanov wrote:
>>>> @@ -131,12 +133,16 @@ static int restore_one_inotify(int inotify_fd, InotifyWdEntry *iwe)
>>>>  
>>>>  	target = sys_open_by_handle_at(mntfd, (void *)&handle, 0);
>>>>  	if (target < 0) {
>>>> -		pr_perror("Can't open file handle for 0x%08x:0x%016lx",
>>>> -			  iwe->s_dev, iwe->i_ino);
>>>> -		goto err;
>>>> -	}
>>>> +		gf = lookup_ghost_file_st(iwe->s_dev, iwe->i_ino);
>>>
>>> At that point gf may have already being removed. The fact that you bump up
>>> users _here_ doesn't work. Users should be counted before actual restore starts.
>>
>> yup :( a race window here. I'll fix it up. Thanks!
> 
> Something like this I think.
> 

> @@ -43,6 +44,7 @@
>  struct inotify_wd_info {
>  	struct list_head		list;
>  	InotifyWdEntry			*iwe;
> +	struct ghost_file		*gf;

You don't want the whole gf here, you just need the remap.

>  };
>  
>  struct inotify_file_info {




More information about the CRIU mailing list