From: Andrew Reid Date: Sat, 13 Oct 2012 15:03:59 +0000 (-0300) Subject: Do not return /dev/loop-control in unused_loop_device X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=commitdiff_plain;h=6cb7ab069d9079a5b4b955da883d5ab804c91319;hp=-c;p=zfs.git Do not return /dev/loop-control in unused_loop_device The function unused_loop_device in /usr/libexec/zfs/common.sh returns /dev/loop-control on the first call. This device is NOT a loop device (https://github.com/torvalds/linux/commit/770fe30) it is a control device. This in turn causes the script zconfig.sh to fail with: zpool-create.sh: Error 1 creating /tmp/zpool-vdev0 -> /dev/loop-control loopback The patch makes the function return /dev/loop[0-9]* which are loop devices. Signed-off-by: Andrew Reid Signed-off-by: Brian Behlendorf Closes #797 --- 6cb7ab069d9079a5b4b955da883d5ab804c91319 diff --git a/scripts/common.sh.in b/scripts/common.sh.in index 0e792db..3c11820 100644 --- a/scripts/common.sh.in +++ b/scripts/common.sh.in @@ -263,7 +263,7 @@ check_loop_utils() { # Find and return an unused loopback device. # unused_loop_device() { - for DEVICE in `ls -1 /dev/loop* 2>/dev/null`; do + for DEVICE in `ls -1 /dev/loop[0-9]* 2>/dev/null`; do ${LOSETUP} ${DEVICE} &>/dev/null if [ $? -ne 0 ]; then echo ${DEVICE}