From owner-freebsd-fs@FreeBSD.ORG Thu May 24 13:46:17 2007 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4BA316A421 for ; Thu, 24 May 2007 13:46:17 +0000 (UTC) (envelope-from klim_serega@ufps.chita.ru) Received: from ufps.chita.ru (ufps.chita.ru [213.59.235.130]) by mx1.freebsd.org (Postfix) with ESMTP id B8C4113C44B for ; Thu, 24 May 2007 13:46:16 +0000 (UTC) (envelope-from klim_serega@ufps.chita.ru) Received: from ufps.chita.ru (localhost.ufps.chita.ru [127.0.0.1]) by ufps.chita.ru (Postfix) with ESMTP id C1F0C410E60 for ; Thu, 24 May 2007 23:46:14 +1000 (YAKST) Received: from [10.200.110.142] (unknown [87.103.236.113]) by ufps.chita.ru (Postfix) with ESMTP id 64F0F410E30 for ; Thu, 24 May 2007 23:46:14 +1000 (YAKST) From: "Zver Z." To: freebsd-fs@freebsd.org Content-Type: multipart/mixed; boundary="=-ETfS36tLs1IuwtALdwwE" Date: Thu, 24 May 2007 23:31:14 +1000 Message-Id: <1180013474.1217.14.camel@XATA.RU> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1.1 FreeBSD GNOME Team Port X-Virus-Scanned: ClamAV v0.9 on ufps.chita.ru X-Mailman-Approved-At: Thu, 24 May 2007 14:03:12 +0000 Subject: System crash while trying to unmount manually ejected USB Flash drive X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2007 13:46:17 -0000 --=-ETfS36tLs1IuwtALdwwE Content-Type: text/plain Content-Transfer-Encoding: 7bit test patch FreeBSD 6.2, (pycckie ya ploho znay engl, esli shto pishite na mail) _________________________________________________________________________________ It'is current problem) _________________________________________________________________________________ --- /sys/kern/vfs_subr.c Mon Dec 4 17:47:53 2006 +++ vfs_subr.c Thu May 17 20:31:58 2007 @@ -1029,8 +1029,10 @@ * enabled under INVARIANTS */ BO_LOCK(bo); - if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0) - panic("vinvalbuf: dirty bufs"); + if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0) { + printf("bufobj_invalbuf: warning panic not run, error=%d\n", error); + flags = 0; + } } } /* _________________________________________________________________________________ panic whith msdosfs on flash(page fault) _________________________________________________________________________________ --- /sys/fs/msdosfs/msdosfs_vnops.c Mon Mar 13 12:05:13 2006 +++ msdosfs_vnops.c Thu May 17 11:44:23 2007 @@ -1834,7 +1834,9 @@ printf("\tstartcluster %lu, dircluster %lu, diroffset %lu, ", dep->de_StartCluster, dep->de_dirclust, dep->de_diroffset); - printf("on dev %s\n", devtoname(dep->de_dev)); + if (dep->de_dev != NULL) { + printf("on dev %s\n", devtoname(dep->de_dev)); + } return (0); } _________________________________________________________________________________ _________________________________________________________________________________ --- /sys/fs/msdosfs/msdosfs_vfsops.c Wed Dec 20 12:05:30 2006 +++ msdosfs_vfsops.c Wed May 16 21:24:03 2007 @@ -766,8 +766,10 @@ /* If the volume was mounted read/write, mark it clean now. */ if ((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0) { error = markvoldirty(pmp, 0); - if (error && (flags & FORCECLOSE) == 0) + if (error && (flags & FORCECLOSE) == 0 && (error & ENXIO) == 0) return (error); + if (error & ENXIO) + error = 0; } #ifdef MSDOSFS_DEBUG { _________________________________________________________________________________ _________________________________________________________________________________ --- /sys/ufs/ffs/ffs_vfsops.c Mon May 21 22:06:40 2007 +++ ffs_vfsops.c Mon May 21 22:07:35 2007 @@ -979,10 +979,12 @@ if (fs->fs_ronly == 0) { fs->fs_clean = fs->fs_flags & (FS_UNCLEAN|FS_NEEDSFSCK) ? 0 : 1; error = ffs_sbupdate(ump, MNT_WAIT, 0); - if (error) { + if (error && (error & ENXIO) == 0) { fs->fs_clean = 0; return (error); } + if (error & ENXIO) + error = 0; } DROP_GIANT(); g_topology_lock(); _________________________________________________________________________________ _________________________________________________________________________________ --- /sys/kern/vfs_mount.c Wed Oct 25 01:02:39 2006 +++ vfs_mount.c Thu May 17 11:48:49 2007 @@ -1194,6 +1194,10 @@ (flags & MNT_FORCE)) { error = VFS_UNMOUNT(mp, flags, td); } + if (error & ENXIO) { + printf("dounmount: error=%d\n", error); + error = VFS_UNMOUNT(mp, 0, td); + } vn_finished_write(mp); if (error) { /* Undo cdir/rdir and rootvnode changes made above. */ _________________________________________________________________________________ sorry my english))) --=-ETfS36tLs1IuwtALdwwE Content-Disposition: attachment; filename=vfs_subr.patch Content-Type: text/x-patch; name=vfs_subr.patch; charset=KOI8-R Content-Transfer-Encoding: 7bit --- /sys/kern/vfs_subr.c Mon Dec 4 17:47:53 2006 +++ vfs_subr.c Thu May 17 20:31:58 2007 @@ -1029,8 +1029,10 @@ * enabled under INVARIANTS */ BO_LOCK(bo); - if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0) - panic("vinvalbuf: dirty bufs"); + if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0) { + printf("bufobj_invalbuf: warning panic not run, error=%d\n", error); + flags = 0; + } } } /* --=-ETfS36tLs1IuwtALdwwE Content-Disposition: attachment; filename=vfs_mount.patch Content-Type: text/x-patch; name=vfs_mount.patch; charset=KOI8-R Content-Transfer-Encoding: 7bit --- /sys/kern/vfs_mount.c Wed Oct 25 01:02:39 2006 +++ vfs_mount.c Thu May 17 11:48:49 2007 @@ -1194,6 +1194,10 @@ (flags & MNT_FORCE)) { error = VFS_UNMOUNT(mp, flags, td); } + if (error & ENXIO) { + printf("dounmount: error=%d\n", error); + error = VFS_UNMOUNT(mp, 0, td); + } vn_finished_write(mp); if (error) { /* Undo cdir/rdir and rootvnode changes made above. */ --=-ETfS36tLs1IuwtALdwwE Content-Disposition: attachment; filename=msdosfs_vnops.patch Content-Type: text/x-patch; name=msdosfs_vnops.patch; charset=KOI8-R Content-Transfer-Encoding: 7bit --- /sys/fs/msdosfs/msdosfs_vnops.c Mon Mar 13 12:05:13 2006 +++ msdosfs_vnops.c Thu May 17 11:44:23 2007 @@ -1834,7 +1834,9 @@ printf("\tstartcluster %lu, dircluster %lu, diroffset %lu, ", dep->de_StartCluster, dep->de_dirclust, dep->de_diroffset); - printf("on dev %s\n", devtoname(dep->de_dev)); + if (dep->de_dev != NULL) { + printf("on dev %s\n", devtoname(dep->de_dev)); + } return (0); } --=-ETfS36tLs1IuwtALdwwE Content-Disposition: attachment; filename=msdosfs_vfsops.patch Content-Type: text/x-patch; name=msdosfs_vfsops.patch; charset=KOI8-R Content-Transfer-Encoding: 7bit --- /sys/fs/msdosfs/msdosfs_vfsops.c Wed Dec 20 12:05:30 2006 +++ msdosfs_vfsops.c Wed May 16 21:24:03 2007 @@ -766,8 +766,10 @@ /* If the volume was mounted read/write, mark it clean now. */ if ((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0) { error = markvoldirty(pmp, 0); - if (error && (flags & FORCECLOSE) == 0) + if (error && (flags & FORCECLOSE) == 0 && (error & ENXIO) == 0) return (error); + if (error & ENXIO) + error = 0; } #ifdef MSDOSFS_DEBUG { --=-ETfS36tLs1IuwtALdwwE Content-Disposition: attachment; filename=ffs_vfsops.patch Content-Type: text/x-patch; name=ffs_vfsops.patch; charset=KOI8-R Content-Transfer-Encoding: 7bit --- /sys/ufs/ffs/ffs_vfsops.c Mon May 21 22:06:40 2007 +++ ffs_vfsops.c Mon May 21 22:07:35 2007 @@ -979,10 +979,12 @@ if (fs->fs_ronly == 0) { fs->fs_clean = fs->fs_flags & (FS_UNCLEAN|FS_NEEDSFSCK) ? 0 : 1; error = ffs_sbupdate(ump, MNT_WAIT, 0); - if (error) { + if (error && (error & ENXIO) == 0) { fs->fs_clean = 0; return (error); } + if (error & ENXIO) + error = 0; } DROP_GIANT(); g_topology_lock(); --=-ETfS36tLs1IuwtALdwwE--