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

Fix zfs_write_limit_max integer size mismatch on 32-bit systems #1034

Closed
wants to merge 1 commit into from

Conversation

ryao
Copy link
Contributor

@ryao ryao commented Oct 11, 2012

Commit c409e46 introduced a number of
module parameters. Of these, ARC unconditionally expected
zfs_write_limit_max to be 64-bit. Unfortunately, the largest size
integer module parameter that Linux supports is unsigned
long, which varies in size depending on the host system's native word
size. The effect was that on 32-bit systems, ARC incorrectly performed
64-bit operations on a 32-bit value by reading the neighboring 32 bits
as the upper 32 bits of the 64-bit value. We correct that by changing
the extern declaration to use the unsigned long type. This should make
ARC correctly treat zfs_write_limit_max as a 32-bit value on 32-bit
systems.

Closes #749

Reported-by: Jorgen Lundman [email protected]
Signed-off-by: Richard Yao [email protected]

@ryao
Copy link
Contributor Author

ryao commented Oct 11, 2012

This should also close #831 and I expect this to close #864 as well, although the latter requires testing to be certain.

@ryao
Copy link
Contributor Author

ryao commented Oct 11, 2012

I was wrong. This does not close #831.

Commit c409e46 introduced a number of
module parameters. Of these, ARC unconditionally expected
zfs_write_limit_max to be 64-bit. Unfortunately, the largest size
integer module parameter that Linux supports is unsigned
long, which varies in size depending on the host system's native word
size. The effect was that on 32-bit systems, ARC incorrectly performed
64-bit operations on a 32-bit value by reading the neighboring 32 bits
as the upper 32 bits of the 64-bit value. We correct that by changing
the extern declaration to use the unsigned long type. This should make
ARC correctly treat zfs_write_limit_max as a 32-bit value on 32-bit
systems.

Closes openzfs#749

Reported-by: Jorgen Lundman <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
@ryao
Copy link
Contributor Author

ryao commented Oct 11, 2012

Merged as commit 7df05a4.

@ryao ryao closed this Oct 11, 2012
pcd1193182 pushed a commit to pcd1193182/zfs that referenced this pull request Sep 26, 2023
)

Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.71 to 1.0.72.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](dtolnay/anyhow@1.0.71...1.0.72)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

zfs-0.6.0rc8 (repo) mkdir can hang on ARM 32bit system
1 participant