Move buffer pointer back when data could not be written. Bug found by Mike Christie. Signed-off-by: Kai Mäkisara <Kai.Makisara@xxxxxxxxxxx> --- The patch is for 2.6.27 (against 2.6.26-rc9). drivers/scsi/st.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 6e5a5bb..ccaf1ac 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -17,7 +17,7 @@ Last modified: 18-JAN-1998 Richard Gooch <rgooch@xxxxxxxxxxxxx> Devfs support */ -static const char *verstr = "20080224"; +static const char *verstr = "20080504"; #include <linux/module.h> @@ -1663,6 +1663,7 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) if (undone <= do_count) { /* Only data from this write is not written */ count += undone; + b_point -= undone; do_count -= undone; if (STp->block_size) blks = (transfer - undone) / STp->block_size; -- 1.5.4.3