From owner-freebsd-current@FreeBSD.ORG Fri Nov 20 14:16:59 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 A0C2F106568B; Fri, 20 Nov 2009 14:16:59 +0000 (UTC) (envelope-from sarawgi.aditya@gmail.com) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id 6A2948FC0A; Fri, 20 Nov 2009 14:16:59 +0000 (UTC) Received: by pzk15 with SMTP id 15so2290670pzk.3 for ; Fri, 20 Nov 2009 06:16:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=YYkTAc2sEMojcEd1tn2pmgC+SHP9MkrYIH9O8p5dLTo=; b=jeG6zuph0g72qStpf+LYDDnnadA2hHa/cz12nBqUCMAA8y1v6wRjvX/MAPWcxVJbaK 5cb+tFOD2lm7M/xmltgbHixsNUlaEoFS6PB6AmQlM2gjeEUJ0vPN0rQigUONTdVrPK7r 811cHwlxfSDebQWPbSQDYAc9E8axfpJc1jEKY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=tJ6DMGJ7jiqiK30nPp8IFRXC7Cjk0rZNtCmsudAJZ4PhpG4VNuRl/teNmlCkHIFfDO i6tSlQgUrBDZZ/uFphgmKNXu715rcTxWONfUZh4M8Y9e1JLzndkZTIVfh6AnR9waubs/ o586qrPjw6fMq6BDEJ53IDUl3vMKb+PUzmZvo= Received: by 10.115.114.9 with SMTP id r9mr2048380wam.19.1258725358028; Fri, 20 Nov 2009 05:55:58 -0800 (PST) Received: from ([111.125.238.138]) by mx.google.com with ESMTPS id 20sm985481pxi.11.2009.11.20.05.55.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 20 Nov 2009 05:55:56 -0800 (PST) Date: Fri, 20 Nov 2009 19:26:11 +0000 From: Aditya Sarawgi To: Kostik Belousov , dougb@dougbartion.us Message-ID: <4b069fec.141bf30a.7f54.ffff8735@mx.google.com> References: <4B05C709.2090005@dougbarton.us> <20091120110123.GG2331@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091120110123.GG2331@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-current@freebsd.org, delphij@freebsd.org Subject: Re: 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 14:16:59 -0000 On Fri, Nov 20, 2009 at 01:01:23PM +0200, 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; I have been getting panics with VLC on UFS filesytem too, Although the frequency of panics on a UFS filesystem is pretty low as compared to msdosfs and ntfs systems and they are very abrupt. I will try getting a trace. -- Aditya Sarawgi