Subject: bin/34236: some problems with CGD-device creation similar on "race condition" problem
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <fenicottero@gmail.com>
List: netbsd-bugs
Date: 08/19/2006 15:15:00
>Number:         34236
>Category:       bin
>Synopsis:       some problems with CGD-device creation similar on "race condition" problem
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 19 15:15:00 +0000 2006
>Originator:     Oleg Pilyavets
>Release:        3.0-stable
>Organization:
Lebedev Physical Institute
>Environment:
NetBSD drummer.intranet.lebedev.ru 3.0 NetBSD 3.0 (MYKERNEL) #5: Sun Jun 18 03:30:04 MSD 2006  root@spinor.triniti.nat:/usr/src/sys/arch/i386/compile/MYKERNEL i386
>Description:
I have a computer with the next parameters:
233MG cpu, 196Mb RAM.
In my case it was the next situation: from one hard disk to another many gigabites was written during several hours (one 8Gb encrypted rar arxive was unraring and writing to cgd-device). I tried to create extra cgd-device in the same moment, but the next eror sometimes occurd:

# cd /home/myuser
# cgdconfig -g -o /etc/cgd/wd1i -V disklabel aes-cbc 256 
cgdconfig: could not calibrate pkcs5_pbkdf2
cgdconfig: Failed to generate defaults for keygen
#

In addition to vnconfig wrote sometimes:

# cd /etc/cgd
# vnconfig -l
vnconfig: VNDIOCGET: Inappropriate ioctl for device
#

and:

# cd /etc/cgd
# vnconfig -l vnd0
vnconfig: VNDIOCGET: Inappropriate ioctl for device
# vnconfig -l vnd1
vnd1: not in use
# vnconfig -l vnd2
vnd2: not in use
# vnconfig -l vnd3
vnd3: not in use
#

As the resault I could not create and configure extra cgd-device before rebooting my system.
>How-To-Repeat:
It's enough difficult to repeat this problem but I heard from other NetBSD users that they had the same situation
(cgdconfig: could not calibrate pkcs5_pbkdf2
cgdconfig: Failed to generate defaults for keygen) 
trying to create cgd-device.

>Fix:
Temporarily, rebooting of the system solves this problem.