提交 e5709a2a 编写于 作者: M mucor

fix nfs rmdir crash

Change-Id: I832a8c1d4110b414214e88d09483ec4f5d7bf4a4
上级 a0697c96
......@@ -2229,12 +2229,6 @@ int vfs_nfs_rmdir(struct Vnode *parent, struct Vnode *target, char *dirname)
int namelen;
uint32_t *ptr = NULL;
int error;
if (target_node->n_type != NFDIR)
{
PRINTK("ERROR: try to remove a non-dir\n");
return -ENOTDIR;
}
nfs_mux_take(nmp);
error = nfs_checkmount(nmp);
if (error != OK)
......@@ -2245,6 +2239,13 @@ int vfs_nfs_rmdir(struct Vnode *parent, struct Vnode *target, char *dirname)
parent_node = (struct nfsnode*)(parent->data);
target_node = (struct nfsnode*)(target->data);
if (target_node->n_type != NFDIR)
{
PRINTK("ERROR: try to remove a non-dir\n");
return -ENOTDIR;
}
/* Set up the RMDIR call message arguments */
ptr = (uint32_t *)&nmp->nm_msgbuffer.rmdir.rmdir;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册