3.12 Backport: fixed btrfs race conditions, via 964fb15acfcd672ac691f04879b71f07ccc21e0c