From owner-svn-src-head@freebsd.org Wed Dec 6 21:44:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25392E8CE56; Wed, 6 Dec 2017 21:44:56 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp001.me.com (mr11p00im-asmtp001.me.com [17.110.69.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 073D26384A; Wed, 6 Dec 2017 21:44:56 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp001.me.com by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P0K00N006GS1R00@mr11p00im-asmtp001.me.com>; Wed, 06 Dec 2017 21:44:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1512596687; bh=ghO46/MaZye6krjHJIQOJ6WEKe9H9PTJbeQTV58+kuM=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=Dlo1s99j1gMMGbObM7Y0zrBvFA3TdMqlI8RTv3cgGw8exSIvX4ip0hQhzhKdeW9vr RUea9XL0OEI+6CHiVSmaDBiTL0RnugYoaUB1QNR95SteFFqekd42TMtEfQDwuX0ySf 1B6OUQA8G7ZBkZ69i/sExUA9XFM6pdUypjA6slBy8L1K6cJ2P5nefMqXhrHivV55ev nA/WH/yK3fwCzGaYt1XTX5Gi7JwGjR9qC5WUY0uZx/PGwuASjoQmltQOb3I3d+D5hI M/u6InOfsJbEhudb/Steb87Bfpj8zagzpYWOPOPR6M9G06ZTCVC+7FQ0GaTx5yRf2u 4AGcd+4N1uqtw== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P0K003M372LHK10@mr11p00im-asmtp001.me.com>; Wed, 06 Dec 2017 21:44:46 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-06_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1712060306 User-Agent: Microsoft-MacOutlook/f.28.0.171108 Date: Wed, 06 Dec 2017 13:44:45 -0800 Subject: Re: svn commit: r326624 - head/sys/cam/ata From: Ravi Pokala To: Alan Somers Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-id: <9B746B37-4C6C-4F21-B9F7-77826DDF0DCA@mac.com> Thread-topic: svn commit: r326624 - head/sys/cam/ata References: <201712061701.vB6H1PDN011394@repo.freebsd.org> In-reply-to: MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2017 21:44:56 -0000 Oh good, I'll be able to sleep tonight after all. :-) -Ravi -----Original Message----- From: on behalf of Alan Somers Date: 2017-12-06, Wednesday at 10:15 To: Ravi Pokala Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r326624 - head/sys/cam/ata Nope. The ATA spec prohibited them, and nobody ever manufactured any. But you might be able to fake one with CTL or QEMU or something similar. On Wed, Dec 6, 2017 at 10:11 AM, Ravi Pokala wrote: > ... disks of >=1TiB that still use CHS addressing. Out of morbid curiosity, are there any such monstrosities? -Ravi (rpokala@) -----Original Message----- From: on behalf of Alan Somers Date: 2017-12-06, Wednesday at 09:01 To: , , Subject: svn commit: r326624 - head/sys/cam/ata Author: asomers Date: Wed Dec 6 17:01:25 2017 New Revision: 326624 URL: https://svnweb.freebsd.org/changeset/base/326624 Log: cam: fix sign-extension error in adagetparams adagetparams contains a sign-extension error that will cause the sector count to be incorrectly calculated for ATA disks of >=1TiB that still use CHS addressing. Disks using LBA48 addressing are unaffected. Reported by: Coverity CID: 1007296 Reviewed by: ken MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13198 Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Wed Dec 6 14:53:53 2017 (r326623) +++ head/sys/cam/ata/ata_da.c Wed Dec 6 17:01:25 2017 (r326624) @@ -3377,7 +3377,8 @@ adagetparams(struct cam_periph *periph, struct ccb_get dp->heads = cgd->ident_data.heads; dp->secs_per_track = cgd->ident_data.sectors; dp->cylinders = cgd->ident_data.cylinders; - dp->sectors = cgd->ident_data.cylinders * dp->heads * dp->secs_per_track; + dp->sectors = cgd->ident_data.cylinders * + (u_int32_t)(dp->heads * dp->secs_per_track); } lbasize = (u_int32_t)cgd->ident_data.lba_size_1 | ((u_int32_t)cgd->ident_data.lba_size_2 << 16);