OSDN Git Service

btrfs: fix ref-verify to catch operations on 0 ref extents
authorJosef Bacik <josef@toxicpanda.com>
Wed, 11 Mar 2020 15:21:44 +0000 (11:21 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:56 +0000 (17:01 +0100)
commitb39c8f5a393e7fc4459ac2aa1582409839eae2f6
treec5b4099483d36bdcf36fdf29de04e77d9d1dd9ca
parent0a8068a3dd4294ebd8b99969cdc6ccde0f944ba6
btrfs: fix ref-verify to catch operations on 0 ref extents

While debugging I noticed I wasn't getting ref verify errors before
everything blew up.  Turns out it's because we don't warn when we try to
add a normal ref via btrfs_inc_ref() if the block entry exists but has 0
references.  This is incorrect, we should never be doing anything other
than adding a new extent once a block entry drops to 0 references.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ref-verify.c