[CRIU] [PATCH] pre-dump: avoid sleeping in the open() syscall

Pavel Emelyanov xemul at parallels.com
Thu Mar 13 05:17:08 PDT 2014


On 03/12/2014 02:43 PM, Andrey Vagin wrote:
> For example opening the FIFO blocks until the other end is opened also.
> 
> We can use O_PATH to avoid sleeping in the open() call.
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  files.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/files.c b/files.c
> index e2fb8eb..e6a32ee 100644
> --- a/files.c
> +++ b/files.c
> @@ -416,7 +416,7 @@ static int predump_one_fd(int pid, int fd)
>  	 * enightened version without fds draining.
>  	 */
>  
> -	lfd = open_proc(pid, "fd/%d", fd);
> +	lfd = __open_proc(pid, O_PATH | O_RDONLY, "fd/%d", fd);
>  	if (lfd < 0)
>  		return 0; /* That's OK, it can be a socket */
>  
> 


applied


More information about the CRIU mailing list