Do not leak vnode lock when msdosfs mount is updated and specified

device is different from the device used to the original mount.

Note that update_mp does not need devvp locked, and pmp->pm_devvp cannot
be freed meantime.

Reported and tested by:	pho
MFC after:	3 weeks
This commit is contained in:
Konstantin Belousov 2010-03-02 17:24:33 +00:00
parent e1c6ef6aa4
commit 6c0358cc98
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=204589

View file

@ -383,10 +383,9 @@ msdosfs_mount(struct mount *mp)
pmp = VFSTOMSDOSFS(mp);
#endif
} else {
if (devvp != pmp->pm_devvp)
error = EINVAL; /* XXX needs translation */
else
vput(devvp);
if (devvp != pmp->pm_devvp)
return (EINVAL); /* XXX needs translation */
}
if (error) {
vrele(devvp);