From owner-freebsd-bugs@FreeBSD.ORG Sun Apr 25 06:00:40 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EFAC216A4CF for ; Sun, 25 Apr 2004 06:00:40 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D4FF143D4C for ; Sun, 25 Apr 2004 06:00:40 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i3PD0ebv021312 for ; Sun, 25 Apr 2004 06:00:40 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i3PD0e8Y021304; Sun, 25 Apr 2004 06:00:40 -0700 (PDT) (envelope-from gnats) Resent-Date: Sun, 25 Apr 2004 06:00:40 -0700 (PDT) Resent-Message-Id: <200404251300.i3PD0e8Y021304@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dmitry Morozovsky Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 360AF16A4CE; Sun, 25 Apr 2004 05:52:42 -0700 (PDT) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B45843D54; Sun, 25 Apr 2004 05:52:41 -0700 (PDT) (envelope-from marck@woozle.rinet.ru) Received: from woozle.rinet.ru (localhost [127.0.0.1]) by woozle.rinet.ru (8.12.11/8.12.11) with ESMTP id i3PCqeS8051948; Sun, 25 Apr 2004 16:52:40 +0400 (MSD) (envelope-from marck@woozle.rinet.ru) Received: (from marck@localhost) by woozle.rinet.ru (8.12.11/8.12.11/Submit) id i3PCqeSg051947; Sun, 25 Apr 2004 16:52:40 +0400 (MSD) (envelope-from marck) Message-Id: <200404251252.i3PCqeSg051947@woozle.rinet.ru> Date: Sun, 25 Apr 2004 16:52:40 +0400 (MSD) From: Dmitry Morozovsky To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: grog@FreeBSD.org cc: le@FreeBSD.org Subject: kern/65956: [patch] vinum: bug in detached subdisk config X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Dmitry Morozovsky List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2004 13:00:41 -0000 >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: