[CRIU] [PATCH 2/2 v4] fsnotify: Always provide the path for inotify watchees

Pavel Emelyanov xemul at parallels.com
Mon Oct 19 05:13:43 PDT 2015


On 10/19/2015 02:52 PM, Cyrill Gorcunov wrote:
> On Mon, Oct 19, 2015 at 02:27:28PM +0300, Pavel Emelyanov wrote:
>>>> code. You open _some_ path and state that the inode you get after
>>>> this is the same as you got before with open_by_handle_at(). I say
>>>> this assumption is wrong and should be checked by comparing inodes.
>>>
>>> OK, I see what you mean. If the path opened by handle then read
>>> from the self-link would not match the inode the whole complete
>>> kernel is broken. 
>>
>> No, it's not about the kernel. Let's imagine the openat() fails with
>> ENOENT. Can it? I guess it can, you try openat() in a loop. Now what
>> if someone create _another_ file making the openat() that failed
>> succeed. What you end up with? Wrong file opened by path.
> 
> Who is the "someone" who has created new file while we were on
> the dumping frozen stage? :-)

This file could have been there _before_ we started migration and your
openat() will open existing wrong file.

-- Pavel



More information about the CRIU mailing list