Skip to content
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

Revert incorrect Rwalk changes, introduce additional test #32

Closed
wants to merge 6 commits into from

Conversation

zakkor
Copy link
Contributor

@zakkor zakkor commented Sep 11, 2022

Reverts incorrect changes introduced in #30, which broke Rwalk (for which there were failing tests that went unnoticed).

Also removes a superfluous Put call in qidpool: if it already exists, there's no need to Put it, otherwise it gets handled inside the Do block, so still no need for a Put.

In the #30 PR, @seh-msft says:

In the case of a new file being created in the tree, a Twalk, then a Tcreate, would occur.

If there's a new file being created, that means the file doesn't exist yet, which means the Twalk should fail. In the event of an unsuccessful Twalk, no new Qid should be created. I've added a new test that verifies this behaviour is true.

Tcreate should be the only origin of 'new' QIDs to the core file system.

Considering the above, this is still true: Twalk fails, no Qid is created, then Tcreate occurs, and the Qid and file get created.

In conclusion, the current behaviour is correct, so this PR reverts back to that -- there was no need for a fix. I am not sure what issues the original submitter was facing, but I am guessing that they were not coming from styx.

Resolves #31

This reverts commit 72aa6a6, reversing
changes made to 0320e6f.
If the name already existed, then there's no need to Put it, otherwise it gets set inside the Do call, which also means there's no need to Put it.
…back `statGuess` guesses

We make sure the fallback statGuess name is the base file name, not the absolute path.
Otherwise in scenarios where statGuess does not manage to find a Name method on the underlying object,
it will return an absolute path, which will generate bad message errors,
due to slashes not being allowed in file names.
When a styxfile.Directory is passed as the result of a Tcreate call
and the underlying object does not have a Stat method,
statGuess does not manage to detect any underlying fs.FileInfo methods,
(e.g.: Name, Mode, ...) which means that for opened directories,
the results of Tstat are always an incorrectly guessed fallback value
@zakkor
Copy link
Contributor Author

zakkor commented Sep 15, 2022

Closing this PR in favour of #34, which introduces the same fix, but from a different branch. Github won't let me change the source branch

@zakkor zakkor closed this Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting rwalk did not find file for any Twalk call
1 participant