HomeFreeBSD

Do not return /dev/loop-control in unused_loop_device

Description

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 <ColdCanuck@nailedtotheperch.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #797

Details

Provenance
Andrew Reid <ColdCanuck@nailedtotheperch.com>Authored on Oct 13 2012, 3:03 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Oct 15 2012, 5:02 PM
Parents
rG6f53a6a22996: Switch KM_SLEEP to KM_PUSHPAGE
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG6cb7ab069d90: Do not return /dev/loop-control in unused_loop_device (authored by Andrew Reid <ColdCanuck@nailedtotheperch.com>).Oct 15 2012, 5:02 PM