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/.
Under the latest Gentoo (2.6.34-gentoo-r2) the interlibrary
dependencies must be made explicit. This is likely due to
the --as-needed linker option which is commonly used under
Gentoo. This option requires that the linker only include
the minimum set of symbols required by the binary. Without
the full dependency tree the linker would need to bring in
all the symbols from dependent libraries.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
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.
Properly initialize the variable resid for the error case where
vn_rdwr() returns an error with setting *resid. In practice
this is harmless because the contents of resid don't matter
when vn_rdwr() returns an error. But the code does check the
result which means we may or may not end up having the check
zio->io_error. This makes gcc unhappy and having a completely
deterministic code path here is a good thing.
Closes#51
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 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>
When probing /dev/ for validing ZFS devices to import skip floppy
block devices. There's no reason to waste time checking these
devices even though they are valid block devices. Plus, we had
one system get stuck on I/O errors probing the device.
end_request: I/O error, dev fd0, sector 0
Buffer I/O error on device fd0p120, logical block 0
end_request: I/O error, dev fd0, sector 8
Buffer I/O error on device fd0p120, logical block 1
Implement zio_execute() as a wrapper around the static function
__zio_execute() so that we can force __zio_execute() to be inlined.
This reduces stack overhead which is important because __zio_execute()
is called recursively in several zio code paths. zio_execute() itself
cannot be inlined because it is externally visible.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Add two additional basic sanity tests to confirm zvol snapshots
and clones work. The snapshot test is basically the same as the
example provided in the wiki. The clone test goes one step father
and clones the snapshot then modifies it to match the original
modified volume. It them compares them to ensure everything was
modified as expected.
These are just meant to be sanity tests to catch obvious breakage
before tagging a release. They are still not a substitute for a
full regression test suite.