On 17.02.20 г. 8:31 ч., Qu Wenruo wrote:
> In the core function of relocation, build_backref_tree, it needs to
> iterate all backref items of one tree block.
>
> We don't really want to spend our code and reviewers' time to going
> through tons of supportive code just for the backref walk.
>
> Use btrfs_backref_iterator infrastructure to do the loop.
>
> The backref items look would be much more easier to read:
>
> ret = btrfs_backref_iterator_start(iterator, cur->bytenr);
> for (; ret == 0; ret = btrfs_backref_iterator_next(iterator)) {
> /* The really important work */
> }
>
> Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
Even with your branch this patch is triggering warnings on btrfs/187 :
[ 1053.603321] WARNING: CPU: 1 PID: 3110 at fs/btrfs/relocation.c:945
build_backref_tree+0x270c/0x50b0
That's WARN_ON(exist);