Re: [PATCH] libmount: if ENOMEDIUM and tray is open, close tray and retry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dne 28.7.2017 v 17:26 Stanislav Brabec napsal(a):
> Dne 27.7.2017 v 10:58 Yuriy M. Kaminskiy napsal(a):
>> (And, I used cdrom a long time ago, but IIRC there were some driver
>> settings to automatically close tray on device open, so that this patch
>> should not be needed?)
> 
> Thanks for this hint. Yes, you are true:
> /proc/sys/dev/cdrom/autoclose
> /proc/sys/dev/cdrom/autoeject
> 
> But this does not work with the current mount. The mount request will
> expire on timeout earlier than the tray of ordinary CDROM closes.
> 
> But yes, it is possible to implement a different, simpler patch that
> will make the autoclose feature working, and not cause delays in case of
> no medium.
> 

I did some testing.

The kernel autoclose feature should do exactly the same as my patch
attempts. But kernel seems to be broken. Before the tray actually
closes, kernel returns ENOMEDIUM.

>From strace log when a standard DVD drive is open with a DVD laying on
the tray:

17:30:32.719041 access("/dev/sr0", F_OK) = 0 <0.000005>
(here the tray starts to close)
17:30:32.719054 open("/dev/sr0", O_RDONLY|O_CLOEXEC) = -1 ENOMEDIUM (No
medium found) <1.450436>
...
17:30:34.169943 mount("/dev/sr0", "/mnt", "vfat", MS_MGC_VAL|MS_SILENT,
NULL) = -1 ENOMEDIUM (No medium found) <0.083741>

I am nearly sure that it worked ~20 years ago.

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                         e-mail: sbrabec@xxxxxxxx
Křižíkova 148/34 (Corso IIa)                  tel: +49 911 7405384547
186 00 Praha 8-Karlín                          fax:  +420 284 084 001
Czech Republic                                    http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux