• Naohiro Aota's avatar
    btrfs: zoned: redirty released extent buffers · d3575156
    Naohiro Aota authored
    Tree manipulating operations like merging nodes often release
    once-allocated tree nodes. Such nodes are cleaned so that pages in the
    node are not uselessly written out. On zoned volumes, however, such
    optimization blocks the following IOs as the cancellation of the write
    out of the freed blocks breaks the sequential write sequence expected by
    the device.
    
    Introduce a list of clean and unwritten extent buffers that have been
    released in a transaction. Redirty the buffers so that
    btree_write_cache_pages() can send proper bios to the devices.
    
    Besides it clears the entire content of the extent buffer not to confuse
    raw block scanners e.g. 'btrfs check'. By clearing the content,
    csum_dirty_buffer() complains about bytenr mismatch, so avoid the
    checking and checksum using newly introduced buffer flag
    EXTENT_BUFFER_NO_CHECK.
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarNaohiro Aota <naohiro.aota@wdc.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    d3575156
extent-tree.c 160 KB