All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	David Scott <dave@recoil.org>,
	Edwin Torok <edvin.torok@citrix.com>,
	Rob Hoes <Rob.Hoes@citrix.com>
Subject: [PATCH 1/8] tools/oxenstored: Fix incorrect scope after an if statement
Date: Tue, 22 Nov 2022 15:20:36 +0000	[thread overview]
Message-ID: <20221122152043.8518-2-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <20221122152043.8518-1-andrew.cooper3@citrix.com>

A debug statement got inserted into a single-expression if statement.

Insert brackets to give the intended meaning, rather than the actual meaning
where the "let con = Connections..." is outside and executed unconditionally.

This results in some unnecessary ring checks for domains which otherwise have
IO credit.

Fixes: 42f0581a91d4 ("tools/oxenstored: Implement live update for socket connections")
Reported-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Christian Lindig <christian.lindig@citrix.com>
CC: David Scott <dave@recoil.org>
CC: Edwin Torok <edvin.torok@citrix.com>
CC: Rob Hoes <Rob.Hoes@citrix.com>
---
 tools/ocaml/xenstored/xenstored.ml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index ffd43a4eee64..c5dc7a28d082 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -475,7 +475,7 @@ let _ =
 
 	let ring_scan_checker dom =
 		(* no need to scan domains already marked as for processing *)
-		if not (Domain.get_io_credit dom > 0) then
+		if not (Domain.get_io_credit dom > 0) then (
 			debug "Looking up domid %d" (Domain.get_id dom);
 			let con = Connections.find_domain cons (Domain.get_id dom) in
 			if not (Connection.has_more_work con) then (
@@ -490,7 +490,8 @@ let _ =
 					let n = 32 + 2 * (Domains.number domains) in
 					info "found lazy domain %d, credit %d" (Domain.get_id dom) n;
 					Domain.set_io_credit ~n dom
-			) in
+			)
+		) in
 
 	let last_stat_time = ref 0. in
 	let last_scan_time = ref 0. in
-- 
2.11.0



  reply	other threads:[~2022-11-22 15:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 15:20 [PATCH 0/8] Oxenstored live update fixes Andrew Cooper
2022-11-22 15:20 ` Andrew Cooper [this message]
2022-11-23 14:50   ` [PATCH 1/8] tools/oxenstored: Fix incorrect scope after an if statement Andrew Cooper
2022-11-22 15:20 ` [PATCH 2/8] tools/ocaml/evtchn: OCaml 5 support, fix potential resource leak Andrew Cooper
2022-11-22 15:20 ` [PATCH 3/8] tools/ocaml/evtchn: Add binding for xenevtchn_fdopen() Andrew Cooper
2022-11-22 15:20 ` [PATCH 4/8] tools/ocaml/evtchn: Extend the init() binding with a cloexec flag Andrew Cooper
2022-11-22 15:20 ` [PATCH 5/8] tools/oxenstored: Keep /dev/xen/evtchn open across live update Andrew Cooper
2022-11-23 10:59   ` Christian Lindig
2022-11-22 15:20 ` [PATCH 6/8] tools/oxenstored: Log live update issues at warning level Andrew Cooper
2022-11-22 15:20 ` [PATCH 7/8] tools/oxenstored: Set uncaught exception handler Andrew Cooper
2022-11-22 15:20 ` [PATCH 8/8] tools/oxenstored/syslog: Avoid potential NULL dereference Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221122152043.8518-2-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Rob.Hoes@citrix.com \
    --cc=christian.lindig@citrix.com \
    --cc=dave@recoil.org \
    --cc=edvin.torok@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.