]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix for patch "cleanup: don't check the same thing twice"
authorStefan Behrens <sbehrens@giantdisaster.de>
Fri, 23 Aug 2013 08:34:42 +0000 (10:34 +0200)
committerChris Mason <chris.mason@fusionio.com>
Sun, 1 Sep 2013 12:16:29 +0000 (08:16 -0400)
commitab8a25ba27840341f580a4824b42aeae4cc3f509
treed37a3d7661cb2c5a81e8acd2c81580a102554e68
parent2e29db6dbed9ad9107c283baf7f5049390fc4cd0
Btrfs: fix for patch "cleanup: don't check the same thing twice"

Mitch Harder noticed that the patch a35012a mentioned in the subject
line was causing a kernel BUG() on snapshot deletion.

The patch was wrong. It did not handle cached roots correctly. The
check for root_refs == 0 was removed everywhere where
btrfs_read_fs_root_no_name() had been used to retrieve the root,
because this check was already dealt with in
btrfs_read_fs_root_no_name(). But in the case when the root was
found in the cache, there was no such check.

This patch adds the missing check in the case where the root is
found in the cache.

Reported-by: Mitch Harder <mitch.harder@sabayonlinux.org>
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/disk-io.c