Date: Fri, 2 Mar 2018 21:26:48 +0000 (UTC) From: Alan Somers <asomers@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330295 - head/cddl/contrib/opensolaris/lib/libzfs/common Message-ID: <201803022126.w22LQmt0034895@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: asomers Date: Fri Mar 2 21:26:48 2018 New Revision: 330295 URL: https://svnweb.freebsd.org/changeset/base/330295 Log: 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 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Fri Mar 2 21:26:27 2018 (r330294) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Fri Mar 2 21:26:48 2018 (r330295) @@ -923,6 +923,7 @@ zpool_read_label(int fd, nvlist_t **config) free(label); *config = NULL; + errno = ENOENT; return (-1); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803022126.w22LQmt0034895>