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

Submitted by:  Alexey Svistunov <svalx>
Submitted on:  Fri 17 Feb 2017 12:55:08 PM UTC  
 
Category: NonePriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open

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.

See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=239130
https://lists.gnu.org/archive/html/bug-cpio/2005-10/msg00002.html
http://support.novell.com/techcenter/psdb/83539c982ec264af09d616d08211bc88.html

Alexey Svistunov <svalx>

 

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
  • -unavailable- added by svalx (Submitted the item)
  • -unavailable- added by svalx
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 17 Feb 2017 12:55:08 PM UTCsvalxAttached File-=>Added cpio-open_nonblock.patch, #39774
      Carbon-Copy-=>Added svalx

    Back to the top


    Powered by Savane 3.1-cleanup1