lkml.org 
[lkml]   [2008]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[RFC] cdrom weirdness
1) CDROM_LOCKDOOR sets a global variable (keeplocked) that affects all
cdroms. Intentional?

2) cdrom_dvd_rw_close_write() call can be delayed indefinitely by keeping
an ioctl-only (opened with O_NDELAY) descriptor.

3) open cdrom for data, have the door locked, keep fd opened.
open it again for write, have the open fail and cleanup in cdrom_open()
will happily unlock the door for you. I'd change that to "lock if we
had no lockers, unlock on failure exit if we did lock", but there's
an interesting comment:
/* Something failed. Try to unlock the drive, because some drivers
(notably ide-cd) lock the drive after every command.
...
What the hell is that about? It's not "some drivers", AFAICT - it's
been done explicitly in open_for_data(). Or is there something
really driver-specific in it?

4) while we are at it, if you clear lockdoor via sysctl while something has
cdrom opened - no unlock on close for you.

5) autoeject happens on the last close *IF* the last file happens to be
opened for data. IOW, if some crap has opened it ioctl-only and kept
that opened after everyone else has closed - no autoeject for you.

6) /*
* flush cache on last write release
*/
if (CDROM_CAN(CDC_RAM) && !cdi->use_count && cdi->for_data)
cdrom_close_write(cdi);
is interesting, seeing that nothing has ever touched ->for_data, for
values of "ever" including "since the code in question had been merged
into the tree"...


\
 
 \ /
  Last update: 2008-12-04 05:17    [W:0.033 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site