From nobody Mon Feb 19 03:41:48 2024 X-Original-To: dev-commits-src-all@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 4TdSyN6PMbz58sxT; Mon, 19 Feb 2024 03:41:48 +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 4TdSyN4dVjz4s9C; Mon, 19 Feb 2024 03:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708314108; 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=YnCdkaJn+4vdsHgLmIC8bZW1+YQ6QSfA1srS6XO03gk=; b=PtVLUh3rQvlBvlBMgS8kaVa9M5NOgvg2CzSWjPrtxrqOySzG9HlkXLQBFZUZHO4Lgg06tJ NUCgfbY4vDuAMO/IkWXss3o+0FpEsacuh3Jkmxw3YbQdK9FuNI5wDRaoB1QN+FqDCBaiO4 5yPF2wc17Tj/wB8efRhoreEtJYmY96DAGQ/rOl5ScvB+CuHZ0yNsdmlyWccSCIBqryveyd YeNW9a7vMrNVjtq3aijY8SRMI9v2QhtS3zb6SwkoVNXM1rVfBp3+CPehHMvgcaXicOo3lV EEGf/s3yBn10v12608pA9EHHvFvB+Mm28NUHMz3IDF4RNNv4qtPKyclBD/7TXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708314108; 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=YnCdkaJn+4vdsHgLmIC8bZW1+YQ6QSfA1srS6XO03gk=; b=sAKY6jYOBvAhTsJw7BZ46Mx/7l6f9rxKHEDFk3wSMTgNHSt0acYnYfLR7zOjeQkeNeMCpq wxCQ0eiiz8r3/szIilaDGyETs3zUL4b2jC8oHNKe7lb7g7pHx2bLtCGP0ZunEv/7XnR9vZ 2wzmRy24mpgu60cK5cEExGQXJuV8wloYwkeBM3aWAgWJcL1AbrXaXNmrBhDVrTQECXSrbJ XNl1Vy5ZwAOsAlvFte5QffCJT0UNXn7JeyNuBBetrp4khCVzc/Zp1EVTqhnLwd6tUkC4Xw 6K/H+w8/8FyFGrvnFoFDSHnS8HHIfQzFm63D7UHljfnfGmpluC5ARmT7FA5JLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708314108; a=rsa-sha256; cv=none; b=yVBIXo1PYN5BfV0ziQHWmB4lVT+VWW7meNWLLzEd3MbLGYiizaFoFxyBra60ND/+TVAw0s kUXdrwANr22bqFiCfX8a2/t3IVlrnnmamfHB130GEMOnMovGxOYkRj07l/LddD6EpsYjuJ T/ss76q/g67mzPGRcxQKO3FC7Tfrxoc5TCPA+JjJfypsuYF1mGtE8jesJnzSu1xWOanQIM s3Sxi8lDqDoa9dALB8uNJn+ygNcbLHhuWiu8Vy+FTNNKrzQqpcsSDFl26uOC8AjwdJM2vn R9QduQG+U5INvo6lmkUg5DB1UNqcwMdzXLWnKaifxNdjZdz90pn68mIfkv7MoQ== 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 4TdSyN3MJ5zJVK; Mon, 19 Feb 2024 03:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J3fmOA070983; Mon, 19 Feb 2024 03:41:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J3fmVE070980; Mon, 19 Feb 2024 03:41:48 GMT (envelope-from git) Date: Mon, 19 Feb 2024 03:41:48 GMT Message-Id: <202402190341.41J3fmVE070980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: ddf5bf4319f6 - stable/13 - libbe: Avoid double printing cloning errors. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: ddf5bf4319f61ccbb7f9e843965df86ac60253df Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ddf5bf4319f61ccbb7f9e843965df86ac60253df commit ddf5bf4319f61ccbb7f9e843965df86ac60253df Author: John Grafton AuthorDate: 2023-03-15 03:14:14 +0000 Commit: Warner Losh CommitDate: 2024-02-19 03:02:58 +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 (cherry picked from commit 8e933d9c598ec847081c322e7ae9a46bf7897886) --- 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 cb8ff95c4e07..21dd168b2557 100644 --- a/lib/libbe/be.c +++ b/lib/libbe/be.c @@ -754,11 +754,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)) @@ -766,7 +766,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"); @@ -779,7 +779,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); @@ -790,7 +790,7 @@ be_clone_cb(zfs_handle_t *ds, void *data) ldc->depth--; } - return (set_error(ldc->lbh, err)); + return (err); } /*