From owner-freebsd-scsi@FreeBSD.ORG Sun Dec 15 15:01:35 2013 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF5151EE for ; Sun, 15 Dec 2013 15:01:35 +0000 (UTC) Received: from mail-bk0-x230.google.com (mail-bk0-x230.google.com [IPv6:2a00:1450:4008:c01::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 45A981A01 for ; Sun, 15 Dec 2013 15:01:35 +0000 (UTC) Received: by mail-bk0-f48.google.com with SMTP id r7so1990410bkg.35 for ; Sun, 15 Dec 2013 07:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:subject:message-id:date:to:mime-version; bh=GGsul3tCfZQSG58nv8y6WutdM+9nFxou8osYna/Q62s=; b=OOnKKXrL/QfQiwrCnzfGMQYNX2r1O54L5qQKuSznW85bRLTb0yPrnH1Gd5Gn9p162n Mv/yFyzoX8TEGa1u6zz/SfMDGdpf1E16vGSXXozuh2r3lhjYje7cDsXlfDohmPrlw1bX 0j8D8/T3ZoN6cfMqZRcGiF8WXdnlXWd9PgBU9Fre6qowshaVcTCnQGL/CBsz7NVuSFQj EEC5ZNmgT33VCguOV/B8Zk6eOyN4hAk9vdabUXr/CZb6qzkwi71cXWJZUjVYhdi0E+Sm dUeHEJH/hpYjx0+MxJE5hVQNjw6n84Jn+Q0jmZ8bv+KQRg4fQILsPiUMhcabdLMH77ii hueQ== X-Received: by 10.204.111.200 with SMTP id t8mr1379548bkp.43.1387119693479; Sun, 15 Dec 2013 07:01:33 -0800 (PST) Received: from ed209.ocp.lan (77-23-69-152-dynip.superkabel.de. [77.23.69.152]) by mx.google.com with ESMTPSA id bf8sm7774126bkb.14.2013.12.15.07.01.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 15 Dec 2013 07:01:32 -0800 (PST) From: Thomas Eberhardt Content-Type: multipart/mixed; boundary="Apple-Mail=_20A480EF-3CF9-4DDD-B15E-960B9986360A" Subject: [cam][patch] SCSI disk spin-down on shutdown Message-Id: <20391D99-9F60-4D21-AC21-00FF754F7F2D@gmail.com> Date: Sun, 15 Dec 2013 16:01:37 +0100 To: freebsd-scsi@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) X-Mailer: Apple Mail (2.1822) X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 15:01:35 -0000 --Apple-Mail=_20A480EF-3CF9-4DDD-B15E-960B9986360A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi, Appended is a patch to optionally spin-down SCSI disks on shutdown (i = didn=92t like the increasing Power-Off retract events in the SMART-stats of my disks). The patch is = based on r203420 and the current stable/9 ata_da.c code. My server is running stable/9 and has a bunch of SATA-disks behind three = IBM M1015 controllers (using IT-firmware) and has been running free of trouble for over a year = with this patch. Hopefully i didn=92t do any stupid things in the code since i=92m not = really a kernel hacker. :-) Regards, Thomas --Apple-Mail=_20A480EF-3CF9-4DDD-B15E-960B9986360A Content-Disposition: attachment; filename=scsi_da-spindown.patch.txt Content-Type: text/plain; name="scsi_da-spindown.patch.txt" Content-Transfer-Encoding: 7bit Index: share/man/man4/da.4 =================================================================== --- share/man/man4/da.4 (revision 259401) +++ share/man/man4/da.4 (working copy) @@ -133,7 +133,7 @@ .Xr loader 8 tunables: .Bl -tag -width 12 -.It kern.cam.da.retry_count +.It Va kern.cam.da.retry_count .Pp This variable determines how many times the .Nm @@ -143,7 +143,7 @@ .Nm driver dump routine. This value currently defaults to 4. -.It kern.cam.da.default_timeout +.It Va kern.cam.da.default_timeout .Pp This variable determines how long the .Nm @@ -150,8 +150,13 @@ driver will wait before timing out an outstanding command. The units for this value are seconds, and the default is currently 60 seconds. -.It kern.cam.da.%d.minimum_cmd_size +.It Va kern.cam.da.spindown_shutdown .Pp +This variable determines whether to spin-down disks when shutting down. +Set to 1 to enable spin-down, 0 to disable. +The default is currently disabled. +.It Va kern.cam.da.%d.minimum_cmd_size +.Pp This variable determines what the minimum READ/WRITE CDB size is for a given .Nm Index: sys/cam/scsi/scsi_da.c =================================================================== --- sys/cam/scsi/scsi_da.c (revision 259401) +++ sys/cam/scsi/scsi_da.c (working copy) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #endif /* _KERNEL */ @@ -1163,6 +1164,10 @@ #define DA_DEFAULT_SEND_ORDERED 1 #endif +#ifndef DA_DEFAULT_SPINDOWN_SHUTDOWN +#define DA_DEFAULT_SPINDOWN_SHUTDOWN 0 +#endif + #define DA_SIO (softc->sort_io_queue >= 0 ? \ softc->sort_io_queue : cam_sort_io_queues) @@ -1170,6 +1175,7 @@ static int da_retry_count = DA_DEFAULT_RETRY; static int da_default_timeout = DA_DEFAULT_TIMEOUT; static int da_send_ordered = DA_DEFAULT_SEND_ORDERED; +static int da_spindown_shutdown = DA_DEFAULT_SPINDOWN_SHUTDOWN; static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); @@ -1185,6 +1191,9 @@ SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFLAG_RW, &da_send_ordered, 0, "Send Ordered Tags"); TUNABLE_INT("kern.cam.da.send_ordered", &da_send_ordered); +SYSCTL_INT(_kern_cam_da, OID_AUTO, spindown_shutdown, CTLFLAG_RW, + &da_spindown_shutdown, 0, "Spin down upon shutdown"); +TUNABLE_INT("kern.cam.da.spindown_shutdown", &da_spindown_shutdown); /* * DA_ORDEREDTAG_INTERVAL determines how often, relative @@ -3759,7 +3768,7 @@ * sync the disk cache to physical media. */ static void -dashutdown(void * arg, int howto) +daflush(void) { struct cam_periph *periph; struct da_softc *softc; @@ -3808,6 +3817,63 @@ } } +static void +daspindown(void) +{ + struct cam_periph *periph; + struct da_softc *softc; + union ccb *ccb; + int error; + + CAM_PERIPH_FOREACH(periph, &dadriver) { + /* If we paniced with lock held - not recurse here. */ + if (cam_periph_owned(periph)) + continue; + cam_periph_lock(periph); + softc = (struct da_softc *)periph->softc; + /* + * XXX How to check for power mgmt like ADA_FLAG_CAN_POWERMGT? + * XXX Only spin-down fixed drives for now + */ + if (softc->flags & DA_FLAG_PACK_REMOVABLE) { + cam_periph_unlock(periph); + continue; + } + + if (bootverbose) + xpt_print(periph->path, "spin-down\n"); + + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); + scsi_start_stop(&ccb->csio, + /*retries*/0, + /*cbfcnp*/dadone, + MSG_SIMPLE_Q_TAG, + /*start*/FALSE, + /*load/eject*/FALSE, + /*immediate*/TRUE, + SSD_FULL_SIZE, + /*timeout*/50*1000); + + error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0, + /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY | SF_QUIET_IR, + softc->disk->d_devstat); + if (error != 0) + xpt_print(periph->path, "Spin-down disk failed\n"); + xpt_release_ccb(ccb); + cam_periph_unlock(periph); + } +} + +static void +dashutdown(void *arg, int howto) +{ + + daflush(); + if (da_spindown_shutdown != 0 && + (howto & (RB_HALT | RB_POWEROFF)) != 0) + daspindown(); +} + #else /* !_KERNEL */ /* --Apple-Mail=_20A480EF-3CF9-4DDD-B15E-960B9986360A-- From owner-freebsd-scsi@FreeBSD.ORG Mon Dec 16 11:06:55 2013 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EE0FF3E for ; Mon, 16 Dec 2013 11:06:55 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A2491358 for ; Mon, 16 Dec 2013 11:06:55 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGB6tVc019498 for ; Mon, 16 Dec 2013 11:06:55 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id rBGB6scR019496 for freebsd-scsi@FreeBSD.org; Mon, 16 Dec 2013 11:06:54 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 16 Dec 2013 11:06:54 GMT Message-Id: <201312161106.rBGB6scR019496@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-scsi@FreeBSD.org Subject: Current problem reports assigned to freebsd-scsi@FreeBSD.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 11:06:55 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/184059 scsi [mps] mps SCSI driver causes FreeBSD to hang during bo o kern/179932 scsi [ciss] ciss i/o stall problem with HP Bl Gen8 (and HP o kern/178795 scsi [mps] MSI for mps driver doesn't work under vmware o kern/165982 scsi [mpt] mpt instability, drive resets, and losses on Fre o kern/165740 scsi [cam] SCSI code must drain callbacks before free f kern/162256 scsi [mpt] QUEUE FULL EVENT and 'mpt_cam_event: 0x0' o docs/151336 scsi Missing documentation of scsi_ and ata_ functions in c o kern/148083 scsi [aac] Strange device reporting o kern/144648 scsi [aac] Strange values of speed and bus width in dmesg o kern/142351 scsi [mpt] LSILogic driver performance problems o kern/134488 scsi [mpt] MPT SCSI driver probes max. 8 LUNs per device o kern/130621 scsi [mpt] tranfer rate is inscrutable slow when use lsi213 f kern/129602 scsi [ahd] ahd(4) gets confused and wedges SCSI bus f kern/123674 scsi [ahc] ahc driver dumping o sparc/121676 scsi [iscsi] iscontrol do not connect iscsi-target on sparc 15 problems total. From owner-freebsd-scsi@FreeBSD.ORG Mon Dec 16 16:53:56 2013 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D9A7332 for ; Mon, 16 Dec 2013 16:53:56 +0000 (UTC) Received: from webfw.progtech.net (fw1.progtech.net [195.226.167.243]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 305291266 for ; Mon, 16 Dec 2013 16:53:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at progtech.net Received: from [127.0.0.1] (localhost [127.0.0.1]) by webfw.progtech.net (8.14.5/8.14.2) with ESMTP id rBGGiJR5002291 for ; Mon, 16 Dec 2013 17:44:19 +0100 (CET) (envelope-from rg@progtech.net) Message-ID: <52AF2DE0.70101@progtech.net> Date: Mon, 16 Dec 2013 17:44:16 +0100 From: Rolf Grossmann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: freebsd-scsi@freebsd.org Subject: camcontrol rescan not updating disk size? X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 16:53:56 -0000 Hi, I'm having a problem with a virtualized system. I've grown the virtual disk, but my FreeBSD 9.1-STABLE r246991 won't recognize the new size: # grep da1 /var/run/dmesg.boot da1 at mpt0 bus 0 scbus2 target 1 lun 0 da1: Fixed Direct Access SCSI-2 device da1: 320.000MB/s transfers (160.000MHz DT, offset 127, 16bit) da1: Command Queueing enabled da1: 75776MB (155189248 512 byte sectors: 255H 63S/T 9660C) # camcontrol readcap 2:1:0 Last Block: 314572799, Block Length: 512 bytes # camcontrol rescan 2:1:0 Re-scan of 2:1:0 was successful # geom disk list da1 Geom name: da1 Providers: 1. Name: da1 Mediasize: 79456894976 (74G) Sectorsize: 512 Mode: r1w1e1 descr: VMware Virtual disk ident: (null) fwsectors: 63 fwheads: 255 IMHO that should now read "Mediasize: 161061273088 (150G)". (What I'm actually trying to do is "zpool online -e mypool da1", but that doesn't recognize the new size either, so I'm thinking geom is a good indicator of the system's idea of the disk size.) I've tried a full and targetd rescan multiple times to no avail. I don't see anything to rescan the size or flush some sort of cache. My Google searches also came up empty. I'm out of ideas what else to try short of a reboot (which I'd really like to avoid). Thanks, Rolf. From owner-freebsd-scsi@FreeBSD.ORG Mon Dec 16 17:27:59 2013 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C51FF2F1 for ; Mon, 16 Dec 2013 17:27:59 +0000 (UTC) Received: from smtp.infotech.no (smtp.infotech.no [82.134.31.41]) by mx1.freebsd.org (Postfix) with ESMTP id 803EA1539 for ; Mon, 16 Dec 2013 17:27:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.infotech.no (Postfix) with ESMTP id 6032B2041C3; Mon, 16 Dec 2013 18:27:51 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.6.6 (20110518) (Debian) at infotech.no Received: from smtp.infotech.no ([127.0.0.1]) by localhost (smtp.infotech.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oNTuGleG4nXs; Mon, 16 Dec 2013 18:27:51 +0100 (CET) Received: from [10.7.0.30] (unknown [10.7.0.30]) by smtp.infotech.no (Postfix) with ESMTPA id B208320415F; Mon, 16 Dec 2013 18:27:50 +0100 (CET) Message-ID: <52AF380A.30407@interlog.com> Date: Mon, 16 Dec 2013 12:27:38 -0500 From: Douglas Gilbert User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Rolf Grossmann , freebsd-scsi@freebsd.org Subject: Re: camcontrol rescan not updating disk size? References: <52AF2DE0.70101@progtech.net> In-Reply-To: <52AF2DE0.70101@progtech.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: dgilbert@interlog.com List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 17:27:59 -0000 On 13-12-16 11:44 AM, Rolf Grossmann wrote: > Hi, > > I'm having a problem with a virtualized system. I've grown the virtual > disk, but my FreeBSD 9.1-STABLE r246991 won't recognize the new size: > > # grep da1 /var/run/dmesg.boot > da1 at mpt0 bus 0 scbus2 target 1 lun 0 > da1: Fixed Direct Access SCSI-2 device > da1: 320.000MB/s transfers (160.000MHz DT, offset 127, 16bit) > da1: Command Queueing enabled > da1: 75776MB (155189248 512 byte sectors: 255H 63S/T 9660C) > > # camcontrol readcap 2:1:0 > Last Block: 314572799, Block Length: 512 bytes > > # camcontrol rescan 2:1:0 > Re-scan of 2:1:0 was successful > > # geom disk list da1 > Geom name: da1 > Providers: > 1. Name: da1 > Mediasize: 79456894976 (74G) > Sectorsize: 512 > Mode: r1w1e1 > descr: VMware Virtual disk > ident: (null) > fwsectors: 63 > fwheads: 255 > > IMHO that should now read "Mediasize: 161061273088 (150G)". > > (What I'm actually trying to do is "zpool online -e mypool da1", but > that doesn't recognize the new size either, so I'm thinking geom is a > good indicator of the system's idea of the disk size.) > > I've tried a full and targetd rescan multiple times to no avail. I don't > see anything to rescan the size or flush some sort of cache. My Google > searches also came up empty. I'm out of ideas what else to try short of > a reboot (which I'd really like to avoid). A related point: according to sbc3r36.pdf when an LU changes its size then it should "establish a unit attention condition with an additional sense code set to CAPACITY DATA HAS CHANGED". Can you determine if that happens? If it does then CAM needs enhancing, if not targetd needs some work. Doug Gilbert From owner-freebsd-scsi@FreeBSD.ORG Mon Dec 16 17:41:40 2013 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94AF2A13 for ; Mon, 16 Dec 2013 17:41:40 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 72A24167E for ; Mon, 16 Dec 2013 17:41:40 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id rBGHfdiw077727 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 Dec 2013 09:41:39 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rBGHfdPl077726; Mon, 16 Dec 2013 09:41:39 -0800 (PST) (envelope-from jmg) Date: Mon, 16 Dec 2013 09:41:39 -0800 From: John-Mark Gurney To: Douglas Gilbert Subject: Re: camcontrol rescan not updating disk size? Message-ID: <20131216174139.GA55638@funkthat.com> Mail-Followup-To: John-Mark Gurney , Douglas Gilbert , Rolf Grossmann , freebsd-scsi@freebsd.org References: <52AF2DE0.70101@progtech.net> <52AF380A.30407@interlog.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52AF380A.30407@interlog.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 16 Dec 2013 09:41:39 -0800 (PST) Cc: freebsd-scsi@freebsd.org, Rolf Grossmann X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 17:41:40 -0000 Douglas Gilbert wrote this message on Mon, Dec 16, 2013 at 12:27 -0500: > On 13-12-16 11:44 AM, Rolf Grossmann wrote: > >Hi, > > > >I'm having a problem with a virtualized system. I've grown the virtual > >disk, but my FreeBSD 9.1-STABLE r246991 won't recognize the new size: > > > ># grep da1 /var/run/dmesg.boot > >da1 at mpt0 bus 0 scbus2 target 1 lun 0 > >da1: Fixed Direct Access SCSI-2 device > >da1: 320.000MB/s transfers (160.000MHz DT, offset 127, 16bit) > >da1: Command Queueing enabled > >da1: 75776MB (155189248 512 byte sectors: 255H 63S/T 9660C) > > > ># camcontrol readcap 2:1:0 > >Last Block: 314572799, Block Length: 512 bytes > > > ># camcontrol rescan 2:1:0 > >Re-scan of 2:1:0 was successful > > > ># geom disk list da1 > >Geom name: da1 > >Providers: > >1. Name: da1 > > Mediasize: 79456894976 (74G) > > Sectorsize: 512 > > Mode: r1w1e1 > > descr: VMware Virtual disk > > ident: (null) > > fwsectors: 63 > > fwheads: 255 > > > >IMHO that should now read "Mediasize: 161061273088 (150G)". > > > >(What I'm actually trying to do is "zpool online -e mypool da1", but > >that doesn't recognize the new size either, so I'm thinking geom is a > >good indicator of the system's idea of the disk size.) > > > >I've tried a full and targetd rescan multiple times to no avail. I don't > >see anything to rescan the size or flush some sort of cache. My Google > >searches also came up empty. I'm out of ideas what else to try short of > >a reboot (which I'd really like to avoid). > > A related point: according to sbc3r36.pdf when an LU changes its > size then it should "establish a unit attention condition with an > additional sense code set to CAPACITY DATA HAS CHANGED". Can you > determine if that happens? If it does then CAM needs enhancing, if > not targetd needs some work. Just a quick search of the CAM code, and it looks like -HEAD does handle the CAPACITY DATA HAS CHANGED message.. sys/scsi/scsi_da.c:3537... A reboot would definately fix it, though it sounds like you're trying to avoid that... It also looks like a reopen of the device would reprobe the size... You could try to zpool replace w/ it self, but that might not cause a reopen, or if it's part of a mirror/raidz volume, you could offline/online the device and then it should have the new sizes... In my experience, zfs will detect the device already has valid data on it, and not have to resilver the whole device, but as usual, make sure you have good backups.. :) A zpool export/import would obviously do the same thing... Hope this helps. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-scsi@FreeBSD.ORG Mon Dec 16 21:17:52 2013 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7218FC29 for ; Mon, 16 Dec 2013 21:17:52 +0000 (UTC) Received: from outgoing.acpcloud.de (outgoing.acpcloud.de [109.68.51.22]) by mx1.freebsd.org (Postfix) with SMTP id CC9311EA8 for ; Mon, 16 Dec 2013 21:17:51 +0000 (UTC) Received: from CASHUB2.acp-xch.local (10.5.2.15) by EHUB2.acp-xch.local (10.5.2.11) with Microsoft SMTP Server (TLS) id 14.2.318.4; Mon, 16 Dec 2013 22:16:36 +0100 Received: from [192.168.0.11] (10.5.2.2) by mail.acpcloud.de (10.5.2.23) with Microsoft SMTP Server (TLS) id 14.2.318.4; Mon, 16 Dec 2013 22:16:36 +0100 Message-ID: <52AF6DB7.5010004@xamine.com> Date: Mon, 16 Dec 2013 22:16:39 +0100 From: Rolf Grossmann Organization: Xamine GmbH User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: , Subject: Re: camcontrol rescan not updating disk size? References: <52AF2DE0.70101@progtech.net> <52AF380A.30407@interlog.com> In-Reply-To: <52AF380A.30407@interlog.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.5.2.2] X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 21:17:52 -0000 On 16.12.2013 18:27, Douglas Gilbert wrote: > On 13-12-16 11:44 AM, Rolf Grossmann wrote: >> Hi, >> >> I'm having a problem with a virtualized system. I've grown the virtual >> disk, but my FreeBSD 9.1-STABLE r246991 won't recognize the new size: >> >> # grep da1 /var/run/dmesg.boot >> da1 at mpt0 bus 0 scbus2 target 1 lun 0 >> da1: Fixed Direct Access SCSI-2 device >> da1: 320.000MB/s transfers (160.000MHz DT, offset 127, 16bit) >> da1: Command Queueing enabled >> da1: 75776MB (155189248 512 byte sectors: 255H 63S/T 9660C) >> >> # camcontrol readcap 2:1:0 >> Last Block: 314572799, Block Length: 512 bytes >> >> # camcontrol rescan 2:1:0 >> Re-scan of 2:1:0 was successful >> >> # geom disk list da1 >> Geom name: da1 >> Providers: >> 1. Name: da1 >> Mediasize: 79456894976 (74G) >> Sectorsize: 512 >> Mode: r1w1e1 >> descr: VMware Virtual disk >> ident: (null) >> fwsectors: 63 >> fwheads: 255 >> >> IMHO that should now read "Mediasize: 161061273088 (150G)". >> >> (What I'm actually trying to do is "zpool online -e mypool da1", but >> that doesn't recognize the new size either, so I'm thinking geom is a >> good indicator of the system's idea of the disk size.) >> >> I've tried a full and targetd rescan multiple times to no avail. I don't >> see anything to rescan the size or flush some sort of cache. My Google >> searches also came up empty. I'm out of ideas what else to try short of >> a reboot (which I'd really like to avoid). > > A related point: according to sbc3r36.pdf when an LU changes its > size then it should "establish a unit attention condition with an > additional sense code set to CAPACITY DATA HAS CHANGED". Can you > determine if that happens? If it does then CAM needs enhancing, if > not targetd needs some work. I've reproduced the problem on my 9.2-STABLE test system that I can reboot and compiled in CAMDEBUG. As far as I can see the emulated scsi controller does not send any unit attention condition. Also, I think relying on the device to tell you about changes should be optional, but the rescan (or whatever other command I should use) should always detect the correct size. On the other hand, John-Mark Gurney is also correct in pointing out that closing and reopening the device (as in zpool export; zpool import) does update the size. Of course that still requires me to shut down everything running on that filesystem, which is what I'm trying to (though probably can't) avoid. So what's next? Should I open a bug report? Anything else I should try? Thanks for your help. Rolf. Rolf Grossmann Software Developer Xamine GmbH | Holzstra=DFe 28 | 80469 M=FCnchen Fon: +49 89 7201888-22 | Fax: +49 89 7201888-99 Gesch=E4ftsf=FChrer: Peter Herold | Sitz der GmbH: M=FCnchen, Deutschland Registergericht: AG M=FCnchen (HRB 167040) | USt-IdNr.: DE 253 181 639 From owner-freebsd-scsi@FreeBSD.ORG Wed Dec 18 19:01:43 2013 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB86378E for ; Wed, 18 Dec 2013 19:01:43 +0000 (UTC) Received: from smtp150.ord.emailsrvr.com (smtp150.ord.emailsrvr.com [173.203.6.150]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C02C1969 for ; Wed, 18 Dec 2013 19:01:43 +0000 (UTC) Received: from smtp11.relay.ord1a.emailsrvr.com (localhost.localdomain [127.0.0.1]) by smtp11.relay.ord1a.emailsrvr.com (SMTP Server) with ESMTP id BB995F0435; Wed, 18 Dec 2013 13:56:02 -0500 (EST) X-SMTPDoctor-Processed: csmtpprox 2.7.4 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp11.relay.ord1a.emailsrvr.com (SMTP Server) with ESMTP id AFF17F0486; Wed, 18 Dec 2013 13:56:02 -0500 (EST) X-Virus-Scanned: OK Received: from smtp192.mex05.mlsrvr.com (unknown [184.106.31.85]) by smtp11.relay.ord1a.emailsrvr.com (SMTP Server) with ESMTPS id 811BEF0435; Wed, 18 Dec 2013 13:56:02 -0500 (EST) Received: from ORD2MBX04D.mex05.mlsrvr.com ([fe80::90e2:baff:fe25:af8]) by ORD2HUB38.mex05.mlsrvr.com ([::1]) with mapi id 14.03.0158.001; Wed, 18 Dec 2013 12:56:02 -0600 From: Harald Weppner To: "aoyama@peach.ne.jp" Subject: isboot not compiling on FreeBSD10/stable Thread-Topic: isboot not compiling on FreeBSD10/stable Thread-Index: AQHO/CLLBtb2gRFsfEybc18h2N62ag== Date: Wed, 18 Dec 2013 18:56:01 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [152.179.42.173] Content-Type: multipart/signed; boundary="Apple-Mail=_7245098B-9483-4A80-A2AB-6C316F8F35F3"; protocol="application/pgp-signature"; micalg=pgp-sha512 MIME-Version: 1.0 Cc: "freebsd-scsi@freebsd.org" X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 19:01:43 -0000 --Apple-Mail=_7245098B-9483-4A80-A2AB-6C316F8F35F3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Dear Aoyama-san, have you had a chance to test isboot on FreeBSD 10/stable? Looks like a = few things changed and it doesn't compile out of the box, e.g. scsi.c:1087:3: error: incompatible pointer types passing 'void (void *, void *)' to parameter of type = 'int (*)(struct mbuf *, void *, void *)' [-Werror,-Wincompatible-pointer-types] MEXTADD(md, (caddr_t)ds_dd, (ISCSI_ALIGN(pp->ds_len) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @/sys/mbuf.h:782:50: note: expanded from macro 'MEXTADD' (void )m_extadd((m), (caddr_t)(buf), (size), (free), (arg1), = (arg2),\ ^~~~~~ @/sys/mbuf.h:920:13: note: passing argument to parameter here int (*)(struct mbuf *, void *, void *), void *, void = *, ^ I am booting a FreeBSD10b4 system via iPXE and am at the point where I = would need to mount the root volume via iscsi. Thanks & cheerio, Harry. --Apple-Mail=_7245098B-9483-4A80-A2AB-6C316F8F35F3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJSse+7AAoJEAK2yI4LwMAX4AMIAMNGM4y5mD9x6/03bxa3Vy6p X5evG8rzap4NzS66R43pZR5c+CYd6cJ4sJKlhqHaH9xgXiztEXlg6TV10TBuXxJR sN18qzojV85YLHuqt3Y0Eo6ZfbcWbO7/lb/ER6+2KJ+vdHMtdoszp1GICTKqxxy4 RxtjwyiaD/jeTRgeY8ZFcS9DUBL0qCB+edDzn99i39gw9j7+FpUUJyU1+zVcWpx5 l9zCnKTbWehxUTBxGD3SWsI2JDQvFz3iTKqbVuzw4omwFYDyoq41V4eJSSgH724o G7xxZ/hrA1Cxu8fvODW40sJq+HWcfcHDVzvZVdwLOsRXC9qycy4D5vOB9Sh853A= =o4Ep -----END PGP SIGNATURE----- --Apple-Mail=_7245098B-9483-4A80-A2AB-6C316F8F35F3-- From owner-freebsd-scsi@FreeBSD.ORG Fri Dec 20 16:02:59 2013 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 834A34E2 for ; Fri, 20 Dec 2013 16:02:59 +0000 (UTC) Received: from mailrelay010.isp.belgacom.be (mailrelay010.isp.belgacom.be [195.238.6.177]) by mx1.freebsd.org (Postfix) with ESMTP id 2021110D6 for ; Fri, 20 Dec 2013 16:02:58 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqMIADZptFJR8YJC/2dsb2JhbABZgws4GR4HC6ZvAZNsF3SCZhxfNCpAh38BCKIsqFGPL4QgBJgVkhWDLDs Received: from 66.130-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.130.66]) by relay.skynet.be with ESMTP; 20 Dec 2013 17:01:48 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id rBKG1l8H004519 for ; Fri, 20 Dec 2013 17:01:48 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Fri, 20 Dec 2013 17:01:47 +0100 From: Tijl Coosemans To: freebsd-scsi@FreeBSD.org Subject: Review patch for smartmontools Message-ID: <20131220170147.5e28d4d9@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 16:02:59 -0000 Hi, Could someone familiar with CAM please review this patch for smartmontools: http://www.freebsd.org/cgi/query-pr.cgi?pr=181836