Subject: Re: CVS commit: src/sys/fs/smbfs
To: Bill Studenmund <wrstuden@netbsd.org>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: source-changes
Date: 02/25/2003 23:39:20
Bill Studenmund wrote:
> I'm concerned about the vref() in the error case. What happens when the
> vflush() has killed off the vnode corresponding to the root vnode? You
> either dereference NULL (if SMBTOV(smp->sm_root) returns NULL), or you
> start referencing an entirely different vnode. Oh, and bad things happen
> if smp->sm_root itself is NULL.

Thanks, didn't realize this :)

sm_root is expected to be !NULL on enter to smbfs_root(). There is
KASSERT() to this effect before the vrele(), too.

> You really need to do the gyrations done in smbfs_root(). Or do better
> checking to make sure you vref() what you think you are vref()ing.

I'm changing this to make sure sm_root is reset in case of failure,
calling smbfs_root() instead of vref() on error.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.org/
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-