From: Kai Makisara Date: Fri, 11 Jul 2008 12:05:25 +0000 (+0300) Subject: [SCSI] st: Move buffer pointer back when data could not be written. X-Git-Tag: v2.6.27-rc1~55^2~40 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=626dcb1ee39aa1010c27df31970ff0ecfb287208;p=karo-tx-linux.git [SCSI] st: Move buffer pointer back when data could not be written. Move buffer pointer back when data could not be written. Bug found by Mike Christie. Signed-off-by: Kai Mäkisara Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 4684cc716aa4..41b1f81b1651 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -17,7 +17,7 @@ Last modified: 18-JAN-1998 Richard Gooch Devfs support */ -static const char *verstr = "20080224"; +static const char *verstr = "20080504"; #include @@ -1670,6 +1670,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;