cvs commit: src/sys/fs/devfs devfs_vnops.c src/sys/fs/fifofs fifo_vnops.c src/sys/kern uipc_usrreq.c vfs_vnops.c src/sys/vm vnode_pager.c

Pawel Jakub Dawidek pjd at FreeBSD.org
Fri Oct 5 00:54:09 PDT 2007


On Thu, Oct 04, 2007 at 06:29:25PM -0700, Jeff Roberson wrote:
> On Thu, 4 Oct 2007, John Baldwin wrote:
> 
> >On Wednesday 03 October 2007 07:48:00 pm Jeff Roberson wrote:
> >>On Wed, 3 Oct 2007, John Baldwin wrote:
> >>
> >>>jhb         2007-10-03 21:06:05 UTC
> >>>
> >>> FreeBSD src repository
> >>>
> >>> Modified files:        (Branch: RELENG_6)
> >>>   sys/fs/devfs         devfs_vnops.c
> >>>   sys/fs/fifofs        fifo_vnops.c
> >>>   sys/kern             uipc_usrreq.c vfs_vnops.c
> >>>   sys/vm               vnode_pager.c
> >>> Log:
> >>> MFC: Always use an exclusive lock on the leaf vnode during an open() 
> >>> when
> >>> shared lookups are enabled.  This closes a few races including a race
> >where
> >>> concurrent opens of a fifo could result in different v_fifoinfo
> >structures
> >>> in different threads.
> >>
> >>Long term we should really look for a better solution to this problem.
> >>There are a number of was to improve snapshots in ffs by fixing shared
> >>locking.
> >
> >I don't disagree.  The fifo case can be fixed easily enough in the fifo 
> >code
> >by using fifo_mtx to protect v_fifoinfo perhaps (or doing an upgrade on the
> >vnode lock?), but for the MFC I didn't want to have to fix each of the 
> >races
> >with open(2).  Probably better to fix it more properly in HEAD first.
> 
> Definitely someting for head.  Were there any others that you ran into 
> besides v_fifoinfo?  We should audit this more closely anyhow.  I have 
> been reluctant to push too much shared locking into VFS because it's not 
> been so carefully studied.

You probably talking about my patch. I agree, but there are many
inconsistencies. People tend to use exclusive locking everywhere. We
could start from converting places where sometimes we use shared
locking and sometimes exclusive, eg. VOP_READ(), VOP_GETATTR(), etc.

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20071005/3289f08f/attachment.pgp


More information about the cvs-src mailing list