From nobody@FreeBSD.org  Mon Dec  5 09:41:56 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4137016A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  5 Dec 2005 09:41:56 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6964E43D86
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  5 Dec 2005 09:41:46 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id jB59fhOe050605
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 5 Dec 2005 09:41:43 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id jB59fhsi050604;
	Mon, 5 Dec 2005 09:41:43 GMT
	(envelope-from nobody)
Message-Id: <200512050941.jB59fhsi050604@www.freebsd.org>
Date: Mon, 5 Dec 2005 09:41:43 GMT
From: "H. Matsuo" <hiroshi50000@yahoo.co.jp>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mounting ntfs causes kernel panic in some cases
X-Send-Pr-Version: www-2.3

>Number:         89966
>Category:       kern
>Synopsis:       [ntfs] [panic] mounting ntfs causes kernel panic in some cases
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    rodrigc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 05 09:50:01 GMT 2005
>Closed-Date:    Tue Mar 01 10:14:52 EST 2011
>Last-Modified:  Tue Mar 01 10:14:52 EST 2011
>Originator:     H. Matsuo
>Release:        6.0-STABLE
>Organization:
>Environment:
FreeBSD racco.zoo 6.0-STABLE FreeBSD 6.0-STABLE #1: Sun Dec  4 18:51:43 JST 2005     root@racco.zoo:/mnt/misc/freebsd-6/obj/mnt/misc/freebsd-6/src/sys/GENERIC\
 i386 i386 Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz FreeBSD
>Description:
When tring to re-mount *mounted* filesystem again, kernel does not return
ERROR, or panic in some cases (with option -o ro).

Please see below.  In case 1-3 kernel reacts properly, but in case 4-5
response of kernel seems to be odd.  In case 6, kernel panic happens.

-----------------------------------
[CASE1]
# mount -t ufs /dev/da0s4d /mnt/misc
# mount -t ufs /dev/da0s4d /mnt/misc
mount: /dev/da0s4d: Operation not permitted
    (kernel returns ERROR: this is an expected response, no problem.)

[CASE2]
# mount -t msdosfs /dev/da0s3 /mnt/win3
# mount -t msdosfs /dev/da0s3 /mnt/win3
mount_msdosfs: /dev/da0s3: Operation not permitted
    (kernel returns ERROR: this is an expected response, no problem.)

[CASE3]
# mount -t ntfs /dev/ad0s1 /mnt/win1
# mount -t ntfs /dev/ad0s1 /mnt/win1
mount_ntfs: /dev/ad0s1: Operation not permitted
    (kernel returns ERROR: this is an expected response, no problem.)

[CASE4]
# mount -t ufs -o ro /dev/da0s4d /mnt/misc
# mount -t ufs -o ro /dev/da0s4d /mnt/misc
    (kernel does not return ERROR, why?)
# df
Filesystem  1K-blocks      Used    Avail Capacity  Mounted on
/dev/ad0s3a    118766     79268    29998    73%    /
devfs               1         1        0   100%    /dev
/dev/ad0s3d   2675918   1498266   963580    61%    /usr
/dev/ad0s3e    168366     36918   117980    24%    /var
/dev/ad0s3f    287888    141996   122862    54%    /home
procfs              4         4        0   100%    /proc
/dev/da0s4d   9915754   4663748  4458746    51%    /mnt/misc
/dev/da0s4d   9915754   4663748  4458746    51%    /mnt/misc
    (/mnt/misc line appears twice. Is this no problem?)

[CASE5]
# mount -t msdosfs -o ro /dev/da0s3 /mnt/win3
# mount -t msdosfs -o ro /dev/da0s3 /mnt/win3
# df
Filesystem  1K-blocks      Used    Avail Capacity  Mounted on
/dev/ad0s3a    118766     79268    29998    73%    /
devfs               1         1        0   100%    /dev
/dev/ad0s3d   2675918   1498266   963580    61%    /usr
/dev/ad0s3e    168366     36916   117982    24%    /var
/dev/ad0s3f    287888    141996   122862    54%    /home
procfs              4         4        0   100%    /proc
/dev/da0s3    5114732   1087768  4026964    21%    /mnt/win3
/dev/da0s3    5114732   1087768  4026964    21%    /mnt/win3
    (same as CASE4)

[CASE6]
# mount -t ntfs -o ro /dev/ad0s1 /mnt/win1
# mount -t ntfs -o ro /dev/ad0s1 /mnt/win1
<<kernel panic!!>>

>How-To-Repeat:
# mount -t ntfs -o ro /dev/ad0s1 /mnt/win1
# mount -t ntfs -o ro /dev/ad0s1 /mnt/win1
<<kernel panic!!>>
>Fix:
I don't know.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->rodrigc 
Responsible-Changed-By: rodrigc 
Responsible-Changed-When: Sat Jun 3 04:45:33 UTC 2006 
Responsible-Changed-Why:  
Mine 

http://www.freebsd.org/cgi/query-pr.cgi?pr=89966 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/89966: commit references a PR
Date: Fri, 21 Sep 2007 23:50:24 +0000 (UTC)

 rodrigc     2007-09-21 23:50:15 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/fs/ntfs          ntfs_vfsops.c 
   Log:
   Disable multiple ntfs mounts to the same mountpoint.
   Eliminates panics due to locking issues.
   Idea taken from src/sys/gnu/fs/xfs/FreeBSD/xfs_super.c.
   
   PR:     89966, 92000, 104393
   Reported by:    H. Matsuo <hiroshi50000 yahoo co jp>,
                   Chris <m2chrischou gmail.com>,
                   Andrey V. Elsukov <bu7cher yandex ru>,
                   Jan Henrik Sylvester <me janh de>
   Approved by:    re (kensmith)
   
   Revision  Changes    Path
   1.88      +15 -1     src/sys/fs/ntfs/ntfs_vfsops.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: linimon 
State-Changed-When: Fri Feb 29 00:57:18 UTC 2008 
State-Changed-Why:  
Committed 21 Sep 2007 but not yet MFCed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=89966 
State-Changed-From-To: patched->closed 
State-Changed-By: eadler 
State-Changed-When: Tue Mar 1 10:14:51 EST 2011 
State-Changed-Why:  
This PR is fixed in head, 8.x and 7.x, but will not be merged to 6.x now 
that that branch is unsupported, sorry 

http://www.freebsd.org/cgi/query-pr.cgi?pr=89966 
>Unformatted:
