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

Change rangelock handling in FreeBSD's zfs_getpages() #16643

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Oct 13, 2024

  1. Fix a potential page leak in mappedread_sf()

    mappedread_sf() may allocate pages; if it fails to populate a page
    can't free it, it needs to ensure that it's placed into a page queue,
    otherwise it can't be reclaimed until the vnode is destroyed.
    
    I think this is quite unlikely to happen in practice, it was noticed by
    code inspection.
    
    Signed-off-by: Mark Johnston <markj@FreeBSD.org>
    markjdb committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    00272d3 View commit details
    Browse the repository at this point in the history
  2. Grab the rangelock unconditionally in zfs_getpages()

    As a deadlock avoidance measure, zfs_getpages() would only try to
    acquire a rangelock, falling back to a single-page read if this was not
    possible.  However, this is incompatible with direct I/O.
    
    Instead, release the busy lock before trying to acquire the rangelock in
    blocking mode.  This means that it's possible for the page to be
    replaced, so we have to re-lookup.
    
    Signed-off-by: Mark Johnston <markj@FreeBSD.org>
    markjdb committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    9d2d8fc View commit details
    Browse the repository at this point in the history