Re: [PATCH] btrfs: ref-verify: free ref cache before clearing mount opt

From: David Sterba
Date: Thu Jan 04 2024 - 11:00:54 EST


On Wed, Jan 03, 2024 at 01:31:27PM +0300, Fedor Pchelkin wrote:
> As clearing REF_VERIFY mount option indicates there were some errors in a
> ref-verify process, a ref cache is not relevant anymore and should be
> freed.
>
> btrfs_free_ref_cache() requires REF_VERIFY option being set so call
> it just before clearing the mount option.
>
> Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
>
> Fixes: fd708b81d972 ("Btrfs: add a extent ref verify tool")
> Reported-by: syzbot+be14ed7728594dc8bd42@xxxxxxxxxxxxxxxxxxxxxxxxx
> Closes: https://lore.kernel.org/lkml/000000000000e5a65c05ee832054@xxxxxxxxxx/
> Reported-by: syzbot+c563a3c79927971f950f@xxxxxxxxxxxxxxxxxxxxxxxxx
> Closes: https://lore.kernel.org/lkml/0000000000007fe09705fdc6086c@xxxxxxxxxx/
> Signed-off-by: Fedor Pchelkin <pchelkin@xxxxxxxxx>

Added to misc-next, thanks.