aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r--drivers/scsi/st.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index e016e0906e1a..488ec7948a57 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -2816,15 +2816,18 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
2816 2816
2817 if (cmd_in == MTWEOF && 2817 if (cmd_in == MTWEOF &&
2818 cmdstatp->have_sense && 2818 cmdstatp->have_sense &&
2819 (cmdstatp->flags & SENSE_EOM) && 2819 (cmdstatp->flags & SENSE_EOM)) {
2820 (cmdstatp->sense_hdr.sense_key == NO_SENSE || 2820 if (cmdstatp->sense_hdr.sense_key == NO_SENSE ||
2821 cmdstatp->sense_hdr.sense_key == RECOVERED_ERROR) && 2821 cmdstatp->sense_hdr.sense_key == RECOVERED_ERROR) {
2822 undone == 0) { 2822 ioctl_result = 0; /* EOF(s) written successfully at EOM */
2823 ioctl_result = 0; /* EOF written successfully at EOM */ 2823 STps->eof = ST_NOEOF;
2824 if (fileno >= 0) 2824 } else { /* Writing EOF(s) failed */
2825 fileno++; 2825 if (fileno >= 0)
2826 fileno -= undone;
2827 if (undone < arg)
2828 STps->eof = ST_NOEOF;
2829 }
2826 STps->drv_file = fileno; 2830 STps->drv_file = fileno;
2827 STps->eof = ST_NOEOF;
2828 } else if ((cmd_in == MTFSF) || (cmd_in == MTFSFM)) { 2831 } else if ((cmd_in == MTFSF) || (cmd_in == MTFSFM)) {
2829 if (fileno >= 0) 2832 if (fileno >= 0)
2830 STps->drv_file = fileno - undone; 2833 STps->drv_file = fileno - undone;