Hi,
I'm currently running SCST (cloned from https://github.com/bvanassche/scst) on the svc-3.4.x branch where the latest commit is a30623edbc908763cc4987024e995babafe197b6.
And using mhvtl (from https://github.com/markh794/mhvtl) 1.6.3 - 05d4f6f293d9efb6f589232736632433dc5ec10b to create an IBM ULT3580-TD5 tape drive, then presenting that tape drive through scst_local to present it locally (just helped find where the issue was).
On a Ubuntu Server 18.04.5 with kernel 4.15.0-132-generic
Then running a test (size of file doesn't matter) to write a file to the tape and read back the data.
dd if=/dev/urandom of=testfile bs=1M count=8
dd if=testfile of=/dev/st1
dd if=/dev/st1 of=testfile.copy
The read fails with an I/O error as a filemark is hit:
dd: error reading '/dev/st1': Input/output error
Observations:
Adding a 'res = 0;' just before the out label got past this.
I'm unsure what purpose storing sense data has outside of UNIT ATTENTION, if it has none could tgt_dev_sense/tgt_dev_valid_sense_len be removed in favour of only taking sense data off of the tgt_dev->UA_list?
Any help with this issue would be appreciated.
Thanks
Thanks for having reported this.
A fix for scst_prepare_request_sense() has been checked in.
Storing sense data just before completing a command seems weird to me too. Does removing the scst_store_sense() call from scst_process_check_condition() help?
Yes, if I remove the call to scst_store_sense() then it works as expected.
The scst_store_sense() call has been removed from the trunk.