diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 2f4a6036ef8..0b80faa5a27 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1328,6 +1328,7 @@ kern_mknodat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, } if (error != 0) return (error); + NDPREINIT(&nd); restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | @@ -1436,6 +1437,7 @@ kern_mkfifoat(struct thread *td, int fd, const char *path, int error; AUDIT_ARG_MODE(mode); + NDPREINIT(&nd); restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | @@ -1566,6 +1568,7 @@ kern_linkat(struct thread *td, int fd1, int fd2, const char *path1, struct nameidata nd; int error; + NDPREINIT(&nd); do { bwillwrite(); NDINIT_ATRIGHTS(&nd, LOOKUP, AUDITVNODE1 | at2cnpflags(flag, @@ -1714,6 +1717,7 @@ kern_symlinkat(struct thread *td, const char *path1, int fd, const char *path2, syspath = tmppath; } AUDIT_ARG_TEXT(syspath); + NDPREINIT(&nd); restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | @@ -1778,6 +1782,7 @@ sys_undelete(struct thread *td, struct undelete_args *uap) struct nameidata nd; int error; + NDPREINIT(&nd); restart: bwillwrite(); NDINIT(&nd, DELETE, LOCKPARENT | DOWHITEOUT | AUDITVNODE1, @@ -1891,6 +1896,7 @@ kern_funlinkat(struct thread *td, int dfd, const char *path, int fd, return (error); } + NDPREINIT(&nd); restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1 | @@ -3422,6 +3428,7 @@ kern_truncate(struct thread *td, const char *path, enum uio_seg pathseg, if (length < 0) return (EINVAL); + NDPREINIT(&nd); retry: NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, td); if ((error = namei(&nd)) != 0) @@ -3789,6 +3796,7 @@ kern_mkdirat(struct thread *td, int fd, const char *path, enum uio_seg segflg, int error; AUDIT_ARG_MODE(mode); + NDPREINIT(&nd); restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | @@ -3859,6 +3867,7 @@ kern_frmdirat(struct thread *td, int dfd, const char *path, int fd, return (error); } + NDPREINIT(&nd); restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1 | diff --git a/sys/sys/namei.h b/sys/sys/namei.h index 5f3d917083a..b4db0e758e2 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -265,6 +265,9 @@ do { \ _ndp->ni_startdir = NULL; \ } while (0) +#define NDPREINIT(ndp) do { \ +} while (0) + #define NDF_NO_DVP_RELE 0x00000001 #define NDF_NO_DVP_UNLOCK 0x00000002 #define NDF_NO_DVP_PUT 0x00000003