Date: Sun, 25 Oct 2009 21:49:23 +0200 From: Kostik Belousov <kostikbel@gmail.com> To: "M. Warner Losh" <imp@bsdimp.com> Cc: usb@freebsd.org, hackers@freebsd.org Subject: Re: Help troubleshooting... Message-ID: <20091025194923.GU2160@deviant.kiev.zoral.com.ua> In-Reply-To: <20091025.133437.-1844000782.imp@bsdimp.com> References: <20091025.133437.-1844000782.imp@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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.
>
> 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.
>
> Here's the dmesg messages:
>
> # Plug it in
> da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
> da0: <HP v125w PMAP> Removable Direct Access SCSI-0 device
> 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: <HP> 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
>
> So devfs thinks the device went missing:
>
> static int
> devfs_fsync(struct vop_fsync_args *ap)
> {
> ...
> if (!vn_isdisk(ap->a_vp, &error)) {
> bo = &ap->a_vp->v_bufobj;
> de = ap->a_vp->v_data;
> if (error == 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);
> ...
>
> So it thinks that it isn't a disk. vn_isdisk is return ENXIO because
> either vp->v_rdev == NULL or the v_rdev->si_devsw == 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().
>
> 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.
>
> This is with the following system:
>
> FreeBSD lighthouse 9.0-CURRENT FreeBSD 9.0-CURRENT #41 r185338:198411M: Fri Oct 23 10:08:48 MDT 2009 imp@lighthouse:/cache/svn/head/sys/amd64/compile/LIGHTHOUSE amd64
>
> 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"
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)
iEYEARECAAYFAkrkq8MACgkQC3+MBN1Mb4jsGwCghNdBHrhlT1IeYWDs2aDnNQO4
G8AAoJteKOCwfqVpCtN4IPYSSa+g50OY
=SqpD
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091025194923.GU2160>
