Nullfs - Panic when umounting and lower fs has been removed

Antoine Brodin antoine at FreeBSD.org
Mon May 20 09:05:08 UTC 2013


On Mon, May 20, 2013 at 7:34 AM, Konstantin Belousov
<kostikbel at gmail.com> wrote:
> This is strange, do you have witness enabled, but invariants not ?
>
> Please try the following change.
>
> diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c
> index ad02236..bece8c8 100644
> --- a/sys/fs/nullfs/null_vfsops.c
> +++ b/sys/fs/nullfs/null_vfsops.c
> @@ -417,8 +417,13 @@ nullfs_unlink_lowervp(struct mount *mp, struct vnode *lowervp)
>          */
>         if (vp->v_usecount == 0) {
>                 KASSERT((vp->v_iflag & VI_DOOMED) != 0,
> -                   ("not reclaimed %p", vp));
> +                   ("not reclaimed nullfs vnode %p", vp));
>                 VOP_UNLOCK(vp, 0);
> +       } else {
> +               ASSERT_VOP_ELOCKED(vp, "unlink_lowervp");
> +               KASSERT((vp->v_iflag & VI_DOOMED) == 0,
> +                   ("reclaimed nullfs vnode %p", vp));
> +               xp->null_flags &= ~NULLV_NOUNLOCK;
>         }
>         vdrop(vp);
>  }

I have both witness and invariants.
And this patch fixes the panic.

Thanks!

Antoine


More information about the freebsd-fs mailing list