Merge commit 'refs/top-bases/linux-zfs-branch' into linux-zfs-branch

This commit is contained in:
Brian Behlendorf 2010-05-18 16:24:56 -07:00
commit 4e17ee1040
2 changed files with 10 additions and 15 deletions

View File

@ -948,11 +948,10 @@ zpool_find_import_impl(libzfs_handle_t *hdl, int argc, char **argv,
/* /*
* Ignore failed stats. We only want regular * Ignore failed stats. We only want regular
* files, character devs and block devs. * files and block devs.
*/ */
if (fstat64(fd, &statbuf) != 0 || if (fstat64(fd, &statbuf) != 0 ||
(!S_ISREG(statbuf.st_mode) && (!S_ISREG(statbuf.st_mode) &&
!S_ISCHR(statbuf.st_mode) &&
!S_ISBLK(statbuf.st_mode))) { !S_ISBLK(statbuf.st_mode))) {
(void) close(fd); (void) close(fd);
continue; continue;

View File

@ -64,20 +64,16 @@ zconfig_test1() {
${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2 ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2
${ZPOOL} status ${POOL_NAME} >${TMP_FILE1} || fail 3 ${ZPOOL} status ${POOL_NAME} >${TMP_FILE1} || fail 3
# Unload/load the module stack to clear any configuration state # Unload/load the module stack and verify the pool persists.
# then verify the pool is defined in the cache file, it can be
# imported without error, and it matches the original pool.
${ZFS_SH} -u || fail 4 ${ZFS_SH} -u || fail 4
${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 5 ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 5
${ZPOOL} import -c ${TMP_CACHE} | grep ${POOL_NAME} >/dev/null||fail 6 ${ZPOOL} status ${POOL_NAME} >${TMP_FILE2} || fail 6
${ZPOOL} import -c ${TMP_CACHE} ${POOL_NAME} || fail 7 cmp ${TMP_FILE1} ${TMP_FILE2} || fail 7
${ZPOOL} status ${POOL_NAME} >${TMP_FILE2} || fail 8
cmp ${TMP_FILE1} ${TMP_FILE2} || fail 9
# Cleanup the test pool and temporary files # Cleanup the test pool and temporary files
${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 -d || fail 10 ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 -d || fail 8
rm -f ${TMP_FILE1} ${TMP_FILE2} ${TMP_CACHE} || fail 11 rm -f ${TMP_FILE1} ${TMP_FILE2} ${TMP_CACHE} || fail 9
${ZFS_SH} -u || fail 12 ${ZFS_SH} -u || fail 10
pass pass
} }
@ -97,9 +93,9 @@ zconfig_test2() {
${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2 ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2
${ZPOOL} status ${POOL_NAME} >${TMP_FILE1} || fail 3 ${ZPOOL} status ${POOL_NAME} >${TMP_FILE1} || fail 3
# Unload/load the module stack to clear any configuration state # Unload the module stack, remove the cache file, load the module
# then remove the cache file, probe the disks for pools, import # stack and attempt to probe the disks to import the pool. As
# the pool without error, and match it against the original pool. # a cross check verify the old pool state against the imported.
${ZFS_SH} -u || fail 4 ${ZFS_SH} -u || fail 4
rm -f ${TMP_CACHE} || fail 5 rm -f ${TMP_CACHE} || fail 5
${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 6 ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 6