gfs2: Improve non-recursive delete algorithm
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 4 Dec 2017 15:06:17 +0000 (16:06 +0100)
committerBob Peterson <rpeterso@redhat.com>
Wed, 17 Jan 2018 13:35:52 +0000 (06:35 -0700)
commitcb7f0903efacb7d25b844b9d321b43f228c7a37a
tree8fcec6fb485a7e67af23b7f290ebc3192ed4c777
parentc3ce5aa9b02dd912e381237e7f98d591d7358cdc
gfs2: Improve non-recursive delete algorithm

In rare cases, the current non-recursive delete algorithm doesn't
deallocate empty intermediary indirect blocks.  This should have very
little practical effect, but deallocating all blocks correctly should
still be preferable as it is cleaner and easier to validate.

The fix consists of using the first block to deallocate to compute the
start marker of the truncate point instead of the last block that needs
to be kept.  With that change, computing which indirect blocks are still
needed becomes relatively easy.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/bmap.c