From nobody@FreeBSD.org  Mon Jan 11 19:04:13 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E4AE41065679
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 11 Jan 2010 19:04:13 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id D351A8FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 11 Jan 2010 19:04:13 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o0BJ4D0X019954
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 11 Jan 2010 19:04:13 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o0BJ4DqP019953;
	Mon, 11 Jan 2010 19:04:13 GMT
	(envelope-from nobody)
Message-Id: <201001111904.o0BJ4DqP019953@www.freebsd.org>
Date: Mon, 11 Jan 2010 19:04:13 GMT
From: pluknet <pluknet@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [ada] camcontrol readcap shows inadequately high numbers in VBox
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         142724
>Category:       kern
>Synopsis:       [ada] camcontrol readcap shows inadequately high numbers in VBox
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 11 19:10:07 UTC 2010
>Closed-Date:    Tue Feb 23 18:59:41 UTC 2010
>Last-Modified:  Tue Feb 23 18:59:41 UTC 2010
>Originator:     pluknet
>Release:        8.0-STABLE, 9.0-CURRENT
>Organization:
>Environment:
c8-vb.h3 8.0-STABLE #0: Web Dec 30
c9-vb.h3 9.0-CURRENT #0: Sat Jan 9
>Description:
camcontrol readcap shows inadequately high numbers in VirtualBox
when using with ada disks.

dmesg shows correct disk size:

c9-vb# camcontrol readcap ada0
Last Block: 539522796, Block Length: 3216968941 bytes
c9-vb# dmesg | grep ada
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <VBOX HARDDISK 1.0> ATA-6 SATA 2.x device
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO size 8192bytes)
ada0: Command Queueing enabled
ada0: 10240MB (20971520 512 byte sectors: 16H 63S/T 16383C)

Though, if running without ahci driver (in legacy ata mode, where
ada0 became ad4), a similar atacontrol command prints correct
(it equals to detected disk size above for ada0):

c8-vb# atacontrol cap ad4 | grep sectors$
lba supported        20971520 sectors
lba48 supported        20971520 sectors

The behavior is identical on both 8.0-STABLE and current.
>How-To-Repeat:
VBox guest with installed FreeBSD 8.0 or above
camcontrol readcap ada0
>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: mav 
State-Changed-When: Thu Feb 4 14:42:09 UTC 2010 
State-Changed-Why:  
`camcontrol readcap` uses SCSI command, so it is not expected to work with ATA 
devices. Changes in r203376 in HEAD should deny such improper command execution. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142724 
State-Changed-From-To: patched->closed 
State-Changed-By: mav 
State-Changed-When: Tue Feb 23 18:58:34 UTC 2010 
State-Changed-Why:  
Patch merged to 8-STABLE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142724 
>Unformatted:
