From nobody@FreeBSD.org  Tue Apr 24 07:00:12 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 23B151065673
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Apr 2012 07:00:12 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id DA4C98FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Apr 2012 07:00:11 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q3O70Bsu089839
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Apr 2012 07:00:11 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q3O70B6A089838;
	Tue, 24 Apr 2012 07:00:11 GMT
	(envelope-from nobody)
Message-Id: <201204240700.q3O70B6A089838@red.freebsd.org>
Date: Tue, 24 Apr 2012 07:00:11 GMT
From: Yuri <yuri@tsoft.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: msdosfs disk was mounted the second time when the first umount was not clean and mount record still exists
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         167260
>Category:       kern
>Synopsis:       [msdosfs] msdosfs disk was mounted the second time when the first umount was not clean and mount record still exists
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-fs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 24 07:10:08 UTC 2012
>Closed-Date:    
>Last-Modified:  Wed Apr 25 05:09:25 UTC 2012
>Originator:     Yuri
>Release:        9.0 amd64
>Organization:
n/a
>Environment:
>Description:
I had the broken flash disk, and few write operations failed. And umount operation hanged. So I had to pull the USB drive out.

After checking, I mounted it again, and it works now.

However, mount command shows it mounted twice (!!!):

Filesystem   1K-blocks       Used     Avail Capacity  Mounted on
/dev/da0s1      7753672   7039040    714632    91%    /mnt/fat1
/dev/da0s1      7753672   7608888    144784    98%    /mnt/fat1

=== log of the failed disk operations ===
ugen3.3: <vendor 0xffee> at usbus3
umass0: <vendor 0xffee product 0x0100, class 0/0, rev 2.00/1.00, addr 3> on usbus3
umass0:  SCSI over Bulk-Only; quirks = 0x4100
umass0:7:0:-1: Attached to scbus7
da0 at umass-sim0 bus 0 scbus7 target 0 lun 0
da0: <FNK TECH USB CARD READER 2.33> Removable Direct Access SCSI-2 device 
da0: 40.000MB/s transfers
da0: 7580MB (15523840 512 byte sectors: 255H 63S/T 966C)
g_vfs_done():da0s1[WRITE(offset=7208050688, length=8192)]error = 5
g_vfs_done():da0s1[WRITE(offset=7208050688, length=8192)]error = 5
g_vfs_done():da0s1[WRITE(offset=7208050688, length=8192)]error = 5
g_vfs_done():da0s1[WRITE(offset=7208050688, length=8192)]error = 5
fsync: giving up on dirty
0xfffffe02a583b000: tag devfs, type VCHR
    usecount 1, writecount 0, refcount 989 mountedhere 0xfffffe01378d9c00
    flags ()
    v_object 0xfffffe024d34c658 ref 0 pages 1025
    lock type devfs: EXCL by thread 0xfffffe020d2a78c0 (pid 8156)
        dev da0s1
g_vfs_done():da0s1[WRITE(offset=7208050688, length=8192)]error = 5
fsync: giving up on dirty
0xfffffe02a583b000: tag devfs, type VCHR
    usecount 1, writecount 0, refcount 989 mountedhere 0xfffffe01378d9c00
    flags ()
    v_object 0xfffffe024d34c658 ref 0 pages 1025
    lock type devfs: EXCL by thread 0xfffffe0042809460 (pid 8168)
        dev da0s1
ugen3.3: <vendor 0xffee> at usbus3 (disconnected)
umass0: at uhub3, port 3, addr 3 (disconnected)
(da0:umass-sim0:0:0:0): lost device - 0 outstanding, 1 refs
(da0:umass-sim0:0:0:0): removing device entry
Device da0s1 went missing before all of the data could be written to it; expect data loss.
<!!! Here device mount record was left !!!>

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: Yuri <yuri@rawbw.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/167260: msdosfs disk was mounted the second time when the
 first umount was not clean and mount record still exists
Date: Tue, 24 Apr 2012 00:33:57 -0700

 mount -v shows more info:
 /dev/da0s1 on /mnt/fat1 (msdosfs, local, writes: sync 3 async 6, reads: 
 sync 37 async 0, fsid 8e00000032000000)
 /dev/da0s1 on /mnt/fat1 (msdosfs, local, writes: sync 30 async 15070, 
 reads: sync 37 async 6, fsid 8d00000032000000)
 
 
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Apr 25 05:09:10 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer(s). 

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