st.ko: fix enlarge_buffer
A message that is not in the archive (sent off-list or not yet received): [email protected]
Kai Mäkisara (Kolumbus)
Acked-byQuoted 7 lines · Bodo Stroesser
From: Bodo Stroesser <[email protected]>
Date: Mon, 2 Dec 2013 18:52:10 +0100
Subject: [PATCH 1/3] st.ko: fixenlarge_bufferThis patch removes a bug in
enlarge_buffer()that can make a read or write fail under special conditions.
Quoted 9 lines
After changing
TRY_DIRECT_IOto 0 andST_MAX_SGto 32 inst_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, asenlarge_buffer()checks the sg list and detects that it already is full.
Asenlarge_bufferuses different page allocation orders depending on the size of the buffer needed, the check does not make sense.
Yes, it is not useful any more. It may have been necessary at some time but I am now not sure about that either ;-)
Quoted 1 line
Cc Kai Makisara <[email protected]>
Thanks,
Kai
Quoted 16 lines
Signed-off-by Bodo Stroesser <[email protected]>---
drivers/scsi/st.c +1
-1@@ -3719,7 +3719,7 @@ static struct st_buffer *new_tape_bufferstatic int enlarge_buffer (struct st_buffer * STbuffer,int new_size,int need_dma) { -int segs, nbr, max_segs, b_size, order, got; +int segs, max_segs, b_size, order, got;gfp_t priority;if (new_size <= STbuffer->buffer_size)
drivers/scsi/st.c static int enlarge_buffer(struct st_buff · line 3734
Quoted 9 lines
drivers/scsi/st.c +0
-3@@ -3729,9 +3729,6 @@ static int enlarge_buffer(struct st_buffnormalize_buffer (STbuffer);/* Avoid extra segment */ max_segs = STbuffer->use_sg; - nbr = max_segs - STbuffer->frp_segs; -if (nbr <=0 ) -return 0 ; priority =GFP_KERNEL | __GFP_NOWARN;if (need_dma)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html