lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Mon, 17 Nov 2008 13:08:48 +0100
From:	Jens Axboe <jens.axboe@...cle.com>
To:	Milton Miller <miltonm@....com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi-ioctl: use clock_t <> jiffies

On Sat, Nov 15 2008, Milton Miller wrote:
> Convert the timeout ioctl scalling to use the clock_t functions
> which are much more accurate with some USER_HZ vs HZ combinations.
> 
> Signed-off-by: Milton Miller <miltonm@....com>
> ---
> While doing some work with low HZ rates for a simulator, 
> I saw a divide-by-zero warning that pointed out these 
> hz scales.
> 
> 
> Index: sim/block/scsi_ioctl.c
> ===================================================================
> --- sim.orig/block/scsi_ioctl.c	2008-11-11 01:19:29.000000000 -0600
> +++ sim/block/scsi_ioctl.c	2008-11-11 01:22:11.000000000 -0600
> @@ -60,7 +60,7 @@ static int scsi_get_bus(struct request_q
>  
>  static int sg_get_timeout(struct request_queue *q)
>  {
> -	return q->sg_timeout / (HZ / USER_HZ);
> +	return jiffies_to_clock_t(q->sg_timeout);
>  }
>  
>  static int sg_set_timeout(struct request_queue *q, int __user *p)
> @@ -68,7 +68,7 @@ static int sg_set_timeout(struct request
>  	int timeout, err = get_user(timeout, p);
>  
>  	if (!err)
> -		q->sg_timeout = timeout * (HZ / USER_HZ);
> +		q->sg_timeout = clock_t_to_jiffies(timeout);
>  
>  	return err;
>  }

Thanks, applied to for-2.6.29

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