On 2.12.2013, at 21.00, Bodo Stroesser <bstroes...@ts.fujitsu.com> wrote:

> From: Bodo Stroesser <bstroes...@ts.fujitsu.com>
> Date: Mon, 2 Dec 2013 18:52:10 +0100
> Subject: [PATCH 3/3] st.ko: change enlarge_buffer result
> 
> enlarge_buffer() just returns 1 or 0 if it could or could
> not allocate the requested buffer.
> 
> In case of result 0, the callers always set the error to
> EOVERFLOW. I think, this is not a good errno for those
> cases, where enlarge_buffer() could not allocate the pages
> it needed.
> 
> So I changed enlarge_buffer() to return a meaningful
> result (-ENOMEM or -EOVERFLOW in case of error, 0 in case of
> success) and the callers to use this result.
> 
ENOMEM is used for telling the user that, in variable block mode, the byte 
count in read() is smaller than the next block. This may not sound like proper 
use of this code but this is how the tape drivers have done. When ENOMEM is not 
used, the patch would be only cosmetic.

Thanks,
Kai

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to