]> granicus.if.org Git - zfs/blobdiff - scripts/zconfig.sh
Fix function call with uninitialized value in vdev_inuse
[zfs] / scripts / zconfig.sh
index 141348c037faf47f66317e04382441299d8c5840..d6695be7239043ad4ae7abbb4f81288c9f4d77f4 100755 (executable)
@@ -264,8 +264,9 @@ test_4() {
        zconfig_zvol_device_stat 0 ${POOL_NAME} ${FULL_ZVOL_NAME} \
            ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 9
 
-       # Load the modules, wait 1 second for udev
+       # Load the modules, list the pools to ensure they are opened
        ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 10
+       ${ZPOOL} list &>/dev/null
 
        # Verify the devices were created
        zconfig_zvol_device_stat 10 ${POOL_NAME} ${FULL_ZVOL_NAME} \
@@ -402,14 +403,16 @@ test_7() {
        partition /dev/zvol/${FULL_ZVOL_NAME} primary 1 -1 || fail 4
        format /dev/zvol/${FULL_ZVOL_NAME}-part1 ext2 || fail 5
 
-       # Mount the ext2 filesystem and copy some data to it.
-       mkdir -p /tmp/${ZVOL_NAME}-part1 || fail 6
-       mount /dev/zvol/${FULL_ZVOL_NAME}-part1 /tmp/${ZVOL_NAME}-part1 \
-               || fail 7
+       # Snapshot the pristine ext2 filesystem.
+       ${ZFS} snapshot ${FULL_SNAP_NAME} || fail 6
+       wait_udev /dev/zvol/${FULL_SNAP_NAME}-part1 30 || fail 7
 
-       # Snapshot the pristine ext2 filesystem and mount it read-only.
-       ${ZFS} snapshot ${FULL_SNAP_NAME} || fail 8
-       wait_udev /dev/zvol/${FULL_SNAP_NAME}-part1 30 || fail 8
+       # Mount the ext2 filesystem so some data can be copied to it.
+       mkdir -p /tmp/${ZVOL_NAME}-part1 || fail 7
+       mount /dev/zvol/${FULL_ZVOL_NAME}-part1 \
+               /tmp/${ZVOL_NAME}-part1 || fail 8
+
+       # Mount the pristine ext2 snapshot.
        mkdir -p /tmp/${SNAP_NAME}-part1 || fail 9
        mount /dev/zvol/${FULL_SNAP_NAME}-part1 \
                /tmp/${SNAP_NAME}-part1 &>/dev/null || fail 10
@@ -495,11 +498,14 @@ test_8() {
        mount /dev/zvol/${FULL_ZVOL_NAME1}-part1 \
                /tmp/${FULL_ZVOL_NAME1}-part1 || fail 7
        cp -RL ${SRC_DIR} /tmp/${FULL_ZVOL_NAME1}-part1 || fail 8
-       sync || fail 9
 
-       # Snapshot the ext2 filesystem so it may be sent.
-       ${ZFS} snapshot ${FULL_SNAP_NAME1} || fail 11
-       wait_udev /dev/zvol/${FULL_SNAP_NAME1} 30 || fail 11
+       # Unmount, snapshot, mount the ext2 filesystem so it may be sent.
+       # We only unmount to ensure the ext2 filesystem is clean.
+       umount /tmp/${FULL_ZVOL_NAME1}-part1 || fail 9
+       ${ZFS} snapshot ${FULL_SNAP_NAME1} || fail 10
+       wait_udev /dev/zvol/${FULL_SNAP_NAME1} 30 || fail 10
+       mount /dev/zvol/${FULL_ZVOL_NAME1}-part1 \
+               /tmp/${FULL_ZVOL_NAME1}-part1 || 11
 
        # Send/receive the snapshot from POOL_NAME1 to POOL_NAME2
        (${ZFS} send ${FULL_SNAP_NAME1} | \
@@ -548,6 +554,7 @@ test_9() {
        ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
        ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2
        ${ZFS} create -V 300M ${FULL_NAME} || fail 3
+       udev_trigger
 
        # Dump the events, there should be at least 5 lines.
        ${ZPOOL} events >${TMP_EVENTS} || fail 4