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

FreeBSD: Fix integer conversion for vnlru_free{,_vfsops}() #13882

Merged
merged 1 commit into from
Sep 14, 2022

Commits on Sep 13, 2022

  1. FreeBSD: Fix integer conversion for vnlru_free{,_vfsops}()

    When reviewing openzfs#13875, I noticed that our FreeBSD code has an issue
    where it converts from `int64_t` to `int` when calling
    `vnlru_free{,_vfsops}()`. The result is that if the int64_t is `1 <<
    36`, the int will be 0, since the low bits are 0. Even when some low
    bits are set, a value such as `((1 << 36) + 1)` would truncate to 1,
    which is wrong.
    
    There is protection against this on 32-bit platforms, but on 64-bit
    platforms, there is no check to protect us, so we add a check.
    
    Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
    ryao committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    8cccaf0 View commit details
    Browse the repository at this point in the history