From patchwork Mon Jul 22 15:21:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1963298 X-Patchwork-Delegate: i.maximets@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WSPBm3K0Mz1ybY for ; Tue, 23 Jul 2024 01:21:36 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 869734021E; Mon, 22 Jul 2024 15:21:34 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 1ps6VdzAL7op; Mon, 22 Jul 2024 15:21:33 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 53891401E1 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 53891401E1; Mon, 22 Jul 2024 15:21:33 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D2E8BC0A97; Mon, 22 Jul 2024 15:21:32 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 69887C0A96 for ; Mon, 22 Jul 2024 15:21:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 44260605AC for ; Mon, 22 Jul 2024 15:21:31 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id RA6brkG58dCa for ; Mon, 22 Jul 2024 15:21:30 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:4b98:dc4:8::224; helo=relay4-d.mail.gandi.net; envelope-from=i.maximets@ovn.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 27679600C6 Authentication-Results: smtp3.osuosl.org; dmarc=none (p=none dis=none) header.from=ovn.org DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 27679600C6 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by smtp3.osuosl.org (Postfix) with ESMTPS id 27679600C6 for ; Mon, 22 Jul 2024 15:21:29 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4AD1AE000C; Mon, 22 Jul 2024 15:21:27 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Cc: Ilya Maximets Date: Mon, 22 Jul 2024 17:21:24 +0200 Message-ID: <20240722152125.3682051-1-i.maximets@ovn.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-GND-Sasl: i.maximets@ovn.org Subject: [ovs-dev] [PATCH] ovsdb: transaction: Remove incorrect transaction abort in pre-commit. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Pre-commit must not abort the transaction, otherwise the upper layers may crash accessing it. E.g. ovsdb_trigger_try() checks the state of the transaction after trying to commit it. This particular failure can't actually happen, because the function determine_changes() can't fail. However, the code is still wrong and a bit misleading, so should be fixed. Fixes: 53178986d7fc ("ovsdb: Add support for online schema conversion.") Signed-off-by: Ilya Maximets Acked-by: Mike Pattrick --- ovsdb/transaction.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ovsdb/transaction.c b/ovsdb/transaction.c index 65eca6478..98fff1a74 100644 --- a/ovsdb/transaction.c +++ b/ovsdb/transaction.c @@ -1090,7 +1090,6 @@ ovsdb_txn_precommit(struct ovsdb_txn *txn) * was really a no-op. */ error = for_each_txn_row(txn, determine_changes); if (error) { - ovsdb_txn_abort(txn); return OVSDB_WRAP_BUG("can't happen", error); } if (ovs_list_is_empty(&txn->txn_tables)) {