From: Bodo Stroesser Date: Mon, 2 Dec 2013 17:52:10 +0000 (+0100) Subject: [SCSI] st: fix enlarge_buffer X-Git-Tag: v3.14-rc1~131^2^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=769989a4a09d7c825e182cf60604c06d8f2f70e4;p=pandora-kernel.git [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 Acked-by: Kai Mäkisara Signed-off-by: James Bottomley --- Reading git-diff-tree failed