-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DAOS-16822 dfs: follow on improvement for dfs_sys_mkdir_p #15569
Conversation
- improve performance when caching is disabled by not looking up full path each iteration. - return ENOTDIR instead of EEXIST if a file exists instead of dir. Required-githooks: true Signed-off-by: Mohamad Chaarawi <[email protected]>
Ticket title is 'Add mkdir_p variant to dfs_sys API' |
src/tests/suite/dfs_sys_unit_test.c
Outdated
@@ -879,8 +883,12 @@ dfs_sys_test_mkdir_p(void **state) | |||
|
|||
/* this shouldn't work */ | |||
rc = dfs_sys_mkdir_p(dfs_sys_mt, file, S_IWUSR | S_IRUSR, 0); | |||
assert_int_equal(rc, EEXIST); | |||
assert_int_equal(rc, ENOTDIR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was intentionally returning EEXIST before to be inline with this
$ mkdir dir
$ touch file
$ mkdir dir
mkdir: cannot create directory ‘dir’: File exists
$ mkdir file
mkdir: cannot create directory ‘file’: File exists
$ mkdir -p file
mkdir: cannot create directory ‘file’: File exists
And the C API - ENOTDIR is only when a parent path does not exist
https://linux.die.net/man/3/mkdir
EEXIST
The named file exists.
ENOTDIR
A component of the path prefix is not a directory.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i should be able to change ENOTDIR To EEXISTS for the last lookup of the leaf entry. will update
Required-githooks: true Signed-off-by: Mohamad Chaarawi <[email protected]>
Test stage Functional Hardware Medium Verbs Provider completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15569/4/execution/node/1565/log |
Required-githooks: true
Before requesting gatekeeper:
Features:
(orTest-tag*
) commit pragma was used or there is a reason documented that there are no appropriate tags for this PR.Gatekeeper: