Fix: ext4: adjust reserved cluster count when removing extents (v4.20)
authorMichael Jeanson <mjeanson@efficios.com>
Mon, 5 Nov 2018 16:35:54 +0000 (11:35 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 5 Nov 2018 16:41:44 +0000 (11:41 -0500)
commit3834eb07252c7a5e8514575fb5e0efa6c20f0c16
treefbd6e4df10d9980402590ec2bb618e2155c3fc06
parent7f424e9ec3a789fd4fe0da97c12b0fdf067533bb
Fix: ext4: adjust reserved cluster count when removing extents (v4.20)

See upstream commit :

  commit 9fe671496b6c286f9033aedfc1718d67721da0ae
  Author: Eric Whitney <enwlinux@gmail.com>
  Date:   Mon Oct 1 14:25:08 2018 -0400

    ext4: adjust reserved cluster count when removing extents

    Modify ext4_ext_remove_space() and the code it calls to correct the
    reserved cluster count for pending reservations (delayed allocated
    clusters shared with allocated blocks) when a block range is removed
    from the extent tree.  Pending reservations may be found for the clusters
    at the ends of written or unwritten extents when a block range is removed.
    If a physical cluster at the end of an extent is freed, it's necessary
    to increment the reserved cluster count to maintain correct accounting
    if the corresponding logical cluster is shared with at least one
    delayed and unwritten extent as found in the extents status tree.

    Add a new function, ext4_rereserve_cluster(), to reapply a reservation
    on a delayed allocated cluster sharing blocks with a freed allocated
    cluster.  To avoid ENOSPC on reservation, a flag is applied to
    ext4_free_blocks() to briefly defer updating the freeclusters counter
    when an allocated cluster is freed.  This prevents another thread
    from allocating the freed block before the reservation can be reapplied.

    Redefine the partial cluster object as a struct to carry more state
    information and to clarify the code using it.

    Adjust the conditional code structure in ext4_ext_remove_space to
    reduce the indentation level in the main body of the code to improve
    readability.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/ext4.h
This page took 0.025277 seconds and 4 git commands to generate.