Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 6 Nov 2002 00:01:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 6 Nov 2002 00:01:38 -0500 Received: from h00010256f583.ne.client2.attbi.com ([66.30.243.14]:25276 "EHLO portent.dyndns.org") by vger.kernel.org with ESMTP id ; Wed, 6 Nov 2002 00:01:37 -0500 Content-Type: text/plain; charset="us-ascii" From: Lev Makhlis To: linux-kernel@vger.kernel.org Subject: [PATCH] 2.5.46: overflow in disk stats Date: Wed, 6 Nov 2002 00:09:51 -0500 User-Agent: KMail/1.4.3 Cc: Andrew Morton , ricklind@us.ibm.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200211060009.51684.mlev@despammed.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1037 Lines: 31 Hi, I see that the SARD changes have been merged, but MSEC() still has the overflow problem. This takes care of it: -------------------------------------------------------------------------------------------------- diff -urN linux-2.5.46.orig/drivers/block/genhd.c linux-2.5.46/drivers/block/genhd.c --- linux-2.5.46.orig/drivers/block/genhd.c Tue Nov 5 15:15:07 2002 +++ linux-2.5.46/drivers/block/genhd.c Tue Nov 5 16:14:35 2002 @@ -326,7 +326,13 @@ } static inline unsigned MSEC(unsigned x) { - return x * 1000 / HZ; +#if 1000 % HZ == 0 + return x * (1000 / HZ); +#elif HZ % 1000 == 0 + return x / (HZ / 1000); +#else + return (x / HZ) * 1000 + (x % HZ) * 1000 / HZ; +#endif } static ssize_t disk_stat_read(struct gendisk * disk, char *page, size_t count, loff_t off) - 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/