NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/49430

The following reply was made to PR bin/49430; it has been noted by GNATS.

From: Paul Goyette <>
To: Kyle Amon <>
Subject: Re: bin/49430
Date: Mon, 23 Jan 2017 16:17:59 +0800 (PHT)

 On Mon, 23 Jan 2017, Kyle Amon wrote:
 >> The previous ktrace clearly showed it opening "cgd0" successfully, in
 >> the current working directory.
 > Mhm, and it shouldn't, because, again, there are no devices there.
 That's why Christos fixed opendisk().
 >> The fix that was committed by Christos results in cgdconfig trying
 >> /dev/rcgd0 and then /dev/rcgd0, explicitly looking in /dev directory.
 >> If both of those fail, it will then look in cwd.  Also note that
 >> cgdconfig specifies to use the "raw" device, not the "cooked" device.
 > Hmm.  I think maybe you meant to write, "/dev/cgd0 and then /dev/rcgd0,"
 > otherwise, I'm confused.  But, shouldn't it look explicitly in the /dev
 > directory?  That's where these devices always are, right?  And certainly
 > never in /etc/cgd, right?
 No, but what I wrote was not really correct.  Here's the real story, 
 which you can confirm by looking at the opendisk(3) man page:
 If the caller specifies "raw device" than it looks in for "/dev/rxxx" 
 while "cooked device looks for "/dev/xxx"
 If that doesn't work, it then appends the whole-disk partition letter 
 and looks for "/dev/rcgd0d" or "/dev/cgd0d".
 Then, if that doesn't work it just uses the specified argument "xxx", 
 and ignores the raw/cooked flag.
 And finally, if that fails, it uses the whole-disk partition letter 
 again, looking for "xxxd" (still ignoring the raw/cooked flag).
 | Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
 | (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at   |
 | Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at |

Home | Main Index | Thread Index | Old Index