]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix protection between walking backrefs and root deletion
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Thu, 23 Jan 2014 05:47:48 +0000 (13:47 +0800)
committerChris Mason <clm@fb.com>
Wed, 29 Jan 2014 15:06:23 +0000 (07:06 -0800)
commit284bad1215d7d2e0a086b08321d1f126645961c6
treed4480e764bdebea4cac696ffb25f9025c61ea240
parent2deb1241a77e3acf165773e787280348092d9e44
Btrfs: fix protection between walking backrefs and root deletion

There is a race condition between resolving indirect ref and root deletion,
and we should gurantee that root can not be destroyed to avoid accessing
broken tree here.

Here we fix it by holding @subvol_srcu, and we will release it as soon
as we have held root node lock.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/backref.c