From: Luiz Angelo Daros de Luca Date: Thu, 12 Nov 2020 01:19:06 +0000 (-0300) Subject: Revert "nbd: use systemd-run to start nbd-client" X-Git-Tag: 052~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba3f4cdadc6ea1e318c328f725a01c4748888cca;p=thirdparty%2Fdracut.git Revert "nbd: use systemd-run to start nbd-client" systemd-run runs nbd-client in parallel. This introduces a possible race condition when /dev/nbd0 is not directly used by /sysroot mount but used by another dracut module as in: netroot=nbd:ip:port:fstype root=live:/dev/nbd0 Before nbd0 usages are synchronized, it is better to keep it serial. This reverts commit 9fd0461b7d632c8e30f5241fff8306359b592438. Signed-off-by: Luiz Angelo Daros de Luca --- diff --git a/modules.d/95nbd/nbdroot.sh b/modules.d/95nbd/nbdroot.sh index 697387a61..7057f2332 100755 --- a/modules.d/95nbd/nbdroot.sh +++ b/modules.d/95nbd/nbdroot.sh @@ -109,25 +109,9 @@ if strstr "$(nbd-client --help 2>&1)" "systemd-mark"; then fi if [ "$nbdport" -gt 0 ] 2>/dev/null; then - if [ -z "$DRACUT_SYSTEMD" ]; then - nbd-client "$nbdserver" $nbdport /dev/nbd0 $preopts $opts || exit 1 - else - systemd-run --no-block --service-type=forking --quiet \ - --description="nbd nbd0" \ - -p 'DefaultDependencies=no' \ - -p 'KillMode=none' \ - --unit="nbd0" -- nbd-client "$nbdserver" $nbdport /dev/nbd0 $preopts $opts >/dev/null 2>&1 || exit 1 - fi + nbd-client "$nbdserver" $nbdport /dev/nbd0 $preopts $opts || exit 1 else - if [ -z "$DRACUT_SYSTEMD" ]; then - nbd-client -name "$nbdport" "$nbdserver" /dev/nbd0 $preopts $opts || exit 1 - else - systemd-run --no-block --service-type=forking --quiet \ - --description="nbd nbd0" \ - -p 'DefaultDependencies=no' \ - -p 'KillMode=none' \ - --unit="nbd0" -- nbd-client -name "$nbdport" "$nbdserver" /dev/nbd0 $preopts $opts >/dev/null 2>&1 || exit 1 - fi + nbd-client -name "$nbdport" "$nbdserver" /dev/nbd0 $preopts $opts || exit 1 fi # NBD doesn't emit uevents when it gets connected, so kick it