Subject: kern/12999: /dev/rcd0a can be opened, but then ops get ENODEV
To: None <gnats-bugs@gnats.netbsd.org>
From: Ross Harvey <ross@ghs.com>
List: netbsd-bugs
Date: 05/21/2001 13:22:11
>Number:         12999
>Category:       kern
>Synopsis:       /dev/rcd0a can be opened, but then ops get ENODEV
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 21 13:21:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Ross Harvey
>Release:        all recent, including -current
>Organization:
	
>Environment:
	all, i think, i386 for sure
System: NetBSD sigmet 1.5U NetBSD 1.5U (skb) #28: Thu Apr 26 19:28:16 PDT 2001 ross@sigmet:/usr/ross/skb i386
Architecture: i386
Machine: i386
>Description:
	you can open /dev/rcd0a, for example, cdparanoia -g /dev/rcd0a ...,
	as it has a fake label, but then you can't do much with it because
	many ops are only supported on the RAW_PART, apparently so they will
	work with no media present.

	but this makes the error completely nonsensical .. if it isn't going
	to support the ops:
		(1) it shouldn't fake up a label for that partition
		(2) it shouldn't allow you to open it
>How-To-Repeat:
	# ktrace -i cdparanoia -g /dev/rcd0a -B 1-99
	# kdump
	watch it open the device successfully, but then
	fail to execute any ioctls, returning ENOTTY
>Fix:
	I might suggest...

	don't fake a label for 0a and do fail the open, or support the ops on
	all partitions. allowing the open and then failing the ops just makes
	it look like our system doesn't work, and gives absolutely no useful
	feedback to the user so he knows what to change
>Release-Note:
>Audit-Trail:
>Unformatted: