Package: mtx
Version: 1.3.12-10
Severity: important

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***

I'm trying to setup a tape changer with mtx and the Amazon Storage Gateway 
while running on unstable.

The autochanger device is an iscsi device emulating an STK-L700.

# tapeinfo -f /dev/sg3
Product Type: Medium Changer
Vendor ID: 'STK     '
Product ID: 'L700            '
Revision: '0103'
Attached Changer API: No
SerialNumber: 'AMZN_SGW-REDACTED_MC_00001'
SCSI ID: 0
SCSI LUN: 0
Ready: no


Running mtx status works correctly (cut at 40 lines here because there
are 3200 slots):

# mtx -f /dev/sg3 status|head -40
  Storage Changer /dev/sg3:10 Drives, 3200 Slots ( 1600 Import/Export )
Data Transfer Element 0:Empty
Data Transfer Element 1:Empty
Data Transfer Element 2:Empty
Data Transfer Element 3:Empty
Data Transfer Element 4:Empty
Data Transfer Element 5:Empty
Data Transfer Element 6:Empty
Data Transfer Element 7:Empty
Data Transfer Element 8:Empty
Data Transfer Element 9:Empty
      Storage Element 1:Empty:VolumeTag=                                
      Storage Element 2:Empty:VolumeTag=                                
      Storage Element 3:Empty:VolumeTag=                                
      Storage Element 4:Empty:VolumeTag=            

Trying to move a tape from a full slot to a Data Transfer Element fail:

# mtx -f /dev/sg3 status|grep Full
      Storage Element 1000:Full :VolumeTag=A504FF5
# mtx -f /dev/sg3 load 1000 
Loading media from Storage Element 1000 into drive 0...mtx: Request Sense: Long 
Report=yes
mtx: Request Sense: Valid Residual=no
mtx: Request Sense: Error Code=0 (Unknown?!)
mtx: Request Sense: Sense Key=No Sense
mtx: Request Sense: FileMark=no
mtx: Request Sense: EOM=no
mtx: Request Sense: ILI=no
mtx: Request Sense: Additional Sense Code = 00
mtx: Request Sense: Additional Sense Qualifier = 00
mtx: Request Sense: BPV=no
mtx: Request Sense: Error in CDB=no
mtx: Request Sense: SKSV=no
MOVE MEDIUM from Element Address 20999 to 10000 Failed

Rebooting the host with the kernel version available in stable works
correctly.

Here are the kernels I have installed on the host:

# dpkg --list  linux-image-4\*
    Name                         Version           Architecture Description
+++-============================-=================-============-=========================
ii  linux-image-4.12.0-1-amd64   4.12.6-1          amd64        Linux 4.12 for 
64-bit PCs
ii  linux-image-4.9.0-3-amd64    4.9.30-2+deb9u5   amd64        Linux 4.9 for 
64-bit PCs

The difference seems to be in the last ioctl issued by the mtx command.
I ran strace on the mtx command and the problem starts with the last
ioctl call.

This works (using kernel 4.9):

ioctl(3, SG_IO, {'S', SG_DXFER_TO_DEV, cmd[12]=[a5, 00, 00, 00, 27, 10, 52, 07, 
00, 00, 00, 00], mx_sb_len=20, iovec_count=0, dxfer_len=0, timeout=300000, 
flags=0, data[0]=NULL, status=00, masked_status=00, sb[0]=[], host_status=0, 
driver_status=0, resid=0, duration=0, info=0}) = 0

This fails (using kernel 4.12)

ioctl(3, SG_IO, {'S', SG_DXFER_TO_DEV, cmd[12]=[a5, 00, 00, 00, 52, 07, 27, 10, 
00, 00, 00, 00], mx_sb_len=20, iovec_count=0, dxfer_len=0, timeout=300000, 
flags=0, data[0]=NULL}) = -1 EINVAL (Invalid argument)





-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.12.0-1-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages mtx depends on:
ii  libc6  2.24-17

mtx recommends no packages.

