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