The Solaris code allows shorthand paths by checking for the short
name in /dev/dsk/. For Linux we extend this shorthand syntax to
be udev aware. This commit now additionally checks for the short
name in /dev/, /dev/disk/by-id, /dev/disk/by-label, /dev/disk/by-path,
/dev/disk/by-uuid, and /dev/disk/zpool/. If the short name is found
in any of these places the path is fully expanded and used. This
may allow for the simpler creation of pools:
# Using /dev/disk/by-id/ short names
zpool crete tank raidz ata-Maxtor_7Y250M0_Y638DK2E \
ata-Maxtor_7Y250M0_Y638PBNE ata-Maxtor_7Y250M0_Y638PBZE
# Using /dev/disk/zpool/ short names
zpool create tank raidz2 A1 A2 A3 A4 mirror B1 B2 B3 B4
# Using full path names
zpool create tank raidz2 /dev/sd[ah]
I knew I'd forget something in the first version of this script.
It turns out what I forgot was partition handling, this commit
ensures duplicate entries are not created in the zdev.conf file.
This previously could occur due to partition entires in the by-path
directory. This is not needed the existing udev rules will ensure
the partitions are created in /dev/disk/zpool/.
The zpool_layout command is designed to automatically scan the
udev /dev/disk/by-path directory and generate a /etc/zfs/zdev.conf
file. It does this by enumerating the disks attached to the
specified buses/ports and sequentially mapping them to short
<channel><rank> names in /dev/disk/zpool/. This tool should only
be run after all the available disks have been discovered. And
the resulting config file does not need to be regenerated unless
your backend configuration changes.
The ztest_pattern_match() function is only called from an ASSERT
and needs only to be defined when debugging is enabled. This
change is to silence a gcc warning and belong with the other
gcc issues. I'm moving it to the gcc-unused topic branch.
The new spa_config_path string was lost from ztest_run_zdb() during
the onnv_141 merge. This commit puts it back in place so the '-f'
option is properly honored.
Additionally this function had been tweaked so ztest could be run
in-tree but that broke running it when installed as a package. I've
updated that chunk to detect where it's running and try to do the
right thing in both cases.
Closes#49
The upstream commit cb code had a few bugs:
1) The arguments of the list_move_tail() call in txg_dispatch_callbacks()
were reversed by mistake. This caused the commit callbacks to not be
called at all.
2) ztest had a bug in ztest_dmu_commit_callbacks() where "error" was not
initialized correctly. This seems to have caused the test to always take
the simulated error code path, which made ztest unable to detect whether
commit cbs were being called for transactions that successfuly complete.
3) ztest had another bug in ztest_dmu_commit_callbacks() where the commit
cb threshold was not being compared correctly.
4) The commit cb taskq was using 'max_ncpus * 2' as the maxalloc argument
of taskq_create(), which could have caused unnecessary delays in the txg
sync thread.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
A number of ztest functions create one or more 312B ztest_od_t data
structures. To conserve stack usage, this commit moves all of these data
structures to the heap. However, I am still seeing ztest segfaults due
to heavy stack usage of the dbuf_findbp() -> dbuf_hold_impl() recursion.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>