[PATCH rtems-libbsd/6-freebsd-12 2/3] syscall/open: Reference the path info directory vnode

Cedric Berger cedric at precidata.com
Thu Jul 20 07:24:32 UTC 2023


On 20.07.23 07:45, chrisj at rtems.org wrote:

> From: Chris Johns <chrisj at rtems.org>
>
> The kernel open call requires a path so to open a file we need to
> set the current directory to the parent vnode. If the open mode is
> create the path info vnode is the directory to perform the open
> create in. Using the parent node creates the file in wrong path.
>
> Updates #4723
> ---
>   rtemsbsd/rtems/rtems-bsd-syscall-api.c | 24 ++++++---
>   testsuite/nfs01/test_main.c            | 75 ++++++++++++++++----------
>   2 files changed, 64 insertions(+), 35 deletions(-)
>
> diff --git a/rtemsbsd/rtems/rtems-bsd-syscall-api.c b/rtemsbsd/rtems/rtems-bsd-syscall-api.c
> index 76fc8ad7..cfceb768 100644
> --- a/rtemsbsd/rtems/rtems-bsd-syscall-api.c
> +++ b/rtemsbsd/rtems/rtems-bsd-syscall-api.c
> @@ -931,9 +931,18 @@ rtems_bsd_sysgen_open_node(
>   	} else {
>   		rtems_filesystem_location_info_t *rootloc =
>   		    &iop->pathinfo.mt_entry->mt_fs_root->location;
> +		/*
> +		 * We need the parent directory so open can find the
> +		 * the entry. If we are creating the file the pathinfo

the the

Cedric


More information about the devel mailing list