[CRIU] [PATCH 1/2] zdtm: introduced a local version of O_LARGEFILE

Pavel Emelyanov xemul at parallels.com
Wed Jan 30 06:35:14 EST 2013


On 01/30/2013 10:32 AM, Alexander Kartashov wrote:
> On 01/30/2013 03:13 AM, Pavel Emelyanov wrote:
>> In what header?
> It's the header /usr/include/x86_64-linux-gnu/bits/fcntl.h in my distro.
>> OK, so zdtm test opens file with O_LARGEFILE flag, doesn't it?
> 
> The test static/file_fown tests C/R of pipes. Descriptors of pipe ends
> are created by the kernel without the flag O_LARGEFILE. crtools dumps
> everything correctly.
> 
> When a pipe is restored one of its ends is reopened using the function
> open() that adds the flag O_LARGEFILE specifically its kernel version.
> So the test detects that file flags on a pipe descriptor changed during
> the C/R cycle and reports a error.

It's a bug in crtools. O_LARGEFILE shouldn't appear on an FD.

> To prevent this the test clear the flag O_LARGEFILE from the file flags
> returned by the function fcntl(). The problem is that it uses explicit
> value of the flag (0100000) that doesn't match
> 
> * The value declared in the x86-64 usespace headers --- it's declared
>     to be 0,
> * The value used in the ARM kernel.
> 
> So the test succeeds on x86-64 and fails on ARM. That's why I decided
> to add the kernel definition of the flag O_LARGEFILE to the zdtm headers.
> 




More information about the CRIU mailing list