Re: [PATCH] Fix process lockup on a loop device

Herbert Poetzl <[email protected]>
Newsgroups gmane.linux.vserver
Message-ID <[email protected]>
On Sat, Dec 17, 2011 at 10:30:58PM +0900, Ryota Ozaki wrote:
> lo_open returns with holding loop_index_mutex when
> vx_check failed, resulting in a process lockup on
> a loop device.

thanks a bunch!

best,
Herbert

> Signed-off-by: Ryota Ozaki <[email protected]>
> ---
>  drivers/block/loop.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> index b01b03c..c34ad3b 100644
> --- a/drivers/block/loop.c
> +++ b/drivers/block/loop.c
> @@ -1494,8 +1494,10 @@ static int lo_open(struct block_device *bdev, fmode_t mode)
>  		goto out;
>  	}
>  
> -	if (!vx_check(lo->lo_xid, VS_IDENT|VS_HOSTID|VS_ADMIN_P))
> -		return -EACCES;
> +	if (!vx_check(lo->lo_xid, VS_IDENT|VS_HOSTID|VS_ADMIN_P)) {
> +		err = -EACCES;
> +		goto out;
> +	}
>  
>  	mutex_lock(&lo->lo_ctl_mutex);
>  	lo->lo_refcnt++;
> -- 
> 1.7.5.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.