Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jan 2001 17:26:48 -0800 (PST)
From:      Matthew Jacob <mjacob@feral.com>
To:        freebsd-scsi@freebsd.org, alpha@freebsd.org
Subject:   huh... watch out for overflows...
Message-ID:  <Pine.LNX.4.21.0101151721540.8362-100000@zeppo.feral.com>

next in thread | raw e-mail | index | archive | help

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-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.21.0101151721540.8362-100000>