Skip to content

Commit

Permalink
handle walking "." properly
Browse files Browse the repository at this point in the history
  • Loading branch information
swills committed Feb 27, 2022
1 parent f60ae26 commit 37bbe0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sys/dev/virtio/9pfs/virtfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@ virtfs_lookup(struct vop_lookup_args *ap)
* If the client_walk fails, it means the file looking for doesnt exist.
* Create the file is the flags are set or just return the error
*/
newfid = p9_client_walk(dvfid, 1, &cnp->cn_nameptr, 1, &error);
if (cnp->cn_nameptr[0] == '.' && strlen(cnp->cn_nameptr) == 1) {
newfid = p9_client_walk(dvfid, 0, NULL, 1, &error);
} else {
newfid = p9_client_walk(dvfid, 1, &cnp->cn_nameptr, 1, &error);
}

cnp->cn_nameptr[cnp->cn_namelen] = tmpchr;

Expand Down

0 comments on commit 37bbe0c

Please sign in to comment.