On Tue, Sep 14, 2021 at 08:05:41PM -0600, Jens Axboe wrote: > On 9/13/21 5:09 PM, Phillip Potter wrote: > > From: Lukas Prediger <lumip@xxxxxxxx> > > > > 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. > > Applied for 5.16, thanks. > > -- > Jens Axboe > Many thanks Jens. Regards, Phil