summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/st.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-02-10 13:45:43 -0600
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-02-10 13:45:43 -0600
commit81b7bbd1932a04869d4c8635a75222dfc6089f96 (patch)
tree285ae868a1e3a41fb0dbfe346c28e380949bcb55 /drivers/scsi/st.c
parent98051995ab44b993f992946055edc6115351f725 (diff)
parent66efc5a7e3061c3597ac43a8bb1026488d57e66b (diff)
Merge branch 'linus'
Conflicts: drivers/scsi/ipr.c Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
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 fba8b204e31..16e279be4a3 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
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;