]> git.ipfire.org Git - thirdparty/util-linux.git/commit
eject: Check host_status and driver_status when using SG_IO.
authorKarel Zak <kzak@redhat.com>
Tue, 18 Jun 2013 10:24:28 +0000 (12:24 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 18 Jun 2013 10:24:28 +0000 (12:24 +0200)
commit90a0e97c7be9da39fd54600228e006b98667ad56
treec39f5c88f151d5f73de2168f02d3c80f99ac4a67
parentf61a7d1fa622097d535bf6e9477bfb66767fe429
eject: Check host_status and driver_status when using SG_IO.

Based on Suse patch, originally from
Anna Bernathova <anicka@suse.cz>, May 2008

  SG_IO completion status is weird but still well defined. You'll need
  to check both host_status, driver_status and status to determine that
  a command actually succeeded. -- Tejun Heo, May 2008

Note that we also need to check driver_status and sense_buffer to
detect situation when there is no medium. It's valid request to call
eject(8) for device with no medium.

References: https://bugzilla.novell.com/show_bug.cgi?id=358033
Signed-off-by: Anna Bernathova <anicka@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/eject.c