Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/fs/smbfs



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@localhost>            
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.''     -=-



Home | Main Index | Thread Index | Old Index