linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/10] Fix cdrom autoclose
@ 2019-11-21 17:13 Michal Suchanek
  2019-11-21 17:13 ` [PATCH v4 01/10] cdrom: add poll_event_interruptible Michal Suchanek
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: Michal Suchanek @ 2019-11-21 17:13 UTC (permalink / raw)
  To: linux-scsi, linux-block
  Cc: Michal Suchanek, Jonathan Corbet, Jens Axboe,
	James E.J. Bottomley, Martin K. Petersen, Alexander Viro,
	Eric Biggers, J. Bruce Fields, Mauro Carvalho Chehab,
	Benjamin Coddington, Ming Lei, Chaitanya Kulkarni,
	Bart Van Assche, Damien Le Moal, Hou Tao, Pavel Begunkov,
	linux-kernel, linux-fsdevel, Jan Kara, Hannes Reinecke,
	Ewan D. Milne, Christoph Hellwig, Matthew Wilcox

Hello,

there is cdrom autoclose feature that is supposed to close the tray,
wait for the disc to become ready, and then open the device.

This used to work in ancient times. Then in old times there was a hack
in util-linux which worked around the breakage which probably resulted
from switching to scsi emulation.

Currently util-linux maintainer refuses to merge another hack on the
basis that kernel still has the feature so it should be fixed there.
The code needs not be replicated in every userspace utility like mount
or dd which has no business knowing which devices are CD-roms and where
the autoclose setting is in the kernel.

v3:
- change the VMware workaround to use blacklist flag
- use exported function instead of ioctl
v4:
- fix crash reported by kernel test robot
- fix the debug message logic while refactoring cdrom_open
- move repeated code out of __blkdev_get

Link: https://lore.kernel.org/lkml/cover.1571834862.git.msuchanek@suse.de/
Link: https://lore.kernel.org/lkml/cover.1513263482.git.msuchanek@suse.de/

Michal Suchanek (10):
  cdrom: add poll_event_interruptible
  cdrom: factor out common open_for_* code
  cdrom: wait for the tray to close
  cdrom: export autoclose logic as a separate function
  cdrom: unify log messages.
  bdev: reset first_open when looping in __blkget_dev
  bdev: separate parts of __blkdev_get as helper functions
  bdev: add open_finish
  scsi: blacklist: add VMware ESXi cdrom - broken tray emulation
  scsi: sr: wait for the medium to become ready

 Documentation/filesystems/locking.rst |   2 +
 drivers/cdrom/cdrom.c                 | 471 +++++++++++++-------------
 drivers/scsi/scsi_devinfo.c           |  15 +-
 drivers/scsi/sr.c                     |  60 +++-
 fs/block_dev.c                        |  80 +++--
 include/linux/blkdev.h                |   1 +
 include/linux/cdrom.h                 |   1 +
 include/scsi/scsi_devinfo.h           |   7 +-
 8 files changed, 360 insertions(+), 277 deletions(-)

-- 
2.23.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-11-21 23:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 17:13 [PATCH v4 00/10] Fix cdrom autoclose Michal Suchanek
2019-11-21 17:13 ` [PATCH v4 01/10] cdrom: add poll_event_interruptible Michal Suchanek
2019-11-21 17:13 ` [PATCH v4 02/10] cdrom: factor out common open_for_* code Michal Suchanek
2019-11-21 17:13 ` [PATCH v4 03/10] cdrom: wait for the tray to close Michal Suchanek
2019-11-21 17:13 ` [PATCH v4 04/10] cdrom: export autoclose logic as a separate function Michal Suchanek
2019-11-21 17:13 ` [PATCH v4 05/10] cdrom: unify log messages Michal Suchanek
2019-11-21 17:13 ` [PATCH v4 06/10] bdev: reset first_open when looping in __blkget_dev Michal Suchanek
2019-11-21 17:13 ` [PATCH v4 07/10] bdev: separate parts of __blkdev_get as helper functions Michal Suchanek
2019-11-21 17:13 ` [PATCH v4 08/10] bdev: add open_finish Michal Suchanek
2019-11-21 17:13 ` [PATCH v4 09/10] scsi: blacklist: add VMware ESXi cdrom - broken tray emulation Michal Suchanek
2019-11-21 17:13 ` [PATCH v4 10/10] scsi: sr: wait for the medium to become ready Michal Suchanek
2019-11-21 19:00 ` [PATCH v4 00/10] Fix cdrom autoclose Jens Axboe
2019-11-21 23:43   ` Michal Suchánek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).