zfsonlinux/zfs — pull request #1043 by ColdCanuck (2012-10-13 15:22:24+00:00)
Title: Fix for scripts/common.sh.in not to return a non loop device. 

This fixes Issue #797 so that zconfig.sh -c runs cleanly on an Ubuntu box (and I assume Debian)

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 (see
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=770fe30a46a12b6fb6b63fbe1737654d28e84844)
but rather 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