From owner-freebsd-usb@FreeBSD.ORG Sun Oct 25 20:14:48 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6714106568B for ; Sun, 25 Oct 2009 20:14:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 32C5E8FC08 for ; Sun, 25 Oct 2009 20:14:47 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n9PJnNQY050464 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 25 Oct 2009 21:49:23 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n9PJnNG8064363; Sun, 25 Oct 2009 21:49:23 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n9PJnNeM064362; Sun, 25 Oct 2009 21:49:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 25 Oct 2009 21:49:23 +0200 From: Kostik Belousov To: "M. Warner Losh" Message-ID: <20091025194923.GU2160@deviant.kiev.zoral.com.ua> References: <20091025.133437.-1844000782.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4StcSGwj0FoelDaN" Content-Disposition: inline In-Reply-To: <20091025.133437.-1844000782.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: usb@freebsd.org, hackers@freebsd.org Subject: Re: Help troubleshooting... X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 20:14:48 -0000 --4StcSGwj0FoelDaN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 25, 2009 at 01:34:37PM -0600, M. Warner Losh wrote: > I have a usb stick (8GB) on it. This stick has about 5GB of junk on > it at this point. >=20 > I tried to do 'cat * > /dev/null' recently, to measure how fast it > goes. It got about 1GB into the drive and then I got device missing > messages. >=20 > Here's the dmesg messages: >=20 > # Plug it in > da0 at umass-sim0 bus 0 scbus2 target 0 lun 0 > da0: Removable Direct Access SCSI-0 device=20 > da0: 40.000MB/s transfers > da0: 7660MB (15687680 512 byte sectors: 255H 63S/T 976C) > # mount it, etc > # run the cat command > Device da0s1 went missing before all of the data could be written to it; = expect data loss. > # get error messages > # Remove the drive > ugen2.2: at usbus2 (disconnected) > umass0: at uhub2, port 1, addr 2 (disconnected) > (da0:umass-sim0:0:0:0): lost device > (da0:umass-sim0:0:0:0): removing device entry >=20 > So devfs thinks the device went missing: >=20 > static int > devfs_fsync(struct vop_fsync_args *ap) > { > ... > if (!vn_isdisk(ap->a_vp, &error)) { > bo =3D &ap->a_vp->v_bufobj; > de =3D ap->a_vp->v_data; > if (error =3D=3D ENXIO && bo->bo_dirty.bv_cnt > 0) { > printf("Device %s went missing before all of the data " > "could be written to it; expect data loss.\n", > de->de_dirent->d_name); > ... >=20 > So it thinks that it isn't a disk. vn_isdisk is return ENXIO because > either vp->v_rdev =3D=3D NULL or the v_rdev->si_devsw =3D=3D NULL. si_devsw is cleared in kern_conf.c:destroy_devl, line 835. I think USB subsystem called either destroy_dev() or destroy_dev_sched(). >=20 > So how the heck can that happen without other warnings? It appears > the only place it is set like this is in devfs_reclaim. But I'm > having trouble tracking down where *THAT* is called. Reclaim might be called if devfs mount point is forcibly unmounted special vnode from which you used to mount pendrive. >=20 > This is with the following system: >=20 > FreeBSD lighthouse 9.0-CURRENT FreeBSD 9.0-CURRENT #41 r185338:198411M: F= ri Oct 23 10:08:48 MDT 2009 imp@lighthouse:/cache/svn/head/sys/amd64/co= mpile/LIGHTHOUSE amd64 >=20 > Warner > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" --4StcSGwj0FoelDaN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrkq8MACgkQC3+MBN1Mb4jsGwCghNdBHrhlT1IeYWDs2aDnNQO4 G8AAoJteKOCwfqVpCtN4IPYSSa+g50OY =SqpD -----END PGP SIGNATURE----- --4StcSGwj0FoelDaN--