MFC r204466:

Assert that the msdosfs vnode is (e)locked in several places.
Change the check and return on impossible condition into KASSERT().
This commit is contained in:
Konstantin Belousov 2010-03-24 14:10:08 +00:00
parent 99cb1f2430
commit 1a07617f97
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/8/; revision=205588
2 changed files with 8 additions and 8 deletions

View File

@ -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);

View File

@ -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)