All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michal Suchánek" <msuchanek@suse.de>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] blkid: open device in nonblock mode.
Date: Tue, 7 Jan 2020 17:19:18 +0100	[thread overview]
Message-ID: <20200107161918.GX4113@kitsune.suse.cz> (raw)
In-Reply-To: <20200107160443.y72na25i5fk72zqt@10.255.255.10>

On Tue, Jan 07, 2020 at 05:04:43PM +0100, Karel Zak wrote:
> On Mon, Nov 04, 2019 at 09:23:15PM +0100, Michal Suchanek wrote:
> > When autoclose is set (kernel default but many distributions reverse the
> > setting) opening a CD-rom device causes the tray to close.
> 
> I found unwanted side effect, open() with O_NONBLOCK also successes
> when there is no medium. Unfortunately, we ignore I/O errors for
> CDROMs to support some crazy hybrid media -- so overall result is many
> I/O warnings in system logs.
> 
> I have added CDROM_DRIVE_STATUS to the logic to stop probing when
> there is no medium. Let's hope it will be enough:
> 
> https://github.com/karelzak/util-linux/commit/dc30fd4383e57a0440cdb0e16ba5c4336a43b290

It it probably safer to do
switch (ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT)) {
to support some crazy CD changers.

Thanks

Michal

  reply	other threads:[~2020-01-07 16:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 20:23 [PATCH] blkid: open device in nonblock mode Michal Suchanek
2019-11-05 11:41 ` Karel Zak
2019-11-05 17:13   ` Michal Suchánek
2019-11-06  8:02     ` Michal Suchánek
2019-11-06  8:48       ` Karel Zak
2019-11-06  9:45         ` Michal Suchánek
2019-11-12  8:27         ` Anatoly Pugachev
2019-11-12  8:58           ` Karel Zak
2019-11-06  9:00 ` Karel Zak
2020-01-07 16:04 ` Karel Zak
2020-01-07 16:19   ` Michal Suchánek [this message]
2020-01-08  8:25     ` Karel Zak

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=20200107161918.GX4113@kitsune.suse.cz \
    --to=msuchanek@suse.de \
    --cc=kzak@redhat.com \
    --cc=util-linux@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.