From owner-freebsd-scsi Mon Jan 15 17:27: 8 2001 Delivered-To: freebsd-scsi@freebsd.org Received: from feral.com (feral.com [192.67.166.1]) by hub.freebsd.org (Postfix) with ESMTP id E1B1B37B69B; Mon, 15 Jan 2001 17:26:49 -0800 (PST) Received: from zeppo.feral.com (IDENT:mjacob@zeppo [192.67.166.71]) by feral.com (8.9.3/8.9.3) with ESMTP id RAA09407; Mon, 15 Jan 2001 17:26:50 -0800 Date: Mon, 15 Jan 2001 17:26:48 -0800 (PST) From: Matthew Jacob Reply-To: mjacob@feral.com To: freebsd-scsi@freebsd.org, alpha@freebsd.org Subject: huh... watch out for overflows... Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This construct is fairly common in CAM drivers: timeout(XXXX, YYYYY, (ccb->ccb_h.timeout * hz)/1000); The problem here is that timeout is u_int32_t and that some platforms have a high hz rate (1024 on some alphas, e.g.). If you take the normal tape timeout of two hours for an I/O operation, and keeping in mind that timeout is in milliseconds, you overflow 32 bits, thus leading to a timeout with a somewhat unpredictable (but surely wrong) value. -matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message