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

Pavel Emelyanov xemul at parallels.com
Mon Oct 19 04:05:32 PDT 2015


On 10/19/2015 01:54 PM, Cyrill Gorcunov wrote:
> On Mon, Oct 19, 2015 at 01:37:15PM +0300, Pavel Emelyanov wrote:
>>>
>>> As to path check -- we don't care which path we obtain,
>>> the inode referenced by the path is the same.
>>
>> Where does the guarantee for that come from? I can agree with devices
>> being the same, OK (since you look up the mountpoint by device), but
>> the inodes match MUST be there, as you open some derived path at 
>> different location.
> 
> This comes from the handle itself, that's how they work. They're

No, no, no :) I'm talking about this

> +		openable_fd = openat(mntfd, __path, O_PATH);
> +		if (openable_fd >= 0) {
> +			close(openable_fd);

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.

> keeping inode inside their binary form, once opened you've got
> a path to the node. Maybe I'm missing something. Mind to type
> some pseudocode what you're meaning?
> 
> Basically all the above is
> 
> 	for-each-device-matched
> 		fd = open-by-handle
> 		if (fd >= 0)
> 			path = read-link(/proce/self/$fd)
> 			if (open(path) >= 0)
> 				save-path into an image
> 
> 	Cyrill
> .
> 



More information about the CRIU mailing list