Author: kib
Date: Wed Mar 24 14:10:08 2010
New Revision: 205588
URL: http://svn.freebsd.org/changeset/base/205588

Log:
  MFC r204466:
  Assert that the msdosfs vnode is (e)locked in several places.
  Change the check and return on impossible condition into KASSERT().

Modified:
  stable/8/sys/fs/msdosfs/msdosfs_denode.c
  stable/8/sys/fs/msdosfs/msdosfs_fat.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/net/   (props changed)

Modified: stable/8/sys/fs/msdosfs/msdosfs_denode.c
==============================================================================
--- stable/8/sys/fs/msdosfs/msdosfs_denode.c    Wed Mar 24 14:08:01 2010        
(r205587)
+++ stable/8/sys/fs/msdosfs/msdosfs_denode.c    Wed Mar 24 14:10:08 2010        
(r205588)
@@ -167,9 +167,8 @@ deget(pmp, dirclust, diroffset, depp)
        ldep->de_dirclust = dirclust;
        ldep->de_diroffset = diroffset;
        ldep->de_inode = inode;
-       fc_purge(ldep, 0);      /* init the fat cache for this denode */
-
        lockmgr(nvp->v_vnlock, LK_EXCLUSIVE, NULL);
+       fc_purge(ldep, 0);      /* init the fat cache for this denode */
        error = insmntque(nvp, mntp);
        if (error != 0) {
                free(ldep, M_MSDOSFSNODE);

Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c
==============================================================================
--- stable/8/sys/fs/msdosfs/msdosfs_fat.c       Wed Mar 24 14:08:01 2010        
(r205587)
+++ stable/8/sys/fs/msdosfs/msdosfs_fat.c       Wed Mar 24 14:10:08 2010        
(r205588)
@@ -139,12 +139,9 @@ pcbmap(dep, findcn, bnp, cnp, sp)
        struct msdosfsmount *pmp = dep->de_pmp;
        u_long bsize;
 
-       /*
-        * If they don't give us someplace to return a value then don't
-        * bother doing anything.
-        */
-       if (bnp == NULL && cnp == NULL && sp == NULL)
-               return (0);
+       KASSERT(bnp != NULL || cnp != NULL || sp != NULL,
+           ("pcbmap: extra call"));
+       ASSERT_VOP_ELOCKED(DETOV(dep), "pcbmap");
 
        cn = dep->de_StartCluster;
        /*
@@ -270,6 +267,8 @@ fc_lookup(dep, findcn, frcnp, fsrcnp)
        u_long cn;
        struct fatcache *closest = 0;
 
+       ASSERT_VOP_LOCKED(DETOV(dep), "fc_lookup");
+
        for (i = 0; i < FC_SIZE; i++) {
                cn = dep->de_fc[i].fc_frcn;
                if (cn != FCE_EMPTY && cn <= findcn) {
@@ -295,6 +294,8 @@ fc_purge(dep, frcn)
        int i;
        struct fatcache *fcp;
 
+       ASSERT_VOP_ELOCKED(DETOV(dep), "fc_purge");
+
        fcp = dep->de_fc;
        for (i = 0; i < FC_SIZE; i++, fcp++) {
                if (fcp->fc_frcn >= frcn)
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to