gfs2: Also reflect single-block allocations in rgd->rd_extfail_pt
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 5 Oct 2020 17:39:18 +0000 (19:39 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 17 Feb 2021 18:26:05 +0000 (19:26 +0100)
commitf38e998fbbb5da6a097ecd4b2700ba95eabab0c9
treecbb56d3973d0c7a555c49efdfae0a135932bf60a
parent560b8eba6bf685bb2a29fd24e7b3455e7b8f795a
gfs2: Also reflect single-block allocations in rgd->rd_extfail_pt

Pass a non-NULL minext to gfs2_rbm_find even for single-block allocations.  In
gfs2_rbm_find, also set rgd->rd_extfail_pt when a single-block allocation
fails in a resource group: there is no reason for treating that case
differently.  In gfs2_reservation_check_and_update, only check how many free
blocks we have if more than one block is requested; we already know there's at
least one free block.

In addition, when allocating N blocks fails in gfs2_rbm_find, we need to set
rd_extfail_pt to N - 1 rather than N:  rd_extfail_pt defines the biggest
allocation that might still succeed.

Finally, reset rd_extfail_pt when updating the resource group statistics in
update_rgrp_lvb, as we already do in gfs2_rgrp_bh_get.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/rgrp.c