From owner-p4-projects@FreeBSD.ORG Tue Sep 4 07:55:26 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F0F6C16A420; Tue, 4 Sep 2007 07:55:25 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97A8C16A419 for ; Tue, 4 Sep 2007 07:55:25 +0000 (UTC) (envelope-from delphij@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8278D13C428 for ; Tue, 4 Sep 2007 07:55:25 +0000 (UTC) (envelope-from delphij@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l847tPW5003377 for ; Tue, 4 Sep 2007 07:55:25 GMT (envelope-from delphij@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l847tPbn003371 for perforce@freebsd.org; Tue, 4 Sep 2007 07:55:25 GMT (envelope-from delphij@freebsd.org) Date: Tue, 4 Sep 2007 07:55:25 GMT Message-Id: <200709040755.l847tPbn003371@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to delphij@freebsd.org using -f From: Xin LI To: Perforce Change Reviews Cc: Subject: PERFORCE change 126033 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2007 07:55:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=126033 Change 126033 by delphij@delphij_odin on 2007/09/04 07:54:39 Use bde@'s proposed changes. Affected files ... .. //depot/projects/delphij_fork/sys/fs/msdosfs/msdosfs_vfsops.c#10 edit Differences ... ==== //depot/projects/delphij_fork/sys/fs/msdosfs/msdosfs_vfsops.c#10 (text+ko) ==== @@ -275,8 +275,8 @@ return (error); /* - * Now the volume is clean. We have to mark it so - * when the device is still r/w. + * Now the volume is clean. Mark it so while the + * device is still rw. */ error = markvoldirty(pmp, 0); if (error) { @@ -284,7 +284,7 @@ return (error); } - /* Downgrade the device from rw to ro. */ + /* Downgrade the device from rw to ro. */ DROP_GIANT(); g_topology_lock(); error = g_access(pmp->pm_cp, 0, -1, 0); @@ -299,9 +299,8 @@ * Backing out after an error was painful in the * above. Now we are committed to succeeding. */ - pmp->pm_fmod = 0; + pmp->pm_fmod = 0; pmp->pm_flags |= MSDOSFSMNT_RONLY; - MNT_ILOCK(mp); mp->mnt_flag |= MNT_RDONLY; MNT_IUNLOCK(mp); @@ -329,22 +328,22 @@ PICKUP_GIANT(); if (error) return (error); - } - /* - * XXX: pm_fmod is only used to implement a panic - * if we forget to set it here. - */ - pmp->pm_fmod = 1; - pmp->pm_flags &= ~MSDOSFSMNT_RONLY; - MNT_ILOCK(mp); - mp->mnt_flag &= ~MNT_RDONLY; - MNT_IUNLOCK(mp); + /* + * XXX: pm_fmod is only used to implement a panic + * if we forget to set it here. + */ + pmp->pm_fmod = 1; + pmp->pm_flags &= ~MSDOSFSMNT_RONLY; + MNT_ILOCK(mp); + mp->mnt_flag &= ~MNT_RDONLY; + MNT_IUNLOCK(mp); - /* Now that the volume is modifiable, mark it dirty. */ - error = markvoldirty(pmp, 1); - if (error) - return (error); + /* Now that the volume is modifiable, mark it dirty. */ + error = markvoldirty(pmp, 1); + if (error) + return (error); + } } /* * Not an update, or updating the name: look up the name @@ -735,7 +734,7 @@ pmp->pm_flags |= MSDOSFSMNT_RONLY; else { if ((error = markvoldirty(pmp, 1)) != 0) { - (void)markvoldirty(pmp, 0); + (void)markvoldirty(pmp, 0); goto error_exit; } pmp->pm_fmod = 1; @@ -787,15 +786,13 @@ if (error) return error; pmp = VFSTOMSDOSFS(mp); - if ((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0) { error = markvoldirty(pmp, 0); if (error) { (void)markvoldirty(pmp, 1); return (error); } - } - + } if (pmp->pm_flags & MSDOSFSMNT_KICONV && msdosfs_iconv) { if (pmp->pm_w2u) msdosfs_iconv->close(pmp->pm_w2u); @@ -806,6 +803,7 @@ if (pmp->pm_u2d) msdosfs_iconv->close(pmp->pm_u2d); } + #ifdef MSDOSFS_DEBUG { struct vnode *vp = pmp->pm_devvp; @@ -830,9 +828,8 @@ PICKUP_GIANT(); vrele(pmp->pm_devvp); free(pmp->pm_inusemap, M_MSDOSFSFAT); - if (pmp->pm_flags & MSDOSFS_LARGEFS) { + if (pmp->pm_flags & MSDOSFS_LARGEFS) msdosfs_fileno_free(mp); - } free(pmp, M_MSDOSFSMNT); mp->mnt_data = (qaddr_t)0; MNT_ILOCK(mp);