diff options
author | Alan Somers <asomers@FreeBSD.org> | 2018-03-02 21:26:48 +0000 |
---|---|---|
committer | Alan Somers <asomers@FreeBSD.org> | 2018-03-02 21:26:48 +0000 |
commit | 50b779bdc91b722de4b64c7757447dab3ae64fe4 (patch) | |
tree | 8d48529f0616dde3461af7d84423ef469acabc9a /cddl/contrib/opensolaris/lib | |
parent | c505b599614b226c0254d12737300cb2515a9b2a (diff) | |
download | src-50b779bdc91b722de4b64c7757447dab3ae64fe4.tar.gz src-50b779bdc91b722de4b64c7757447dab3ae64fe4.zip |
ZFS: fix adding vdevs to very large pools
r323791 changed the return value of zpool_read_label. Error paths that
previously returned 0 began to return -1 instead. However, not all error
paths initialized errno. When adding vdevs to a very large pool, errno could
be prepopulated with ENOMEM, causing the operation to fail. Fix the bug by
setting errno=ENOENT in the case that no ZFS label is found.
PR: 226096
Submitted by: Nikita Kozlov
Reviewed by: avg
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D13088
Notes
Notes:
svn path=/head/; revision=330295
Diffstat (limited to 'cddl/contrib/opensolaris/lib')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c index 2f5d76e1ba6e..ce008e8626f9 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c @@ -923,6 +923,7 @@ zpool_read_label(int fd, nvlist_t **config) free(label); *config = NULL; + errno = ENOENT; return (-1); } |