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

Chris Johns chrisj at rtems.org
Thu Jul 20 07:52:15 UTC 2023


On 20/7/2023 5:24 pm, Cedric Berger wrote:
> 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

Yeah and thanks for the review. I think this should be:

/*
 * We need the parent directory so open can find the
 * entry. If we are creating the file the pathinfo
 * vnode entry is the directory to open uses to create
 * the file in.
 */

Chris


More information about the devel mailing list