]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[SCSI] st: fix enlarge_buffer
authorBodo Stroesser <bstroesser@ts.fujitsu.com>
Mon, 2 Dec 2013 17:52:10 +0000 (18:52 +0100)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 17 Dec 2013 20:33:34 +0000 (12:33 -0800)
commit322d8f1e91eb653b41796d05f541013ef2b60be2
treeeb700935dae302a4ee52d04d87627112aaf90d28
parentb81b8e8df140f51af979a9b96116370a35505618
[SCSI] st: fix enlarge_buffer

This patch removes a bug in enlarge_buffer() that can make a
read or write fail under special conditions.

After changing TRY_DIRECT_IO to 0 and ST_MAX_SG to 32 in
st_options.h, a program that writes a first block of 128k and
than a second bigger block (e.g. 256k) fails. The second write
returns errno EOVERFLOW, as enlarge_buffer() checks the sg list
and detects that it already is full.
As enlarge_buffer uses different page allocation orders
depending on the size of the buffer needed, the check does not
make sense.

Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
Acked-by: Kai Mäkisara <kai.makisara@kolumbus.fi>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/st.c