From nobody@FreeBSD.org  Mon Jun 10 22:29:33 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id ACAA4947
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 Jun 2013 22:29:33 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	by mx1.freebsd.org (Postfix) with ESMTP id 9FC1417AF
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 Jun 2013 22:29:33 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r5AMTXbe067257
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 Jun 2013 22:29:33 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r5AMTXp2067256;
	Mon, 10 Jun 2013 22:29:33 GMT
	(envelope-from nobody)
Message-Id: <201306102229.r5AMTXp2067256@oldred.freebsd.org>
Date: Mon, 10 Jun 2013 22:29:33 GMT
From: Alberto Villa <avilla@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] sysutils/hal: remove disk duplicate entries
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         179469
>Category:       ports
>Synopsis:       [patch] sysutils/hal: remove disk duplicate entries
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    avilla
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 10 22:30:00 UTC 2013
>Closed-Date:    Mon Oct 14 13:44:14 UTC 2013
>Last-Modified:  Mon Oct 14 13:50:02 UTC 2013
>Originator:     Alberto Villa
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
FreeBSD indiana.smith 10.0-CURRENT FreeBSD 10.0-CURRENT #4 r251249: Sun Jun  2 14:14:46 CEST 2013     root@indiana.smith:/usr/obj/usr/src/sys/HPDV6  amd64
>Description:
Since r249508 (http://svnweb.freebsd.org/changeset/base/249508) on HEAD disk labels are duplicated to /dev/diskid/. HAL creates entries for both copies.
>How-To-Repeat:
Insert an USB drive and check lshal(1) for entries with the same volume-uuid.
>Fix:
Discard any GEOM object with device name matching "diskid/*". It appears there is no other obvious information which can be used to match the devices easily, so a string check is the quicker solution (volume-uuid would work only for some kind of entries).

The patch has obviously no effect on FreeBSD 9-.

Patch attached with submission follows:

Index: /usr/ports/sysutils/hal/Makefile
===================================================================
--- /usr/ports/sysutils/hal/Makefile	(revision 320124)
+++ /usr/ports/sysutils/hal/Makefile	(working copy)
@@ -4,7 +4,7 @@
 
 PORTNAME=	hal
 DISTVERSION=	0.5.14
-PORTREVISION=	20
+PORTREVISION=	21
 CATEGORIES=	sysutils
 MASTER_SITES=	http://hal.freedesktop.org/releases/
 
Index: /usr/ports/sysutils/hal/files/patch-hald_hf-storage.c
===================================================================
--- /usr/ports/sysutils/hal/files/patch-hald_hf-storage.c	(revision 320124)
+++ /usr/ports/sysutils/hal/files/patch-hald_hf-storage.c	(working copy)
@@ -1,5 +1,5 @@
---- hald/freebsd/hf-storage.c.orig	2009-08-24 08:42:29.000000000 -0400
-+++ hald/freebsd/hf-storage.c	2011-07-20 20:52:51.000000000 -0400
+--- ./hald/freebsd/hf-storage.c.orig	2009-08-24 14:42:29.000000000 +0200
++++ ./hald/freebsd/hf-storage.c	2013-06-10 16:22:36.080280935 +0200
 @@ -30,6 +30,7 @@
  #include <limits.h>
  #include <inttypes.h>
@@ -8,7 +8,18 @@
  #include <sys/param.h>
  #include <sys/types.h>
  #include <sys/disklabel.h>
-@@ -418,10 +419,41 @@ hf_storage_parse_conftxt (const char *co
+@@ -174,6 +175,10 @@ hf_storage_device_probe_geom (HalDevice 
+   if (! geom_obj)
+     return;
+ 
++  /* Exclude /dev/diskid/ labels as they are duplicates. */
++  if (strncmp(geom_obj->dev, "diskid/", 7) == 0)
++    return;
++
+   node = g_node_find(hf_storage_geom_tree, G_PRE_ORDER, G_TRAVERSE_ALL,
+                      GUINT_TO_POINTER(geom_obj->hash));
+ 
+@@ -418,10 +423,41 @@ hf_storage_parse_conftxt (const char *co
  	  continue;
  	}
  
@@ -50,7 +61,7 @@
        geom_obj->type = -1;	/* We use -1 here to denote a missing type. */
        geom_obj->hash = hash;
  
-@@ -458,6 +490,13 @@ hf_storage_parse_conftxt (const char *co
+@@ -458,6 +494,13 @@ hf_storage_parse_conftxt (const char *co
                              {
                                g_free(geom_obj->class);
  			      geom_obj->class = g_strdup(fields[12]);
@@ -64,7 +75,7 @@
  			    }
  			}
  		    }
-@@ -589,11 +628,18 @@ hf_storage_devd_notify (const char *syst
+@@ -589,11 +632,18 @@ hf_storage_devd_notify (const char *syst
    char *conftxt;
    GSList *new_disks;
  
@@ -84,7 +95,7 @@
    new_disks = hf_storage_parse_conftxt(conftxt);
    g_free(conftxt);
  
-@@ -669,7 +715,7 @@ hf_storage_conftxt_timeout_cb (gpointer 
+@@ -669,7 +719,7 @@ hf_storage_conftxt_timeout_cb (gpointer 
    if (hf_is_waiting)
      return TRUE;
  


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->gnome 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Jun 10 22:30:08 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=179469 
Responsible-Changed-From-To: gnome->avilla 
Responsible-Changed-By: avilla 
Responsible-Changed-When: Mon Oct 14 13:41:07 UTC 2013 
Responsible-Changed-Why:  
Taking after maintainer timeout. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=179469 
State-Changed-From-To: open->closed 
State-Changed-By: avilla 
State-Changed-When: Mon Oct 14 13:44:14 UTC 2013 
State-Changed-Why:  
Patch committed. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/179469: commit references a PR
Date: Mon, 14 Oct 2013 13:42:00 +0000 (UTC)

 Author: avilla
 Date: Mon Oct 14 13:41:51 2013
 New Revision: 330321
 URL: http://svnweb.freebsd.org/changeset/ports/330321
 
 Log:
   - Remove disk duplicate entries on FreeBSD 10+.
   - Bump PORTREVISION.
   
   PR:		179469
   Submitted by:	avilla (myself)
   Approved by:	gnome (maintainer timeout)
 
 Modified:
   head/sysutils/hal/Makefile
   head/sysutils/hal/files/patch-hald_hf-storage.c   (contents, props changed)
 
 Modified: head/sysutils/hal/Makefile
 ==============================================================================
 --- head/sysutils/hal/Makefile	Mon Oct 14 13:40:48 2013	(r330320)
 +++ head/sysutils/hal/Makefile	Mon Oct 14 13:41:51 2013	(r330321)
 @@ -4,7 +4,7 @@
  
  PORTNAME=	hal
  DISTVERSION=	0.5.14
 -PORTREVISION=	20
 +PORTREVISION=	21
  CATEGORIES=	sysutils
  MASTER_SITES=	http://hal.freedesktop.org/releases/
  
 
 Modified: head/sysutils/hal/files/patch-hald_hf-storage.c
 ==============================================================================
 --- head/sysutils/hal/files/patch-hald_hf-storage.c	Mon Oct 14 13:40:48 2013	(r330320)
 +++ head/sysutils/hal/files/patch-hald_hf-storage.c	Mon Oct 14 13:41:51 2013	(r330321)
 @@ -1,5 +1,5 @@
 ---- hald/freebsd/hf-storage.c.orig	2009-08-24 08:42:29.000000000 -0400
 -+++ hald/freebsd/hf-storage.c	2011-07-20 20:52:51.000000000 -0400
 +--- ./hald/freebsd/hf-storage.c.orig	2009-08-24 14:42:29.000000000 +0200
 ++++ ./hald/freebsd/hf-storage.c	2013-06-10 16:22:36.080280935 +0200
  @@ -30,6 +30,7 @@
   #include <limits.h>
   #include <inttypes.h>
 @@ -8,7 +8,18 @@
   #include <sys/param.h>
   #include <sys/types.h>
   #include <sys/disklabel.h>
 -@@ -418,10 +419,41 @@ hf_storage_parse_conftxt (const char *co
 +@@ -174,6 +175,10 @@ hf_storage_device_probe_geom (HalDevice 
 +   if (! geom_obj)
 +     return;
 + 
 ++  /* Exclude /dev/diskid/ labels as they are duplicates. */
 ++  if (strncmp(geom_obj->dev, "diskid/", 7) == 0)
 ++    return;
 ++
 +   node = g_node_find(hf_storage_geom_tree, G_PRE_ORDER, G_TRAVERSE_ALL,
 +                      GUINT_TO_POINTER(geom_obj->hash));
 + 
 +@@ -418,10 +423,41 @@ hf_storage_parse_conftxt (const char *co
   	  continue;
   	}
   
 @@ -50,7 +61,7 @@
         geom_obj->type = -1;	/* We use -1 here to denote a missing type. */
         geom_obj->hash = hash;
   
 -@@ -458,6 +490,13 @@ hf_storage_parse_conftxt (const char *co
 +@@ -458,6 +494,13 @@ hf_storage_parse_conftxt (const char *co
                               {
                                 g_free(geom_obj->class);
   			      geom_obj->class = g_strdup(fields[12]);
 @@ -64,7 +75,7 @@
   			    }
   			}
   		    }
 -@@ -589,11 +628,18 @@ hf_storage_devd_notify (const char *syst
 +@@ -589,11 +632,18 @@ hf_storage_devd_notify (const char *syst
     char *conftxt;
     GSList *new_disks;
   
 @@ -84,7 +95,7 @@
     new_disks = hf_storage_parse_conftxt(conftxt);
     g_free(conftxt);
   
 -@@ -669,7 +715,7 @@ hf_storage_conftxt_timeout_cb (gpointer 
 +@@ -669,7 +719,7 @@ hf_storage_conftxt_timeout_cb (gpointer 
     if (hf_is_waiting)
       return TRUE;
   
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
