提交 08ca99d0 编写于 作者: O openharmony_ci 提交者: Gitee

!17 fix nfs rmdir crash

Merge pull request !17 from 野生毛霉君/master
......@@ -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.
先完成此消息的编辑!
想要评论请 注册