3.12 Backport: fixed wifebeaterfs race condition, via 721a769c034204e8e5f6ca4ecbff249e0225333b