]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Fix loop in gfs2_rbm_find (v2)
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 14 Mar 2019 15:48:48 +0000 (16:48 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 7 May 2019 20:33:44 +0000 (22:33 +0200)
commit4a834b39d6beb087802a0f347e305545f950c34d
tree55e56ea812ed519318d7f9d7dbd0c2ad5c27144d
parent18c2ff493cf3a2305a6db8f69ac7d47861b15750
gfs2: Fix loop in gfs2_rbm_find (v2)

Fix the resource group wrap-around logic in gfs2_rbm_find that commit
93f83794c8 broke.  The bug can lead to unnecessary repeated scanning of the
same bitmaps; there is a risk that future changes will turn this into an
endless loop.

This is an updated version of commit 989776fe82 ("gfs2: Fix loop in
gfs2_rbm_find") which ended up being reverted because it introduced a
performance regression in iozone (see commit 568ee9994f).  Changes since v1:

 - Simplify the wrap-around logic.

 - Handle the case where each resource group only has a single bitmap block
   (small filesystem).

 - Update rd_extfail_pt whenever we scan the entire bitmap, even when we don't
   start the scan at the very beginning of the bitmap.

Fixes: 93f83794c894 ("GFS2: Introduce rbm field bii")
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/rgrp.c