patchGNU cpio - Patches: patch #9263, Open device with O_NONBLOCK option


You are not allowed to post comments on this tracker with your current authentication level.

patch #9263: Open device with O_NONBLOCK option

Submitter:  Alexey Svistunov <svalx>
Submitted:  Fri 17 Feb 2017 12:55:08 PM UTC
Category:  None Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open

Sun 07 Mar 2021 06:45:39 PM UTC, comment #1: 

Ping - any chance that this change will still be merged? We're still carrying it downstream in openSUSE / SLES via

Fri 17 Feb 2017 12:55:08 PM UTC, original submission:  

When running the 2.6 kernel, "mt -f /dev/nst0 status" blocks if there is no media in the drive.  The same occurs for other commands.

When running the 2.4.24 kernel, "mt -f /dev/nst0 status" does not block when there is no tape in the drive.

This behavior change is documented for the 2.6 kernel (see
kernel-source-2.6.3/Documentation/scsi/st.txt for the full doc):

If the open option O_NONBLOCK is used, open succeeds even if the
drive is not ready. If O_NONBLOCK is not used, the driver waits for the drive to become ready. If this does not happen in ST_BLOCK_SECONDS seconds, open fails with the errno value EIO. With O_NONBLOCK the device can be opened for writing even if there is a write protected tape in the drive (commands trying to write something return error if attempted).

It appears that the use of O_NONBLOCK is safe with pre-2.6 kernels. Suggest adding the use of O_NONBLOCK when opening the device. As it is, for long-running commands such as "fsf", one cannot tell if the command is progressing or if it's blocking waiting for media.


Alexey Svistunov <svalx>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #39774:  cpio-open_nonblock.patch added by svalx (1KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by ddiss (Posted a comment)
  • -email is unavailable- added by svalx (Submitted the item)
  • -email is unavailable- added by svalx

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-17 svalx Attached File- Added cpio-open_nonblock.patch, #39774
        Carbon-Copy- Added svalx

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code