From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 25 19:40:29 2009 Return-Path: Delivered-To: hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6638106566B; Sun, 25 Oct 2009 19:40:29 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 6373E8FC17; Sun, 25 Oct 2009 19:40:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n9PJYR3x063689; Sun, 25 Oct 2009 13:34:27 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 25 Oct 2009 13:34:37 -0600 (MDT) Message-Id: <20091025.133437.-1844000782.imp@bsdimp.com> To: usb@FreeBSD.org From: "M. Warner Losh" X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: hackers@FreeBSD.org Subject: Help troubleshooting... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 19:40:29 -0000 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: 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: 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. 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. 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