tech-kern archive

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

Re: smbfs umount kernel panic fixes for review



On Wed Jul 01 2009 at 19:13:40 +0200, Nicolas Joly wrote:
> > Generally, IIRC, vflush() with a non-null special node always leads to
> > some kind of trouble.  What happens now if you have someone with cwd in
> > the mountpoint root?
> 
> In that case, v_usecount for the root will be greater than 1 ... And
> the following test will prevent unmounting:
> 
>     if (smbfs_rootvp->v_usecount > 1 && (mntflags & MNT_FORCE) == 0)
>             return EBUSY;

Oh, right.  that's iffy

> > If the root vnode being unconditionally destroyed is in fact the problem,
> > the solution is to make VFS_ROOT() do the right thing.
> 
> Does removing the root vnode, while currently in use do make sense ?
> At least `struct smbnode' refers to it with its n_parent member.

No.  But vflush() will DTRT unless there are weird extra references
floating around.  In general the "take extra reference to root vnode"
is the wrong thing to do.

But like I said, I didn't look at the code, so I don't know how much
work properly fixing it is vs. just fixing the panic with hacks.  And I
don't really care so no objection to your patch ;)


Home | Main Index | Thread Index | Old Index