loop: fix a race when a free loop device is snatched
commitcb8d2ea8c91b5671b05e06ab2282496104453378
authorXiaoming Ni <nixiaoming@huawei.com>
Tue, 15 Nov 2022 13:54:05 +0000 (15 14:54 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 15 Nov 2022 13:54:05 +0000 (15 14:54 +0100)
tree10cb02d9620037a7195728c985ec2d1ded1184e4
parent707a7ef4c72d1d00ff61221511a70eada19185ca
loop: fix a race when a free loop device is snatched

When /dev/loop-control exists and *device is empty,
the mount may fail if a concurrent mount is running.

function                                             old     new   delta
set_loop                                             809     807      -2

Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/loop.c