Re: [PATCH 2/3] c/r: kread/kwrite() to abort if CKPT_CTX_ERROR is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Oren Laadan (orenl@xxxxxxxxxxxxxxx):
> This is useful particularly in restart to force a task that is
> restoring to respond quickly to an error condition due to another
> task, instead of only detecting it when it completes (or fails).
> For example, when a restarting tasks activates the next task, and
> then fails.
> 
> Signed-off-by: Oren Laadan <orenl@xxxxxxxxxxxxxxx>

Hmm, true, that has obscured a few bugs for me already :)

thanks,
-serge

> ---
>  checkpoint/sys.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/checkpoint/sys.c b/checkpoint/sys.c
> index dbee469..afcfa1e 100644
> --- a/checkpoint/sys.c
> +++ b/checkpoint/sys.c
> @@ -65,6 +65,9 @@ int ckpt_kwrite(struct ckpt_ctx *ctx, void *addr, int count)
>  	mm_segment_t fs;
>  	int ret;
> 
> +	if (ckpt_test_ctx_error(ctx))
> +		return ckpt_get_error(ctx);
> +
>  	fs = get_fs();
>  	set_fs(KERNEL_DS);
>  	ret = _ckpt_kwrite(ctx->file, addr, count);
> @@ -102,6 +105,9 @@ int ckpt_kread(struct ckpt_ctx *ctx, void *addr, int count)
>  	mm_segment_t fs;
>  	int ret;
> 
> +	if (ckpt_test_ctx_error(ctx))
> +		return ckpt_get_error(ctx);
> +
>  	fs = get_fs();
>  	set_fs(KERNEL_DS);
>  	ret = _ckpt_kread(ctx->file , addr, count);
> -- 
> 1.6.3.3
> 
> _______________________________________________
> Containers mailing list
> Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
> https://lists.linux-foundation.org/mailman/listinfo/containers
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux