Util-Linux Archive on lore.kernel.org
 help / color / 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
Message-ID: <20200107161918.GX4113@kitsune.suse.cz> (raw)
In-Reply-To: <20200107160443.y72na25i5fk72zqt@>

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.



  reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 20:23 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 publically 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:

* 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 \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Util-Linux Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/util-linux/0 util-linux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 util-linux util-linux/ https://lore.kernel.org/util-linux \
	public-inbox-index util-linux

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git