kern/65956: [patch] vinum: bug in detached subdisk config

Dmitry Morozovsky marck at rinet.ru
Sun Apr 25 06:00:41 PDT 2004


>Number:         65956
>Category:       kern
>Synopsis:       [patch] vinum: bug in detached subdisk config
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 25 06:00:40 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Morozovsky
>Release:        FreeBSD 4-STABLE i386
>Organization:
Cronyx Plus LLC (RiNet ISP)
>Environment:
System: FreeBSD 4-STABLE 


>Description:

When a subdisk has been created without plex attached to, or when detaching, vinum
writes incorrect line in on-disk config, so after stop-start cycle (or after reboot)
it cannot interpret it.

>How-To-Repeat:

[Assume ad0s1h is freshly created or cleared by `vinum resetconfig']

# echo drive test device /dev/ad0s1h >/tmp/vinum0
# kldload vinum
vinum: loaded
# vinum create /tmp/vinum0
vinum: drive test is up
1 drives:
D test                  State: up       Device /dev/ad0s1h      Avail: 32515/32516 MB (100%)

0 volumes:
0 plexes:
0 subdisks:
# echo sd name test.p0.s0 len 1g drive test >/tmp/vinum1
# vinum create /tmp/vinum1
1 drives:
D test                  State: up       Device /dev/ad0s1h      Avail: 31491/32516 MB (96%)

0 volumes:
0 plexes:
1 subdisks:
S test.p0.s0            State: empty    (detached)      Size:       1024 MB
# vinum printconfig
# Vinum configuration of , saved at Mon Apr 26 00:20:29 2004
drive test device /dev/ad0s1h
sd name test.p0.s0 drive test detached len 2097152s driveoffset 265s
# vinum dumpconfig
Drive test:     Device /dev/ad0s1h
                Created on  at Mon Apr 26 00:19:35 2004
                Config last updated Mon Apr 26 00:20:24 2004
                Size:      34095612416 bytes (32516 MB)
sd name test.p0.s0 drive test plex  len 2097152s driveoffset 265s state empty detached 

Drive /dev/ad0s1h: 31 GB (34095612416 bytes)
# vinum stop
vinum: unloaded
vinum unloaded
# vinum start
vinum: loaded
vinum: reading configuration from /dev/ad0s1h
vinum: test.p0.s0: invalid keyword: 2097152s
Disabling configuration updates
vinum: No space for  on test
*** Warning: configuration updates are disabled. ***
*** Warning: configuration updates are disabled. ***


>Fix:
Move plexname to the end of config line, where 'detached' attribute resides fixes the problem.

Index: sys/dev/vinum/vinumio.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/vinum/vinumio.c,v
retrieving revision 1.52.2.7
diff -u -r1.52.2.7 vinumio.c
--- sys/dev/vinum/vinumio.c	9 Mar 2004 10:18:47 -0000	1.52.2.7
+++ sys/dev/vinum/vinumio.c	25 Apr 2004 12:43:12 -0000
@@ -559,10 +559,9 @@
 		drivename = "*invalid*";
 	    snprintf(s,
 		configend - s,
-		"sd name %s drive %s plex %s len %llus driveoffset %llus state %s",
+		"sd name %s drive %s len %llus driveoffset %llus state %s",
 		sd->name,
 		drivename,
-		vinum_conf.plex[sd->plexno].name,
 		(unsigned long long) sd->sectors,
 		(unsigned long long) sd->driveoffset,
 		sd_state(sd->state));
@@ -571,7 +570,8 @@
 	    if (sd->plexno >= 0)
 		snprintf(s,
 		    configend - s,
-		    " plexoffset %llds",
+		    " plex %s plexoffset %llds",
+		    vinum_conf.plex[sd->plexno].name,
 		    (long long) sd->plexoffset);
 	    else
 		snprintf(s, configend - s, " detached");
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list