Re: multimedia/vlc causes a panic if media files are on msdosfs

From: Aditya Sarawgi <sarawgi.aditya_at_gmail.com>
Date: Fri, 20 Nov 2009 19:26:11 +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
> _at__at_ -718,14 +718,15 _at__at_ 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
Received on Fri Nov 20 2009 - 13:16:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:58 UTC