HomeFreeBSD

OpenZFS 7541 - zpool import/tryimport ioctl returns ENOMEM

Description

OpenZFS 7541 - zpool import/tryimport ioctl returns ENOMEM

Authored by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>

The refresh_config() calls into the kernel with ZFS_IOC_POOL_TRYIMPORT.
This ioctl returns the config of the pool in a buffer pre-allocated in
userland. The original estimate for the size is too conservative since
it doesn't account for the large size of vdev stats that are added to
the config before returning.
This fix simply increases the size of the buffer passed. This results in
a speed up of the zpool import process, and less spam in zfs_dbgmsg.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: George Melikov <mail@gmelikov.ru>

OpenZFS-issue: https://www.illumos.org/issues/7541
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/a3c7690
Closes #5704

Details

Provenance
George Melikov <mail@gmelikov.ru>Authored on Jan 30 2017, 9:20 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jan 30 2017, 9:20 PM
Parents
rG456079d48dcc: OpenZFS 7502 - ztest should run zdb with -G (debug mode)
Branches
Unknown
Tags
Unknown