From stijn@pcwin002.win.tue.nl  Thu Apr 28 08:15:57 2005
Return-Path: <stijn@pcwin002.win.tue.nl>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 80DFF16A4CE; Thu, 28 Apr 2005 08:15:57 +0000 (GMT)
Received: from pastinakel.tue.nl (pastinakel.tue.nl [131.155.2.7])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 02B9443D5D; Thu, 28 Apr 2005 08:15:57 +0000 (GMT)
	(envelope-from stijn@pcwin002.win.tue.nl)
Received: by pastinakel.tue.nl (Postfix, from userid 40)
	id E9B1814BF94; Thu, 28 Apr 2005 10:15:55 +0200 (CEST)
Received: from pcwin002.win.tue.nl (pcwin002.win.tue.nl [131.155.71.72])
	by pastinakel.tue.nl (Postfix) with ESMTP id 7FCEB14BF36;
	Thu, 28 Apr 2005 10:15:55 +0200 (CEST)
Received: (from stijn@localhost)
	by pcwin002.win.tue.nl (8.13.3/8.13.1/Submit) id j3S8FtUs001666;
	Thu, 28 Apr 2005 10:15:55 +0200 (CEST)
	(envelope-from stijn)
Message-Id: <200504280815.j3S8FtUs001666@pcwin002.win.tue.nl>
Date: Thu, 28 Apr 2005 10:15:55 +0200 (CEST)
From: Stijn Hoop <stijn@win.tue.nl>
Reply-To: Stijn Hoop <stijn@win.tue.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Lukas Ertl <le@freebsd.org>
Subject: gvinum checkparity corrupts striped plexes
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         80427
>Category:       kern
>Synopsis:       gvinum checkparity corrupts striped plexes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 28 08:20:14 GMT 2005
>Closed-Date:    Thu Apr 28 13:09:30 GMT 2005
>Last-Modified:  Thu Apr 28 13:09:30 GMT 2005
>Originator:     Stijn Hoop
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD pcwin002.win.tue.nl 6.0-CURRENT FreeBSD 6.0-CURRENT #12: Mon Mar 7 13:25:42 CET 2005 stijn@pcwin002.win.tue.nl:/usr/obj/usr/src/sys/PCWIN002 i386

>Description:

The gvinum command allows one to run checkparity on a striped plex. While
in itself this would be innocuous, it appears that the parity verification
actually writes bogus data to disk, leading to filesystem corruption.

>How-To-Repeat:

[stijn@pcwin002] <~> ls /local/storage
config-20050428.tar.gz                  subversion-20050428.tar.gz
foo                                     subversion-config-20050428.tar.gz
mail-20050428.tar.gz                    www-default-20050428.tar.gz
mailman-20050428.tar.gz                 www-logs-20050428.tar.gz
mysql-20050428.gz                       www-sandcat-20050428.tar.gz
postgresql                              www-whiskey-20050428.tar.gz
[stijn@pcwin002] <~> sudo umount /local/storage
[stijn@pcwin002] <~> sudo gvinum
gvinum -> lv -r
1 volume:
V storage               State: up       Plexes:       1 Size:        111 GB
P storage.p0          S State: up       Subdisks:     2 Size:        111 GB
S storage.p0.s0         State: up       D: meg          Size:         55 GB
S storage.p0.s1         State: up       D: herc         Size:         55 GB
gvinum -> checkparity -v storage.p0
Checking at 54 MB ... ^C
[stijn@pcwin002] <~> sudo fsck_ffs /dev/gvinum/storage
** /dev/gvinum/storage
Cannot find file system superblock
ioctl (GCINFO): Inappropriate ioctl for device
fsck_ffs: /dev/gvinum/storage: can't read disk label

>Fix:

Check for the correct type of plex before initiating a parity check request.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: le 
State-Changed-When: Thu Apr 28 13:09:18 GMT 2005 
State-Changed-Why:  
Thank you, good catch.  I've committed a fix. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=80427 
>Unformatted:
