Date: Sat, 3 Jul 1999 09:24:39 +0200 (CEST) From: Nick Hibma <hibma@skylink.it> To: FreeBSD CURRENT Mailing list <current@freebsd.org> Cc: justin@freebsd.org Subject: panic in dadone, PR 12041 Message-ID: <Pine.BSF.3.96.990703091751.7798A-200000@heidi.plazza.it>
next in thread | raw e-mail | index | archive | help
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-1356166914-930986679=:7798 Content-Type: TEXT/PLAIN; charset=US-ASCII PR 12041 complains about the fact that the system panics with a divide by zero if a zip drive is connected with a medium in it. I've not been able to reproduce the problem, but remember having similar problems when implementing the umass driver for USB. The problem is caused by the following line in scsi_da.c:1326 (3.2-STABLE but applies to CURRENT as well): snprintf(announce_buf, sizeof(announce_buf), "%ldMB (%d %d byte sectors: %dH %dS/T%dC)", dp->sectors / ((1024L * 1024L) / dp->secsize), dp->sectors, dp->secsize, dp->heads, dp->secs_per_track, dp->cylinders); secsize is 0 in some cases (I think it happens when an INQUIRY fails without being detected as having failed). In any case a/(b/c) = a*c/b, but without any divl (with b sometimes 0 and c == 2^20). Patch attached. Nick -- e-Mail: hibma@skylink.it --0-1356166914-930986679=:7798 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="scsi_da.c.patch" Content-Transfer-Encoding: BASE64 Content-ID: <Pine.BSF.3.96.990703092439.7798B@heidi.plazza.it> Content-Description: SW5kZXg6IHNjc2lfZGEuYw0KPT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KUkNT IGZpbGU6IC9ob21lL25jdnMvc3JjL3N5cy9jYW0vc2NzaS9zY3NpX2RhLmMs dg0KcmV0cmlldmluZyByZXZpc2lvbiAxLjE5LjIuNQ0KZGlmZiAtdSAtcjEu MTkuMi41IHNjc2lfZGEuYw0KLS0tIHNjc2lfZGEuYwkxOTk5LzA1LzIyIDIy OjU4OjI3CTEuMTkuMi41DQorKysgc2NzaV9kYS5jCTE5OTkvMDcvMDMgMDc6 MjQ6MzUNCkBAIC0xMzI2LDcgKzEzMjYsNyBAQA0KIAkJCWRwID0gJnNvZnRj LT5wYXJhbXM7DQogCQkJc25wcmludGYoYW5ub3VuY2VfYnVmLCBzaXplb2Yo YW5ub3VuY2VfYnVmKSwNCiAJCQkJIiVsZE1CICglZCAlZCBieXRlIHNlY3Rv cnM6ICVkSCAlZFMvVCAlZEMpIiwNCi0JCQkJZHAtPnNlY3RvcnMgLyAoKDEw MjRMICogMTAyNEwpIC8gZHAtPnNlY3NpemUpLA0KKwkJCQlkcC0+c2Vjc2l6 ZSAqIGRwLT5zZWN0b3JzIC8gKDEwMjRMICogMTAyNEwpLA0KIAkJCQlkcC0+ c2VjdG9ycywgZHAtPnNlY3NpemUsIGRwLT5oZWFkcywNCiAJCQkJZHAtPnNl Y3NfcGVyX3RyYWNrLCBkcC0+Y3lsaW5kZXJzKTsNCiAJCX0gZWxzZSB7DQo= --0-1356166914-930986679=:7798-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.990703091751.7798A-200000>