Message ID | 20170719070335.GC4151@linux-x5ow.site (mailing list archive) |
---|---|
State | Changes Requested, archived |
Headers | show |
>>>>> "JT" == Johannes Thumshirn <jthumshirn@suse.de> writes:
JT> Can you please apply this debugging patch, so I can see what's going
JT> on.
Sure, no problem.
I generally run "mtx -f /dev/sg7 status" first just to make sure the
library is there; this has always worked as expected. With the debug
patch applied, this is sent to the console:
[ 33.933422] sg_is_valid_dxfer: dxfer_direction: -3, dxfer_len: 56
[ 33.940526] sg_is_valid_dxfer: dxfer_direction: -3, dxfer_len: 136
[ 33.982429] sg_is_valid_dxfer: dxfer_direction: -3, dxfer_len: 4240
[ 34.569986] sg_is_valid_dxfer: dxfer_direction: -3, dxfer_len: 4240
[ 34.623898] sg_is_valid_dxfer: dxfer_direction: -3, dxfer_len: 4240
Then running "mtx -f /dev/sg7 next 0" gives this as stdout/err:
Unloading drive 0 into Storage Element 46...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 1 to 1046 Failed
And this to the console:
[ 45.552524] sg_is_valid_dxfer: dxfer_direction: -3, dxfer_len: 56
[ 45.559626] sg_is_valid_dxfer: dxfer_direction: -3, dxfer_len: 136
[ 45.603544] sg_is_valid_dxfer: dxfer_direction: -3, dxfer_len: 4240
[ 46.204614] sg_is_valid_dxfer: dxfer_direction: -3, dxfer_len: 4240
[ 46.258463] sg_is_valid_dxfer: dxfer_direction: -3, dxfer_len: 4240
[ 46.304530] sg_is_valid_dxfer: dxfer_direction: -2, dxfer_len: 0
Would you also want to see the output from that patch applied to a
functioning kernel?
- J<
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 1e82d4128a84..2505fa0b2062 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -753,6 +753,10 @@ sg_new_write(Sg_fd *sfp, struct file *file, const char __user *buf, static bool sg_is_valid_dxfer(sg_io_hdr_t *hp) { + + pr_info("%s: dxfer_direction: %d, dxfer_len: %d\n", + __func__, hp->dxfer_direction, hp->dxfer_len); + switch (hp->dxfer_direction) { case SG_DXFER_NONE: if (hp->dxferp || hp->dxfer_len > 0)