From owner-svn-src-head@FreeBSD.ORG Mon Feb 23 21:09:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 297B3106566C; Mon, 23 Feb 2009 21:09:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0EAA8FC0C; Mon, 23 Feb 2009 21:09:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1NL9Sjx036222; Mon, 23 Feb 2009 21:09:28 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1NL9Snh036220; Mon, 23 Feb 2009 21:09:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200902232109.n1NL9Snh036220@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 23 Feb 2009 21:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188956 - in head/sys: fs/msdosfs ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 21:09:29 -0000 Author: trasz Date: Mon Feb 23 21:09:28 2009 New Revision: 188956 URL: http://svn.freebsd.org/changeset/base/188956 Log: Right now, when trying to unmount a device that's already gone, msdosfs_unmount() and ffs_unmount() exit early after getting ENXIO. However, dounmount() treats ENXIO as a success and proceeds with unmounting. In effect, the filesystem gets unmounted without closing GEOM provider etc. Reviewed by: kib Approved by: rwatson (mentor) Tested by: dho Sponsored by: FreeBSD Foundation Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Mon Feb 23 21:07:20 2009 (r188955) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Mon Feb 23 21:09:28 2009 (r188956) @@ -779,12 +779,12 @@ msdosfs_unmount(struct mount *mp, int mn if (mntflags & MNT_FORCE) flags |= FORCECLOSE; error = vflush(mp, 0, flags, td); - if (error) + if (error && error != ENXIO) return error; pmp = VFSTOMSDOSFS(mp); if ((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0) { error = markvoldirty(pmp, 0); - if (error) { + if (error && error != ENXIO) { (void)markvoldirty(pmp, 1); return (error); } @@ -835,7 +835,7 @@ msdosfs_unmount(struct mount *mp, int mn MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_LOCAL; MNT_IUNLOCK(mp); - return (0); + return (error); } static int Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Feb 23 21:07:20 2009 (r188955) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Feb 23 21:09:28 2009 (r188956) @@ -1079,7 +1079,7 @@ ffs_unmount(mp, mntflags, td) error = softdep_flushfiles(mp, flags, td); else error = ffs_flushfiles(mp, flags, td); - if (error != 0) + if (error != 0 && error != ENXIO) goto fail; UFS_LOCK(ump); @@ -1094,7 +1094,7 @@ ffs_unmount(mp, mntflags, td) 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) { fs->fs_clean = 0; goto fail; }