[CRIU] [PATCH v2 criu] zdtm: reset file position to the begginning of the file in netns-dev

Andrew Vagin avagin at odin.com
Tue Apr 14 06:33:57 PDT 2015


On Mon, Apr 13, 2015 at 06:21:30PM +0300, Pavel Tikhomirov wrote:
> writing to netdev configuration at non zero offset won't be supported:
> 
> ```
> [  301.431638] netns-dev wrote to accept_local when file position was
> not 0! This will not be supported in the future. To silence this
> warning, set kernel.sysctl_writes_strict = -1
> ```
> 
> v2: fix compilation
> 
> Sorry, please don't consider v1.
>

Acked-by: Andrew Vagin <avagin at odin.com> 
> Signed-off-by: Pavel Tikhomirov <ptikhomirov at odin.com>
> ---
>  test/zdtm/live/static/netns-dev.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/test/zdtm/live/static/netns-dev.c b/test/zdtm/live/static/netns-dev.c
> index d8d68fa..4d7fede 100644
> --- a/test/zdtm/live/static/netns-dev.c
> +++ b/test/zdtm/live/static/netns-dev.c
> @@ -91,6 +91,12 @@ static int save_and_set(int opt, FILE *fp, struct test_conf *tc) {
>  		return -1;
>  	}
>  
> +	ret = fseek(fp, 0, SEEK_SET);
> +	if (ret) {
> +		err("fseek");
> +		return -1;
> +	}
> +
>  	/*
>  	 * Set random value
>  	 */
> @@ -129,6 +135,12 @@ static int check_and_restore(int opt, FILE *fp, struct test_conf *tc) {
>  		return -1;
>  	}
>  
> +	ret = fseek(fp, 0, SEEK_SET);
> +	if (ret) {
> +		err("fseek");
> +		return -1;
> +	}
> +
>  	/*
>  	 * Restore opt
>  	 */
> -- 
> 1.9.3
> 


More information about the CRIU mailing list