]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix race between balance recovery and root deletion
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Thu, 26 Jun 2014 03:08:16 +0000 (11:08 +0800)
committerChris Mason <clm@fb.com>
Thu, 3 Jul 2014 14:04:04 +0000 (07:04 -0700)
commitf246f53b91c2797791379a2b673d01e384c4b416
treeb176f089dda953a935d4987c6d02ea3783cb56d7
parent21f4e5d8a5c4367d036f7a535bfee319ae3d97a1
Btrfs: fix race between balance recovery and root deletion

Balance recovery is called when RW mounting or remounting from
RO to RW, it is called to finish roots merging.

When doing balance recovery, relocation root's corresponding
fs root(whose root refs is 0) might be destroyed by cleaner
thread, this will make btrfs fail to mount.

Fix this problem by holding @cleaner_mutex when doing balance
recovery.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/disk-io.c
fs/btrfs/super.c