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 read errors race after block cloning #16052

Merged
merged 1 commit into from
Apr 8, 2024

Commits on Apr 4, 2024

  1. Fix read errors race after block cloning

    Investigating read errors triggering panic fixed in openzfs#16042 I've
    found that we have a race in a sync process between the moment
    dirty record for cloned block is removed and the moment dbuf is
    destroyed.  If dmu_buf_hold_array_by_dnode() take a hold on a
    cloned dbuf before it is synced/destroyed, then dbuf_read_impl()
    may see it still in DB_NOFILL state, but without the dirty record.
    Such case is not an error, but equivalent to DB_UNCACHED, since
    the dbuf block pointer is already updated by dbuf_write_ready().
    Unfortunately it is impossible to safely change the dbuf state
    to DB_UNCACHED there, since there may already be another cloning
    in progress, that dropped dbuf lock before creating a new dirty
    record, protected only by the range lock.
    
    Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
    Sponsored by:	iXsystems, Inc.
    amotin committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    4ad1561 View commit details
    Browse the repository at this point in the history