Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Aug 2005 15:44:59 +0300
From:      Giorgos Keramidas <keramida@freebsd.org>
To:        Poul-Henning Kamp <phk@haven.freebsd.dk>
Cc:        current@freebsd.org
Subject:   Re: Giant around fdfree() in exit1() ?
Message-ID:  <20050817124459.GF1084@flame.pc>
In-Reply-To: <17182.1124270021@phk.freebsd.dk>
References:  <17182.1124270021@phk.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-08-17 11:13, Poul-Henning Kamp <phk@haven.freebsd.dk> wrote:
>
> I'm seeing Giant held in a MNTK_MPSAFE devfs->close without this patch,
> any insight/comments ?

fdfree() releases POSIX locks the descriptor has.  Is it ok to call
VOP_ADVLOCK(..., F_UNLCK, ...) and free() without holding Giant?

> Index: kern/kern_exit.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/kern/kern_exit.c,v
> retrieving revision 1.264
> diff -u -r1.264 kern_exit.c
> --- kern/kern_exit.c	18 Jul 2005 20:08:14 -0000	1.264
> +++ kern/kern_exit.c	17 Aug 2005 08:42:38 -0000
> @@ -229,13 +229,13 @@
>  	 */
>  	mtx_lock(&Giant);	/* XXX: not sure if needed */
>  	funsetownlst(&p->p_sigiolst);
> +	mtx_unlock(&Giant);	
>  
>  	/*
>  	 * Close open files and release open-file table.
>  	 * This may block!
>  	 */
>  	fdfree(td);
> -	mtx_unlock(&Giant);	



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050817124459.GF1084>