PERFORCE change 121644 for review
    Ulf Lilleengen 
    lulf at FreeBSD.org
       
    Thu Jun 14 18:04:13 UTC 2007
    
    
  
http://perforce.freebsd.org/chv.cgi?CH=121644
Change 121644 by lulf at lulf_carrot on 2007/06/14 18:03:54
	- Make sure we NULL out the last_read_plex so we don't get a panic after
	  a detach and a volume tries to read.
	 	- Fix a memory leak where I forgot to set the GV_BIO_MALLOC flag.
Affected files ...
.. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_subr.c#8 edit
.. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_volume.c#5 edit
Differences ...
==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_subr.c#8 (text+ko) ====
@@ -1155,6 +1155,8 @@
 		return (GV_ERR_ISOPEN);
 	}
 	v->plexcount--;
+	/* Make sure someone don't read us when gone. */
+	v->last_read_plex = NULL; 
 	LIST_REMOVE(p, in_volume);
 	p->vol_sc = NULL;
 	memset(p->volume, 0, GV_MAXVOLNAME);
==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_volume.c#5 (text+ko) ====
@@ -242,10 +242,9 @@
 	bp->bio_offset = offset;
 	bp->bio_caller2 = to;
 	bp->bio_cmd = type;
-	if (data == NULL) {
+	if (data == NULL)
 		data = g_malloc(length, M_WAITOK);
-		bp->bio_cflags |= GV_BIO_MALLOC;
-	}
+	bp->bio_cflags |= GV_BIO_MALLOC; /* Free on the next run. */
 	bp->bio_data = data;
 
 /*	printf("Sending next bio:\n ");
    
    
More information about the p4-projects
mailing list