FreeBSD src
Go to file
Brian Behlendorf 6466b61db6 Make zpool import -d|-c behave consistently
When importing pools with zpool import -aN there is inconsistent
behavior between '-d /dev/disk/by-id' (or another path) and
'-c /etc/zfs/zpool.cache'.

The difference in behavior is caused by zpool_find_import_cached()
returning an empty nvlist_t when there are no pools to import but
zpool_find_import_impl() returns NULL for the same situation. The
behavior of zpool_find_import_cached() is arguably more correct
because it allows returning NULL to be used for an error case and
not an empty set.

This change resolves the issue by updating get_configs() such that
it returns an empty set instead of NULL when no config is found.
The updated behavior will now always return 0 for this case.

$ zpool import -aN; echo $?
no pools available to import
0

$ zpool import -aN -d /var/tmp/; echo $?
no pools available to import
0

$ zpool import -aN -c /etc/zfs/zpool.cache; echo $?
no pools available to import
0

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2080
2015-01-28 11:12:31 -08:00
cmd Replace sysctl summary with tunables summary. 2015-01-28 11:05:53 -08:00
config Don't use AC_LANG_SOURCE for conftest.h source 2015-01-06 16:53:30 -08:00
contrib Add bash completions by Aneurin Price. 2014-08-06 15:03:28 -07:00
dracut Amend Dracut module to export ZFS root on shutdown 2014-10-07 10:20:56 -07:00
etc Improve systemd script to not leave stale sharetab 2014-12-18 09:54:56 -08:00
include Revert "SA spill block cache" 2015-01-16 14:41:28 -08:00
lib Make zpool import -d|-c behave consistently 2015-01-28 11:12:31 -08:00
man Document zfs_flags module parameter 2015-01-07 15:50:49 -08:00
module Fix removal of SA in sa_modify_attrs() 2015-01-21 16:35:14 -08:00
rpm Fix typo in %post scriptlet lines 2014-12-18 18:38:33 -08:00
scripts Swap DTRACE_PROBE* with Linux tracepoints 2014-11-17 11:13:55 -08:00
udev Open pools asynchronously after module load 2013-07-03 09:24:38 -07:00
.gitignore Ignore *.{deb,rpm,tar.gz} files in the top directory. 2013-04-24 16:18:59 -07:00
.gitmodules Add zimport.sh compatibility test script 2014-02-21 12:10:31 -08:00
AUTHORS Add a missing > to AUTHORS 2014-09-02 14:18:53 -07:00
autogen.sh build: do not call boilerplate ourself 2013-04-02 10:55:20 -07:00
configure.ac Add a pkgconfig file 2014-08-28 07:59:43 -07:00
copy-builtin Consistent menuconfig name 2012-08-26 13:49:37 -07:00
COPYRIGHT Refresh links to web site 2013-03-06 15:46:41 -08:00
DISCLAIMER Fix minor typos and update marketing copy. 2013-03-21 12:51:06 -07:00
Makefile.am Kernel header installation should respect --prefix 2014-10-28 09:37:06 -07:00
META Make license compatibility checks consistent 2014-10-17 14:58:38 -07:00
OPENSOLARIS.LICENSE Add CDDL license file 2008-12-01 14:49:34 -08:00
README.markdown Fix minor typos and update marketing copy. 2013-03-21 12:51:06 -07:00
zfs-script-config.sh.in Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zfs.release.in Move zfs.release generation to configure step 2012-07-12 12:22:51 -07:00

Native ZFS for Linux!

ZFS is an advanced file system and volume manager which was originally developed for Solaris and is now maintained by the Illumos community.

ZFS on Linux, which is also known as ZoL, is currently feature complete. It includes fully functional and stable SPA, DMU, ZVOL, and ZPL layers.

Full documentation for installing ZoL on your favorite Linux distribution can be found at: http://zfsonlinux.org