* Have tmpfs_nrmdir() test whether the vp is a directory and return
the proper error before asserting that it is a directory.
* Fixes assertion panic if you attempt to rmdir a file in tmpfs.
struct vnode *dvp = v->a_dvp;
struct namecache *ncp = v->a_nch->ncp;
struct vnode *vp;
-
- int error;
struct tmpfs_dirent *de;
struct tmpfs_mount *tmp;
struct tmpfs_node *dnode;
struct tmpfs_node *node;
+ int error;
+
+ /*
+ * Prevalidate so we don't hit an assertion later
+ */
+ if (vp->v_type != VDIR)
+ return ENOTDIR;
/*
* We have to acquire the vp from v->a_nch because