-
Notifications
You must be signed in to change notification settings - Fork 821
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
Added '.' and '..' special folder t WASI fd_readdir return (for #3033) #3065
Conversation
This should fix #3033 |
entry_vec.push((".".to_string(), __WASI_FILETYPE_DIRECTORY, 0)); | ||
entry_vec.push(("..".to_string(), __WASI_FILETYPE_DIRECTORY, 0)); |
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.
Ummm... what about the root? We shouldn't add ..
to readdir in the root.
Can you also add a test case for this? Thanks
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.
But, isn't Root the next match
here?
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.
Also, side comment. Do you have insight on why our fix is quite different from wasmtime's one?
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.
What I hesitated is adding "." to a root readdir
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.
the root cause was completly different: it's not a buffer size issue here, it's the missing "." and "..". All the 201 folder appears correctly, just missing the special folders
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.
So no, adding "." to fd_readdir of root is a bad idea, it breaks things (tests that read root).
@@ -1321,6 +1321,10 @@ pub fn fd_readdir<M: MemorySize>( | |||
(entry.name.to_string(), stat.st_filetype, stat.st_ino) | |||
}), | |||
); | |||
// adding . and .. special folders | |||
// TODO: inode |
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.
What is this TODO?
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.
same as line 1310
Description
Simply adding "." and ".." to the returnned list from an WASI::fd_readdir call