From owner-freebsd-current@FreeBSD.ORG Fri Nov 20 11:01:31 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 E95BB106566B; Fri, 20 Nov 2009 11:01:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 3D77D8FC08; Fri, 20 Nov 2009 11:01:30 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nAKB1Ong059946 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Nov 2009 13:01:24 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id nAKB1OE0025783; Fri, 20 Nov 2009 13:01:24 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nAKB1NG1025782; Fri, 20 Nov 2009 13:01:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 20 Nov 2009 13:01:23 +0200 From: Kostik Belousov To: Doug Barton Message-ID: <20091120110123.GG2331@deviant.kiev.zoral.com.ua> References: <4B05C709.2090005@dougbarton.us> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3aDvBnBjnpP7iyLb" Content-Disposition: inline In-Reply-To: <4B05C709.2090005@dougbarton.us> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua 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 11:01:32 -0000 --3aDvBnBjnpP7iyLb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 19, 2009 at 02:30:33PM -0800, Doug Barton wrote: > Please see http://www.freebsd.org/cgi/query-pr.cgi?pr=3D140648 for more > information, including a trace. >=20 > 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 =3D old =3D fp->f_flag; new |=3D FRDAHEAD; - } while (atomic_cmpset_rel_int(&fp->f_flag, old, new) =3D=3D 0); + } while (!atomic_cmpset_rel_int(&fp->f_flag, old, new)); readahead_vnlock_fail: VFS_UNLOCK_GIANT(vfslocked); + vfslocked =3D 0; } else { do { new =3D old =3D fp->f_flag; new &=3D ~FRDAHEAD; - } while (atomic_cmpset_rel_int(&fp->f_flag, old, new) =3D=3D 0); + } while (!atomic_cmpset_rel_int(&fp->f_flag, old, new)); } fdrop(fp, td); break; --3aDvBnBjnpP7iyLb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksGdwEACgkQC3+MBN1Mb4j1gQCg0gTFmpVjn8mwWfsiLGnvKSB0 cdMAoLUn7PzHF9d132OX3+jiVWZplzRQ =aSIm -----END PGP SIGNATURE----- --3aDvBnBjnpP7iyLb--