3
0
Fork 0
forked from mirrors/nixpkgs

* Ugly hack: for CIFS mounts, retry the mount a few times (just as in

pkgs/build-support/vm).  This should make the NixOS regression tests
  more robust on heavily loaded systems, where they now frequently
  fail:

  server# mounting //10.0.2.4/qemu on /hostfs...
  server# [    8.233991] Slow work thread pool: Starting up
  server# [    8.234721] Slow work thread pool: Ready
  server# [   23.271708]  CIFS VFS: No response for cmd 114 mid 1
  server# [   23.272443]  CIFS VFS: cifs_mount failed w/return code = -112
  server# mount: Host is down
  server# [   23.275188] Kernel panic - not syncing: Attempted to kill init!

  Maybe there is a configurable timeout somewhere, which would be much
  nicer...

svn path=/nixos/trunk/; revision=19248
This commit is contained in:
Eelco Dolstra 2010-01-06 00:25:14 +00:00
parent bc68c2985c
commit c9e4b46d48

View file

@ -200,8 +200,17 @@ mountFS() {
checkFS "$device"
mkdir -p "/mnt-root$mountPoint" || true
mount -t "$fsType" -o "$options" "$device" /mnt-root$mountPoint || fail
# For CIFS mounts, retry a few times before giving up.
local n=0
while true; do
if mount -t "$fsType" -o "$options" "$device" /mnt-root$mountPoint; then
break
fi
if [ "$fsType" != cifs -o "$n" -ge 10 ]; then fail; break; fi
echo "retrying..."
n=$((n + 1))
done
}