From nobody@FreeBSD.org  Mon Oct 12 20:50:16 2009
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 8FC03106568B
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Oct 2009 20:50:16 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E8FF8FC1C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Oct 2009 20:50:16 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n9CKoF8x028870
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Oct 2009 20:50:15 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n9CKoFxv028869;
	Mon, 12 Oct 2009 20:50:15 GMT
	(envelope-from nobody)
Message-Id: <200910122050.n9CKoFxv028869@www.freebsd.org>
Date: Mon, 12 Oct 2009 20:50:15 GMT
From: Dirk-Willem van Gulik <dirkx@webweaving.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: reconnecting a firewire disk does not cause the disklabel to update correctly/invalidate the cache
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         139549
>Category:       kern
>Synopsis:       [firewire] reconnecting a firewire disk does not cause the disklabel to update correctly/invalidate the cache
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-firewire
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 12 21:00:06 UTC 2009
>Closed-Date:    
>Last-Modified:  Sat Oct 31 18:00:11 UTC 2009
>Originator:     Dirk-Willem van Gulik
>Release:        7.2-Release
>Organization:
Private Individual
>Environment:
FreeBSD  7.2-RELEASE FreeBSD 7.2-RELEASE #0: Sun Oct 11 14:20:49 CEST 2009     root@:/usr/src/sys/i386/compile/GENERIC  i386

>Description:
Connecting a different firewire disk whilst _not_ changing the enclosure
does not cause the disklabel to be updated correctly. I.e. some older
cached entry is seen.


>How-To-Repeat:
Required
- machine with 7.2
- ONE firewire enclosure
- two disks which can be plugged into above enclosure; one at the time,

To reproduce:

0) Create two formatted IDE disk; e.g. one with a single s1c partition
   covering the whole disk and the other with a few s1a, s1d or similar
   - i.e. a default freebsd install.

1) Install 7.2 as-is.

2) Wire the first disk into the enclosure; and plug it into firewire. 

3) Usual dmesg/camcontrol status will show it is there.

4) Check you can mount something like 'mount /dev/da4s1c' as expected.

5) Now unplug the firewire; and swap the second disk into the enclosure.

6) Plug in the firewire - and observe dmesg to pick it up.

HOWEVER notice that the /dev/da4*** entry is still the same - it has
not updated for the fact that disk 2 contained a a, d, e and f partition.

>Fix:
Sometimes (though not always) a 'disklabel -e' followed by a write of
the label will cause the /dev/ devices to update.

However this only seems to be the case for some labels - NTFS, FAT and
various linux partitions do not seem to be that easily 'seen'.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-firewire 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Oct 13 00:06:45 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

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

From: Sean Bruno <sean.bruno@dsl-only.net>
To: bug-followup@FreeBSD.org, dirkx@webweaving.org
Cc:  
Subject: Re: kern/139549: [firewire] reconnecting a firewire disk does not
 cause the disklabel to update correctly/invalidate the cache
Date: Tue, 13 Oct 2009 17:08:03 -0700

 pre-8.0 has a default of "3" set to the sysctl "firewire.hold_count" or
 some such thing that keeps the disconnect/removal of a firewire device
 from doing "things".
 
 Try setting that value to "1" and see if the problem manifests itself.
 
 Sean
 

From: Dirk-Willem van Gulik <Dirk-Willem.van.Gulik@bbc.co.uk>
To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-firewire@FreeBSD.org
Cc:  
Subject: kern/139549: [firewire] reconnecting a firewire disk does not cause
 the disklabel to update correctly/invalidate the cache
Date: Sat, 31 Oct 2009 18:29:55 +0100

 Sean wrote:
 
 > pre-8.0 has a default of "3" set to the sysctl "firewire.hold_count" or
 > some such thing that keeps the disconnect/removal of a firewire device
 > from doing "things".
 >
 > Try setting that value to "1" and see if the problem manifests itself.
 
 Regardless of the setting - it seems that the disklabel continues to be 
 cached - and thus no updating of the /dev's (e.g. matching the actual 
 slices/partitions) happens.
 
 I guess that we need a
 
 	firewire.force_update_on_reconnect
 
 which completley wacks any disklabel/da -or- perhaps abandons trying to 
 use the lowest number possible; but keeps on counting it as a higher one.
 
 Thanks,
 
 Dw
 
 http://www.bbc.co.uk/
 This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
 If you have received it in error, please delete it from your system.
 Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
 Please note that the BBC monitors e-mails sent or received.
 Further communication will signify your consent to this.
 					
>Unformatted:
