Date: Tue, 13 Jul 2021 15:51:51 GMT From: Ryan Moeller <freqlabs@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 207b3a418a53 - stable/12 - zfsd: Check for error from zpool_vdev_online Message-ID: <202107131551.16DFppOU049537@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=207b3a418a536853af0561b443f32911da18bba9 commit 207b3a418a536853af0561b443f32911da18bba9 Author: Ryan Moeller <freqlabs@FreeBSD.org> AuthorDate: 2021-07-06 16:00:18 +0000 Commit: Ryan Moeller <freqlabs@FreeBSD.org> CommitDate: 2021-07-13 15:48:33 +0000 zfsd: Check for error from zpool_vdev_online Onlining a vdev can fail. Log the error if it does. Reviewed by: mav, asomers MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D30882 (cherry picked from commit 53b438b2425c374f6147ac80b3330a9ec08432bb) --- cddl/usr.sbin/zfsd/case_file.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cddl/usr.sbin/zfsd/case_file.cc b/cddl/usr.sbin/zfsd/case_file.cc index 19c4abe45fc9..6a4483ec49c2 100644 --- a/cddl/usr.sbin/zfsd/case_file.cc +++ b/cddl/usr.sbin/zfsd/case_file.cc @@ -281,9 +281,17 @@ CaseFile::ReEvaluate(const string &devPath, const string &physPath, Vdev *vdev) || vdev->PoolGUID() == Guid::InvalidGuid()) && vdev->GUID() == m_vdevGUID) { - zpool_vdev_online(pool, vdev->GUIDString().c_str(), - ZFS_ONLINE_CHECKREMOVE | ZFS_ONLINE_UNSPARE, - &m_vdevState); + if (zpool_vdev_online(pool, vdev->GUIDString().c_str(), + ZFS_ONLINE_CHECKREMOVE | ZFS_ONLINE_UNSPARE, + &m_vdevState) != 0) { + syslog(LOG_ERR, + "Failed to online vdev(%s/%s:%s): %s: %s\n", + zpool_get_name(pool), vdev->GUIDString().c_str(), + devPath.c_str(), libzfs_error_action(g_zfsHandle), + libzfs_error_description(g_zfsHandle)); + return (/*consumed*/false); + } + syslog(LOG_INFO, "Onlined vdev(%s/%s:%s). State now %s.\n", zpool_get_name(pool), vdev->GUIDString().c_str(), devPath.c_str(),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107131551.16DFppOU049537>