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

rename/21.t #74

Open
zhanyang opened this issue Jan 23, 2024 · 3 comments
Open

rename/21.t #74

zhanyang opened this issue Jan 23, 2024 · 3 comments

Comments

@zhanyang
Copy link

expect "0|EACCES" -u 65534 -g 65534 rename ${n2}/${n1} ${n2}/${n0}

expect 0 mkdir ${n2}/${n0} 0700                                                  
expect "0|EACCES" -u 65534 -g 65534 rename ${n2}/${n0} ${n2}/${n1}               
expect "0|EACCES" -u 65534 -g 65534 rename ${n2}/${n1} ${n2}/${n0}               

rename/21.t renames ${n2}/${n0} to ${n2}/${n1} while it doesn't have write permission to ${n2}/${n0}. The result can be 0 or EACCES. However, if the filesystem returns EACCES, it will return ENOENT to the next test because ${n2}/${n1} doesn't exist. The test needs to remove and recreate the directory or allow ENOENT in the next test.

@asomers
Copy link
Collaborator

asomers commented Jan 23, 2024

Are you saying that the rest of the test contained spurious failures? What OS and FS are you using?

@zhanyang
Copy link
Author

zhanyang commented Jan 24, 2024

I was writing a filesystem on Linux. There is a bug that messed up on the permission bits and failed a lot of tests. For rename/21.t, it passed the 1st rename with EACCES and failed the 2nd rename with ENOENT. I looked at the test and felt that the filesystem is doing things correctly. Later, I fixed the bug and passed the test.

My question is that if failure (EACCES) is allowed in the first rename, why the second rename cannot return ENOENT?

@asomers
Copy link
Collaborator

asomers commented Jan 24, 2024

You're correct. The second rename on line 26 should allow ENOENT, if the first one failed. Would you care to submit a patch?

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

No branches or pull requests

2 participants