Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Oct 2004 07:49:08 -0700
From:      Alfred Perlstein <alfred@freebsd.org>
To:        Scott Long <scottl@FreeBSD.org>
Cc:        current@FreeBSD.org
Subject:   Re: 5.3-RELEASE TODO
Message-ID:  <20041001144908.GB13443@elvis.mu.org>
In-Reply-To: <415D6A9E.5030903@FreeBSD.org>
References:  <200410010741.i917fJUo076107@pooker.samsco.org> <20041001083144.GT39252@elvis.mu.org> <415D6A9E.5030903@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Scott Long <scottl@FreeBSD.org> [041001 07:33] wrote:
> Alfred Perlstein wrote:
> >>|                  |             |                | The LOR reported in  |
> >>|                  |             |                | PR kern/55175 needs  |
> >>| filedesc LOR     | Not done    | --             | to be fixed.         |
> >>|                  |             |                | Filedesc locking     |
> >>|                  |             |                | needs to be heavily  |
> >>|                  |             |                | reviewed in general. |
> >
> >
> >Oy this thing... :)
> >
> >The only thing blocking this was that we need to access the filedesc
> >as the process shuts down for nfs locks, Darwin has a workaround that
> >I'll see if i can incorporate.
> >
> 
> Is this one still actually a problem?  I haven't seen anyone complain
> about it in months.

Yes. :)

in kern_descript.c:fdfree() we have this:

	/*
	 * We are the last reference to the structure, so we can
	 * safely assume it will not change out from under us.
	 */
	FILEDESC_UNLOCK(fdp);
	fpp = fdp->fd_ofiles;
	for (i = fdp->fd_lastfile; i-- >= 0; fpp++) {
		if (*fpp)
			(void) closef(*fpp, td);
	}

	/* XXX This should happen earlier. */
	mtx_lock(&fdesc_mtx);
	td->td_proc->p_fd = NULL;
	mtx_unlock(&fdesc_mtx);

Basically we have an unlocked access to the filedesc here.

The "should happen earlier" refers to swapping the order of these
two code blocks, but we can not because NFS locking currently
requires that the filedesc be around until the very last file is
released.

I may be able to merge a fix from Darwin for this, but I'm waiting
on an A-OK for it.

-- 
- Alfred Perlstein
- Research Engineering Development Inc.
- email: bright@mu.org cell: 408-480-4684



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