diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-03 11:26:39 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-03 11:26:39 -0800 |
commit | ce35a81a71f405031ed6fd0d454d3aaa55dc8ed2 (patch) | |
tree | ba67cda811c798970ed89786f2e4a60618cb0975 /drivers/scsi/st.c | |
parent | 259886a7c4e4eb0089181e800d1f477cb3786875 (diff) | |
parent | 017f2e37ae19ccd28e5edd965741fc374194c5dd (diff) | |
download | kernel-crypto-ce35a81a71f405031ed6fd0d454d3aaa55dc8ed2.tar.gz kernel-crypto-ce35a81a71f405031ed6fd0d454d3aaa55dc8ed2.tar.xz kernel-crypto-ce35a81a71f405031ed6fd0d454d3aaa55dc8ed2.zip |
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
[SCSI] sd: udev accessing an uninitialized scsi_disk field results in a crash
[SCSI] st: A MTIOCTOP/MTWEOF within the early warning will cause the file number to be incorrect
[SCSI] qla4xxx: bug fixes
[SCSI] Fix scsi_add_device() for async scanning
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 e016e0906e1..488ec7948a5 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 if (cmd_in == MTWEOF && cmdstatp->have_sense && - (cmdstatp->flags & SENSE_EOM) && - (cmdstatp->sense_hdr.sense_key == NO_SENSE || - cmdstatp->sense_hdr.sense_key == RECOVERED_ERROR) && - undone == 0) { - ioctl_result = 0; /* EOF written successfully at EOM */ - if (fileno >= 0) - fileno++; + (cmdstatp->flags & SENSE_EOM)) { + if (cmdstatp->sense_hdr.sense_key == NO_SENSE || + cmdstatp->sense_hdr.sense_key == RECOVERED_ERROR) { + ioctl_result = 0; /* EOF(s) written successfully at EOM */ + STps->eof = ST_NOEOF; + } else { /* Writing EOF(s) failed */ + if (fileno >= 0) + fileno -= undone; + if (undone < arg) + STps->eof = ST_NOEOF; + } STps->drv_file = fileno; - STps->eof = ST_NOEOF; } else if ((cmd_in == MTFSF) || (cmd_in == MTFSFM)) { if (fileno >= 0) STps->drv_file = fileno - undone; |