linux/Documentation/userspace-api
Lukas Prediger 67f1e027c2 drivers/cdrom: improved ioctl for media change detection
The current implementation of the CDROM_MEDIA_CHANGED ioctl relies on
global state, meaning that only one process can detect a disc change
while the ioctl call will return 0 for other calling processes afterwards
(see bug 213267).

This introduces a new cdrom ioctl, CDROM_TIMED_MEDIA_CHANGE, that
works by maintaining a timestamp of the last detected disc change instead
of a boolean flag: Processes calling this ioctl command can provide
a timestamp of the last disc change known to them and receive
an indication whether the disc was changed since then and the updated
timestamp.

I considered fixing the buggy behavior in the original
CDROM_MEDIA_CHANGED ioctl but that would require maintaining state
for each calling process in the kernel, which seems like a worse
solution than introducing this new ioctl.

Signed-off-by: Lukas Prediger <lumip@lumip.de>
Link: https://lore.kernel.org/all/20210912191207.74449-1-lumip@lumip.de
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210913230942.1188-1-phil@philpotter.co.uk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-14 20:05:26 -06:00
..
accelerators Documentation: ocxl.rst: change FPGA indirect article to an 2021-06-09 14:51:25 +02:00
ebpf docs/bpf: Add bpf() syscall command reference 2021-03-04 18:39:46 -08:00
ioctl drivers/cdrom: improved ioctl for media change detection 2021-09-14 20:05:26 -06:00
media media: v4l2-ctrls: Add intra-refresh period control 2021-08-04 14:43:52 +02:00
index.rst Documentation: Add documentation for VDUSE 2021-09-06 07:20:58 -04:00
iommu.rst docs: IOMMU user API 2020-10-01 14:52:46 +02:00
landlock.rst docs: userspace-api: landlock.rst: avoid using ReST :doc:foo markup 2021-06-17 13:24:39 -06:00
no_new_privs.rst doc: ReSTify no_new_privs.txt 2017-05-18 10:30:09 -06:00
seccomp_filter.rst Documentation: seccomp: Fix typo in user notification 2021-07-02 10:39:45 -07:00
spec_ctrl.rst Documentation: Add L1D flushing Documentation 2021-07-28 11:42:25 +02:00
sysfs-platform_profile.rst Documentation: Add documentation for new platform_profile sysfs attribute 2020-12-30 18:28:57 +01:00
unshare.rst doc-rst: fix inline emphasis in unshare.rst 2017-05-18 10:23:10 -06:00
vduse.rst Documentation: Add documentation for VDUSE 2021-09-06 07:20:58 -04:00