mtx suggests no packages.
execve("/usr/sbin/mtx", ["mtx", "-f", "/dev/sg3", "unload", "1000", "0"], [/* 
13 vars */]) = 0
brk(NULL)                               = 0x561298db6000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f4f83a8c000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=26666, ...}) = 0
mmap(NULL, 26666, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4f83a85000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\4\2\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1681176, ...}) = 0
mmap(NULL, 3787104, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f4f834cf000
mprotect(0x7f4f83662000, 2097152, PROT_NONE) = 0
mmap(0x7f4f83862000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x193000) = 0x7f4f83862000
mmap(0x7f4f83868000, 14688, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f4f83868000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f4f83a83000
arch_prctl(ARCH_SET_FS, 0x7f4f83a83700) = 0
mprotect(0x7f4f83862000, 16384, PROT_READ) = 0
mprotect(0x561297b76000, 8192, PROT_READ) = 0
mprotect(0x7f4f83a8f000, 4096, PROT_READ) = 0
munmap(0x7f4f83a85000, 26666)           = 0
open("/dev/sg3", O_RDWR)                = 3
ioctl(3, SG_GET_VERSION_NUM, 0x7fff08a3f0f4) = 0
ioctl(3, SG_SET_TIMEOUT, 0x7fff08a3f0f0) = 0
brk(NULL)                               = 0x561298db6000
brk(0x561298dd7000)                     = 0x561298dd7000
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[6]=[12, 00, 00, 00, 38, 00], 
mx_sb_len=20, iovec_count=0, dxfer_len=56, timeout=30000, flags=0, 
data[56]=[08, 00, 05, 02, 5c, 00, 00, 62, 53, 54, 4b, 20, 20, 20, 20, 20, 4c, 
37, 30, 30, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, ...], status=00, 
masked_status=00, sb[0]=[], host_status=0, driver_status=0, resid=0, 
duration=0, info=0}) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[6]=[1a, 08, 1d, 00, 88, 00], 
mx_sb_len=20, iovec_count=0, dxfer_len=136, timeout=300000, flags=0, 
data[24]=[17, 48, 10, 00, 1d, 12, 00, 00, 00, 01, 4e, 20, 06, 40, 75, 30, 06, 
40, 27, 10, 00, 0a, 00, 00], status=00, masked_status=00, sb[0]=[], 
host_status=0, driver_status=0, resid=112, duration=0, info=0}) = 0
brk(0x561298e11000)                     = 0x561298e11000
mmap(NULL, 270336, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f4f83a41000
ioctl(3, CDROMAUDIOBUFSIZ or SCSI_IOCTL_GET_IDLUN, 0x7fff08a3ef70) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[12]=[b8, 12, 4e, 20, 06, 40, 00, 
04, 1d, c4, 00, 00], mx_sb_len=20, iovec_count=0, dxfer_len=269764, 
timeout=300000, flags=0, data[76816]=[4e, 20, 06, 40, 00, 01, 2c, 08, 02, 80, 
00, 30, 00, 01, 2c, 00, 4e, 20, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 20, 20, 
20, 20, ...], status=00, masked_status=00, sb[0]=[], host_status=0, 
driver_status=0, resid=192948, duration=76, info=0}) = 0
munmap(0x7f4f83a41000, 270336)          = 0
brk(0x561298e5f000)                     = 0x561298e5f000
ioctl(3, CDROMAUDIOBUFSIZ or SCSI_IOCTL_GET_IDLUN, 0x7fff08a3ef70) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[12]=[b8, 13, 75, 30, 06, 40, 00, 
04, 1d, c4, 00, 00], mx_sb_len=20, iovec_count=0, dxfer_len=269764, 
timeout=300000, flags=0, data[76816]=[75, 30, 06, 40, 00, 01, 2c, 08, 03, 80, 
00, 30, 00, 01, 2c, 00, 75, 30, 38, 00, 00, 00, 00, 00, 00, 00, 00, 00, 20, 20, 
20, 20, ...], status=00, masked_status=00, sb[0]=[], host_status=0, 
driver_status=0, resid=192948, duration=76, info=0}) = 0
brk(0x561298ea1000)                     = 0x561298ea1000
ioctl(3, CDROMAUDIOBUFSIZ or SCSI_IOCTL_GET_IDLUN, 0x7fff08a3ef70) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[12]=[b8, 14, 27, 10, 00, 0a, 00, 
04, 1d, c4, 00, 00], mx_sb_len=20, iovec_count=0, dxfer_len=269764, 
timeout=300000, flags=0, data[496]=[27, 10, 00, 0a, 00, 00, 01, e8, 04, 80, 00, 
30, 00, 00, 01, e0, 27, 10, 09, 00, 00, 00, 00, 00, 00, 01, 00, 00, 41, 35, 30, 
34, ...], status=00, masked_status=00, sb[0]=[], host_status=0, 
driver_status=0, resid=269268, duration=4, info=0}) = 0
ioctl(3, CDROMAUDIOBUFSIZ or SCSI_IOCTL_GET_IDLUN, 0x7fff08a3ef70) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[12]=[b8, 11, 00, 00, 00, 01, 00, 
04, 1d, c4, 00, 00], mx_sb_len=20, iovec_count=0, dxfer_len=269764, 
timeout=300000, flags=0, data[64]=[00, 00, 00, 01, 00, 00, 00, 38, 01, 80, 00, 
30, 00, 00, 00, 30, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 20, 20, 20, 
20, ...], status=00, masked_status=00, sb[0]=[], host_status=0, 
driver_status=0, resid=269700, duration=0, info=0}) = 0
fstat(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0
write(1, "Unloading drive 0 into Storage E"..., 46) = 46
ioctl(3, SG_IO, {'S', SG_DXFER_TO_DEV, cmd[12]=[a5, 00, 00, 00, 27, 10, 52, 07, 
00, 00, 00, 00], mx_sb_len=20, iovec_count=0, dxfer_len=0, timeout=300000, 
flags=0, data[0]=NULL, status=00, masked_status=00, sb[0]=[], host_status=0, 
driver_status=0, resid=0, duration=0, info=0}) = 0
write(1, "done\n", 5)                   = 5
close(3)                                = 0
exit_group(0)                           = ?
+++ exited with 0 +++
execve("/usr/sbin/mtx", ["mtx", "-f", "/dev/sg3", "load", "1000"], [/* 13 vars 
*/]) = 0
brk(NULL)                               = 0x564947981000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f7cbfb91000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=26666, ...}) = 0
mmap(NULL, 26666, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7cbfb8a000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\4\2\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1681176, ...}) = 0
mmap(NULL, 3787104, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f7cbf5d4000
mprotect(0x7f7cbf767000, 2097152, PROT_NONE) = 0
mmap(0x7f7cbf967000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x193000) = 0x7f7cbf967000
mmap(0x7f7cbf96d000, 14688, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f7cbf96d000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f7cbfb88000
arch_prctl(ARCH_SET_FS, 0x7f7cbfb88700) = 0
mprotect(0x7f7cbf967000, 16384, PROT_READ) = 0
mprotect(0x564946d29000, 8192, PROT_READ) = 0
mprotect(0x7f7cbfb94000, 4096, PROT_READ) = 0
munmap(0x7f7cbfb8a000, 26666)           = 0
open("/dev/sg3", O_RDWR)                = 3
ioctl(3, SG_GET_VERSION_NUM, 0x7ffe0d009bc4) = 0
ioctl(3, SG_SET_TIMEOUT, 0x7ffe0d009bc0) = 0
brk(NULL)                               = 0x564947981000
brk(0x5649479a2000)                     = 0x5649479a2000
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[6]=[12, 00, 00, 00, 38, 00], 
mx_sb_len=20, iovec_count=0, dxfer_len=56, timeout=30000, flags=0, 
data[56]=[08, 00, 05, 02, 5c, 00, 00, 62, 53, 54, 4b, 20, 20, 20, 20, 20, 4c, 
37, 30, 30, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, ...], status=00, 
masked_status=00, sb[0]=[], host_status=0, driver_status=0, resid=0, 
duration=0, info=0}) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[6]=[1a, 08, 1d, 00, 88, 00], 
mx_sb_len=20, iovec_count=0, dxfer_len=136, timeout=300000, flags=0, 
data[24]=[17, 48, 10, 00, 1d, 12, 00, 00, 00, 01, 4e, 20, 06, 40, 75, 30, 06, 
40, 27, 10, 00, 0a, 00, 00], status=00, masked_status=00, sb[0]=[], 
host_status=0, driver_status=0, resid=112, duration=0, info=0}) = 0
brk(0x5649479dc000)                     = 0x5649479dc000
mmap(NULL, 270336, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f7cbfb46000
ioctl(3, CDROMAUDIOBUFSIZ or SCSI_IOCTL_GET_IDLUN, 0x7ffe0d009a40) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[12]=[b8, 12, 4e, 20, 06, 40, 00, 
04, 1d, c4, 00, 00], mx_sb_len=20, iovec_count=0, dxfer_len=269764, 
timeout=300000, flags=0, data[76816]=[4e, 20, 06, 40, 00, 01, 2c, 08, 02, 80, 
00, 30, 00, 01, 2c, 00, 4e, 20, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 20, 20, 
20, 20, ...], status=00, masked_status=00, sb[0]=[], host_status=0, 
driver_status=0, resid=192948, duration=76, info=0}) = 0
munmap(0x7f7cbfb46000, 270336)          = 0
brk(0x564947a2a000)                     = 0x564947a2a000
ioctl(3, CDROMAUDIOBUFSIZ or SCSI_IOCTL_GET_IDLUN, 0x7ffe0d009a40) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[12]=[b8, 13, 75, 30, 06, 40, 00, 
04, 1d, c4, 00, 00], mx_sb_len=20, iovec_count=0, dxfer_len=269764, 
timeout=300000, flags=0, data[76816]=[75, 30, 06, 40, 00, 01, 2c, 08, 03, 80, 
00, 30, 00, 01, 2c, 00, 75, 30, 38, 00, 00, 00, 00, 00, 00, 00, 00, 00, 20, 20, 
20, 20, ...], status=00, masked_status=00, sb[0]=[], host_status=0, 
driver_status=0, resid=192948, duration=92, info=0}) = 0
brk(0x564947a6c000)                     = 0x564947a6c000
ioctl(3, CDROMAUDIOBUFSIZ or SCSI_IOCTL_GET_IDLUN, 0x7ffe0d009a40) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[12]=[b8, 14, 27, 10, 00, 0a, 00, 
04, 1d, c4, 00, 00], mx_sb_len=20, iovec_count=0, dxfer_len=269764, 
timeout=300000, flags=0, data[496]=[27, 10, 00, 0a, 00, 00, 01, e8, 04, 80, 00, 
30, 00, 00, 01, e0, 27, 10, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 20, 20, 20, 
20, ...], status=00, masked_status=00, sb[0]=[], host_status=0, 
driver_status=0, resid=269268, duration=0, info=0}) = 0
ioctl(3, CDROMAUDIOBUFSIZ or SCSI_IOCTL_GET_IDLUN, 0x7ffe0d009a40) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[12]=[b8, 11, 00, 00, 00, 01, 00, 
04, 1d, c4, 00, 00], mx_sb_len=20, iovec_count=0, dxfer_len=269764, 
timeout=300000, flags=0, data[64]=[00, 00, 00, 01, 00, 00, 00, 38, 01, 80, 00, 
30, 00, 00, 00, 30, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 20, 20, 20, 
20, ...], status=00, masked_status=00, sb[0]=[], host_status=0, 
driver_status=0, resid=269700, duration=0, info=0}) = 0
fstat(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0
write(1, "Loading media from Storage Eleme"..., 55) = 55
ioctl(3, SG_IO, {'S', SG_DXFER_TO_DEV, cmd[12]=[a5, 00, 00, 00, 52, 07, 27, 10, 
00, 00, 00, 00], mx_sb_len=20, iovec_count=0, dxfer_len=0, timeout=300000, 
flags=0, data[0]=NULL}) = -1 EINVAL (Invalid argument)
write(2, "mtx: Request Sense: Long Report="..., 36) = 36
write(2, "mtx: Request Sense: Valid Residu"..., 38) = 38
write(2, "mtx: Request Sense: Error Code=0"..., 45) = 45
write(2, "mtx: Request Sense: Sense Key=No"..., 39) = 39
write(2, "mtx: Request Sense: FileMark=no\n", 32) = 32
write(2, "mtx: Request Sense: EOM=no\n", 27) = 27
write(2, "mtx: Request Sense: ILI=no\n", 27) = 27
write(2, "mtx: Request Sense: Additional S"..., 47) = 47
write(2, "mtx: Request Sense: Additional S"..., 52) = 52
write(2, "mtx: Request Sense: BPV=no\n", 27) = 27
write(2, "mtx: Request Sense: Error in CDB"..., 36) = 36
write(2, "mtx: Request Sense: SKSV=no\n", 28) = 28
write(2, "MOVE MEDIUM from Element Address"..., 55) = 55
exit_group(1)                           = ?
+++ exited with 1 +++

Reply via email to