All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: axboe@kernel.dk
Cc: linux-kernel@vger.kernel.org
Subject: [RFC] cdrom weirdness
Date: Thu, 4 Dec 2008 04:14:50 +0000	[thread overview]
Message-ID: <20081204041450.GH28946@ZenIV.linux.org.uk> (raw)

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"...

             reply	other threads:[~2008-12-04  4:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04  4:14 Al Viro [this message]
2008-12-04 13:08 ` [RFC] cdrom weirdness Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081204041450.GH28946@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.