patch-2.1.89 linux/drivers/scsi/st.c

Next file: linux/drivers/scsi/tmscsim.c
Previous file: linux/drivers/scsi/sr.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.88/linux/drivers/scsi/st.c linux/drivers/scsi/st.c
@@ -2846,11 +2846,18 @@
 	 }
        }
 
-       i = flush_buffer(inode, file, /* mtc.mt_op == MTSEEK || */
-			mtc.mt_op == MTREW || mtc.mt_op == MTOFFL ||
-			mtc.mt_op == MTRETEN || mtc.mt_op == MTEOM ||
-			mtc.mt_op == MTLOCK || mtc.mt_op == MTLOAD ||
-			mtc.mt_op == MTCOMPRESSION);
+       if (mtc.mt_op == MTSEEK) {
+	   /* Old position must be restored if partition will be changed */
+	   i = !STp->can_partitions ||
+	       (STp->new_partition != STp->partition);
+       }
+       else {
+	   i = mtc.mt_op == MTREW || mtc.mt_op == MTOFFL ||
+	       mtc.mt_op == MTRETEN || mtc.mt_op == MTEOM ||
+	       mtc.mt_op == MTLOCK || mtc.mt_op == MTLOAD ||
+	       mtc.mt_op == MTCOMPRESSION;
+       }
+       i = flush_buffer(inode, file, i);
        if (i < 0)
 	 return i;
      }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov