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 some assign arc buf with brt clone and O_TRUNC #15139

Closed
wants to merge 2 commits into from

Commits on Dec 11, 2023

  1. clonefile: add option to truncate dest file

    this adds a truncate option to clonefile, which is useful
    for the test suite.
    
    Signed-off-by: Kay Pedersen <[email protected]>
    Original-patched-by: Rob Norris <[email protected]>
    oromenahar committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    917c8d3 View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2023

  1. dbuf: Handle arcbuf assignment after block cloning

    In some cases dbuf_assign_arcbuf() may be called on a block that
    was recently cloned. If it happened in current TXG we must undo
    the block cloning first, since the only one dirty record per TXG
    can't and shouldn't mean both cloning and overwrite same time.
    For example this can happen while writting to a file and cloning
    a file at the same time.
    
    This is also covered by a test. The filesize must be huge like
    4G to trigger this bug. For that reason a 4G file is created
    from /dev/urandom and than a file clone loop whith FICLONE
    starts. After that the whole file is overwritten twice. The
    test can trigger the bug most times but not every time.
    
    Signed-off-by: oromenahar <[email protected]>
    oromenahar committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    a230b1d View commit details
    Browse the repository at this point in the history