From owner-freebsd-current@FreeBSD.ORG Fri Nov 20 21:55:13 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50AE01065695 for ; Fri, 20 Nov 2009 21:55:13 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id EDA758FC19 for ; Fri, 20 Nov 2009 21:55:12 +0000 (UTC) Received: (qmail 7387 invoked by uid 399); 20 Nov 2009 21:55:11 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 20 Nov 2009 21:55:11 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B071044.2030708@FreeBSD.org> Date: Fri, 20 Nov 2009 13:55:16 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Kostik Belousov References: <4B05C709.2090005@dougbarton.us> <20091120110123.GG2331@deviant.kiev.zoral.com.ua> In-Reply-To: <20091120110123.GG2331@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org, delphij@freebsd.org, bug-followup@freebsd.org Subject: Re: ports/140648 multimedia/vlc causes a panic if media files are on msdosfs X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Nov 2009 21:55:13 -0000 Kostik Belousov wrote: > On Thu, Nov 19, 2009 at 02:30:33PM -0800, Doug Barton wrote: >> Please see http://www.freebsd.org/cgi/query-pr.cgi?pr=140648 for more >> information, including a trace. >> >> There is also some evidence that the same problem is triggered by >> accessing files on an NTFS partition. The VLC folks have suggested >> that the problem may be related to threading. > > This is because msdosfs and ntfs are not mpsafe, and it seems that > VLC using recently added F_RDAHEAD/F_READAHEAD fcntls. > > Please try this. > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > index 434f54a..676de65 100644 > --- a/sys/kern/kern_descrip.c > +++ b/sys/kern/kern_descrip.c > @@ -718,14 +718,15 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) > do { > new = old = fp->f_flag; > new |= FRDAHEAD; > - } while (atomic_cmpset_rel_int(&fp->f_flag, old, new) == 0); > + } while (!atomic_cmpset_rel_int(&fp->f_flag, old, new)); > readahead_vnlock_fail: > VFS_UNLOCK_GIANT(vfslocked); > + vfslocked = 0; > } else { > do { > new = old = fp->f_flag; > new &= ~FRDAHEAD; > - } while (atomic_cmpset_rel_int(&fp->f_flag, old, new) == 0); > + } while (!atomic_cmpset_rel_int(&fp->f_flag, old, new)); > } > fdrop(fp, td); > break; Voila! Thanks. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/