lkml.org 
[lkml]   [2013]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 8/9] dasd: Add 'timeout' attribute
On 01/29/2013 12:36 PM, Heiko Carstens wrote:
> On Tue, Jan 29, 2013 at 08:12:00AM +0100, Hannes Reinecke wrote:
>> This patch adds a 'timeout' attibute to the DASD driver.
>> When set to non-zero, the blk_timeout function will
>> be enabled with the timeout specified in the attribute.
>> Setting 'timeout' to '0' will disable block timeouts.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>
> [...]
>
>> +static ssize_t
>> +dasd_timeout_store(struct device *dev, struct device_attribute *attr,
>> + const char *buf, size_t count)
>> +{
>> + struct dasd_device *device;
>> + struct request_queue *q;
>> + unsigned long val, flags;
>> +
>> + device = dasd_device_from_cdev(to_ccwdev(dev));
>> + if (IS_ERR(device))
>> + return -ENODEV;
>> +
>> + if ((strict_strtoul(buf, 10, &val) != 0) ||
>> + val > ULONG_MAX / HZ) {
>
> Probably this should be UINT_MAX instead of ULONG_MAX, otherwise it
> might overflow since blk_queue_rq_timeout(...) expects only an
> unsigned int.
>
Ok, will be fixing it up.

Cheers,

Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-01-29 13:21    [W:0.741 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site