common/scsi_debug: use udevadm settle instead of sleeping
authorLuis Chamberlain <mcgrof@kernel.org>
Tue, 27 Jul 2021 20:10:43 +0000 (13:10 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 1 Aug 2021 13:28:08 +0000 (21:28 +0800)
commit8bd9c9700849db6d1d0c55582a06d828b2b70a4f
treea3d59736d1336dd0a642be923ba0b639030b4c8e
parent96eefa4a7dbbf81982335cd62fe7bd6a26d69d68
common/scsi_debug: use udevadm settle instead of sleeping

The variable UDEV_SETTLE_PROG is already defined and used for
lvm to either use `udevadm settle` in case it is available, and
if not, use 'sleep 1' otherwise (ancient distros or CONFIG_NET
is missing).

Use it on scsi_debug to replace the sleep calls sprinkled in
place after module removal. The correct thing to do is to
just use udevadm settle when available, and only fall back to
calling sleep when udevadm is not available or CONFIG_NET
is disabled.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/scsi_debug