From nobody Wed Mar 15 03:20:06 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbwck6wGqz3xtmQ; Wed, 15 Mar 2023 03:20:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pbwck6R3fz3FlR; Wed, 15 Mar 2023 03:20:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678850406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kenQcEc6uCHCDNT3XdnjmQruTE1gps8pfzc4JJWHvrw=; b=ZRTI1ekKuTdWr85ityWCUEOnrHdh5IAT3q59bOQHlhvkuBNSKExMs6pu5cvOAyA5TbDxMc txQJWymfjbjV/968lGl8uBvfRRU9ATar3+BLHoNsZKSZ9sa/v0rh/fmJ1xl/JP9Mcaxkzh y3fQdNMK9BjONNB0dqxY8zqzjFt3ik6Hsn/xVagy91rX5Zo66jL/Oz36pLbrp9ROo8g5cD XWDIg/kxr7SZfHsSqv5+RQT+UlhymIz+TIXMHmT0Q1HigUSFDptPBRuyMdKPeD68q0sQ69 UDPLKmx1tvvU87Mv8UNJpCl1KP4FDWdknruCznWTcbbi2O5fwPeOhgi41lxyAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678850406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kenQcEc6uCHCDNT3XdnjmQruTE1gps8pfzc4JJWHvrw=; b=xbKd4KXnmva7rsxErzW/cWo83psagsQ5/1IqXbJSKPX5QDyMCOJgEVnVqYr/YC1jAEMUt7 M/cM2ZR7XUgpHW0LuCuA68uJNsQ2U8l0llyOySNgtc1sbbAgDCFfjyPMLvUVnjYsG5sL1Q mon/HRjX3SUt4nT5KeprYuS1EXWt+jjwA0BWsv/GtHT7DrxOdymhUhd+71A7/TnZ94M8KU gYD2ZJKZ57pzRHl63eNQv30s88hKn3wZMG8vyevgvGzSjXaeEz9YAoKe93TdK0f/aNgBtQ 5mm6MsJ+kjVLH6FKGj+rrYYtqJfJ9E7KDvZvGkMnjxjQizlBHF3xf3BIV+VK0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678850406; a=rsa-sha256; cv=none; b=yqXxjKtoFovkbf7W2aXYXXvPRZkjJEKtkzejPO7IPaC/esJL/fIzWscFj/0Gnj3uFkPfsr hojRI5sIwXfrBpKxac60bnXa9c3tqBMR6rYyVppA8YwU1DQOnk1oxQvsJxq5KDjRQi6FW8 8YbhJglQPeNnWy1exq2XHdR/yaUtLnPA6G+jsxVktlfPHsKSTLdIVzV28nqDZMo1H0TnD8 4JFgHQdrgAQ/QOOkTbCpqfSdtxr36E/7YF3EHHW8jhoIUAWcIoaQfg+FRldulWDLO85oKt 7/C+6rMza6hMrr3lTEBwgGluMe5OFHtsnCPYMgMhiMCMsXOS+sI5qjGvKWuplQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pbwck5TDXz11MX; Wed, 15 Mar 2023 03:20:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F3K6sc030943; Wed, 15 Mar 2023 03:20:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F3K6xL030940; Wed, 15 Mar 2023 03:20:06 GMT (envelope-from git) Date: Wed, 15 Mar 2023 03:20:06 GMT Message-Id: <202303150320.32F3K6xL030940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 8e933d9c598e - main - libbe: Avoid double printing cloning errors. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e933d9c598ec847081c322e7ae9a46bf7897886 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8e933d9c598ec847081c322e7ae9a46bf7897886 commit 8e933d9c598ec847081c322e7ae9a46bf7897886 Author: John Grafton AuthorDate: 2023-03-15 03:14:14 +0000 Commit: Warner Losh CommitDate: 2023-03-15 03:15:17 +0000 libbe: Avoid double printing cloning errors. be_clone calls be_clone_cb and both call set_error on the return error path. set_error prints the error resulting in a double print. be_clone_cb should just return the error code and allow be_clone to print it. PR: 265248 Reported by: Graham Perrin Reviewed by: imp, kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/685 --- lib/libbe/be.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libbe/be.c b/lib/libbe/be.c index cc6b8533a8f9..db06bdbb36a8 100644 --- a/lib/libbe/be.c +++ b/lib/libbe/be.c @@ -745,11 +745,11 @@ be_clone_cb(zfs_handle_t *ds, void *data) /* construct the boot environment path from the dataset we're cloning */ if (be_get_path(ldc, dspath, be_path, sizeof(be_path)) != BE_ERR_SUCCESS) - return (set_error(ldc->lbh, BE_ERR_UNKNOWN)); + return (BE_ERR_UNKNOWN); /* the dataset to be created (i.e. the boot environment) already exists */ if (zfs_dataset_exists(ldc->lbh->lzh, be_path, ZFS_TYPE_DATASET)) - return (set_error(ldc->lbh, BE_ERR_EXISTS)); + return (BE_ERR_EXISTS); /* no snapshot found for this dataset, silently skip it */ if (!zfs_dataset_exists(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) @@ -757,7 +757,7 @@ be_clone_cb(zfs_handle_t *ds, void *data) if ((snap_hdl = zfs_open(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) == NULL) - return (set_error(ldc->lbh, BE_ERR_ZFSOPEN)); + return (BE_ERR_ZFSOPEN); nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); @@ -770,7 +770,7 @@ be_clone_cb(zfs_handle_t *ds, void *data) return (-1); if ((err = zfs_clone(snap_hdl, be_path, props)) != 0) - return (set_error(ldc->lbh, BE_ERR_ZFSCLONE)); + return (BE_ERR_ZFSCLONE); nvlist_free(props); zfs_close(snap_hdl); @@ -781,7 +781,7 @@ be_clone_cb(zfs_handle_t *ds, void *data) ldc->depth--; } - return (set_error(ldc->lbh, err)); + return (err); } /*