]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: consider shutdown in bmapbt cursor delete assert
authorBrian Foster <bfoster@redhat.com>
Thu, 11 Feb 2021 16:46:38 +0000 (08:46 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 11 Feb 2021 16:46:38 +0000 (08:46 -0800)
commit5fd4bdffa015359b962872ddc1a2c22d2d63c82a
tree3cfd697808822bd451895ee588531131f1f3396a
parent96bea9615427b0d64d7df59ac195a49674473efe
xfs: consider shutdown in bmapbt cursor delete assert

The assert in xfs_btree_del_cursor() checks that the bmapbt block
allocation field has been handled correctly before the cursor is
freed. This field is used for accurate calculation of indirect block
reservation requirements (for delayed allocations), for example.
generic/019 reproduces a scenario where this assert fails because
the filesystem has shutdown while in the middle of a bmbt record
insertion. This occurs after a bmbt block has been allocated via the
cursor but before the higher level bmap function (i.e.
xfs_bmap_add_extent_hole_real()) completes and resets the field.

Update the assert to accommodate the transient state if the
filesystem has shutdown. While here, clean up the indentation and
comments in the function.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/libxfs/xfs_btree.c