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

Write padded to 4096 bytes #3

Open
kennylevinsen opened this issue Nov 23, 2015 · 1 comment
Open

Write padded to 4096 bytes #3

kennylevinsen opened this issue Nov 23, 2015 · 1 comment

Comments

@kennylevinsen
Copy link
Contributor

Open a new file for writing with O_WRONLY | O_CREATE | O_APPEND, and write a few bytes to it. The write will be as intended.
Then, do the same again. This time, the write will be padded with 0's up to 4096 bytes.

I have traced that the write ends up in vnop_write_9p, using the cluster_write branch. At this point, size of write seems sane. As a result, one ends up in vnop_strategy_9p. Here, the provided block buffer... thing has a count of 4096, with size, dirtyend and dirtyoff all being 0.

This is seen on el capitan.

@kennylevinsen
Copy link
Contributor Author

The temporary fix I am currently deploying is to remove all cluster and mmap functionality.

I don't understand the VFS layer well enough to figure out how to retrieve the intended length from vnop_strategy. Then again, the strategy concept seems a bit silly in 9P context, and the NFS implementation doesn't use it, just implementing pagein/pageout in some other way that I haven't had time to understand yet.

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

1 participant