]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: use btrfs_read_lock_root_node in get_old_root
authorJan Schmidt <list.btrfs@jan-o-sch.net>
Mon, 4 Jun 2012 14:54:57 +0000 (16:54 +0200)
committerJan Schmidt <list.btrfs@jan-o-sch.net>
Thu, 14 Jun 2012 16:44:21 +0000 (18:44 +0200)
commit61fbaeee3ff421b96bb40a33d26d57990eefe1dd
tree08a2e49743eee382eca3e4b12415b372f898e3d8
parent468d65d6785a0bf3c5964f7504a49b13f374950b
Btrfs: use btrfs_read_lock_root_node in get_old_root

get_old_root could race with root node updates because we weren't locking
the node early enough. Use btrfs_read_lock_root_node to grab the root locked
in the very beginning and release the lock as soon as possible (just like
btrfs_search_slot does).

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
fs/btrfs/ctree.c