From nobody Fri Nov 7 00:50:09 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544628831683549.5269273322804; Wed, 12 Dec 2018 07:33:51 -0800 (PST) Received: from localhost ([::1]:45612 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX6WE-0000Xf-EY for importer@patchew.org; Wed, 12 Dec 2018 10:33:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX6Ma-0000r7-5K for qemu-devel@nongnu.org; Wed, 12 Dec 2018 10:23:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gX6MY-0000G2-9x for qemu-devel@nongnu.org; Wed, 12 Dec 2018 10:23:52 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:33942) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gX6MX-0008U9-Qy for qemu-devel@nongnu.org; Wed, 12 Dec 2018 10:23:50 -0500 Received: by mail-wm1-x334.google.com with SMTP id y185so11704432wmd.1 for ; Wed, 12 Dec 2018 07:23:34 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id u10sm15878859wrr.33.2018.12.12.07.23.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Dec 2018 07:23:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=fQpLtsThwt5DuhFXbBcnqc82C2vXp/ZdCRb88kBMhR0=; b=X2XuGwaIoLXA4gZhar9y9Yf7HLcJccBD0Bdnae8Hli4nrgxrg8Ctui/PNHmcSGLXIw rgzkk0jn3bDiLV1G7rv48jg9Pu0xUcU5ejIt439fkdi4uTsGwW6KPnhLVUyjUWw6GKCc oMXdrXjCuUMjB0DLnqlqUHIzdkcaFtN0Y0U4U9PGuEUluWv0vszrG8nh2irShVO+QtLa nHa+1yqxU6QH6ujtKQ6Mx9xarlVf4yPU6fjDj5r3NbQ1bEsk2P4VIZLLYw+H1zKbYIcR ceqRP8t/c6J5p/eeKYdKDpTmi6xndSmTvugMOgaNGmBbC+xvGv0Aiyp/OWSbN/aOg4g8 ugxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=fQpLtsThwt5DuhFXbBcnqc82C2vXp/ZdCRb88kBMhR0=; b=iCx8B5Z8gYNgA4K7+SafQNQi/BGy7hFznGIjKm4RC1VjYegzSnV1fhsAcuZ/cXvD+Z JSruxX8DzM3/vw2m3WZ1DRTQq72FYY29g9hcnZW9dY8pGY622vySBGuBfOMl3+NLjDnd LqCKtiszxm1azfVMFzpy+OcqOFUyfpgUap1LtuZr3h1Tc1I9WgnlpXBj9NdIoaGIwJxv CJYnPi14dDBUm5AuVWy24qrS3rarylv+Q3Wtm9kGzHn72BYSdIDNwQYnE8MKSJ10qsiG uq6cTWjNB24KvOEqRrUKU0sJnYvutN0jy9ZXTHThtRU4ssWHn+MxBBOtAQ60/rr5e6s+ bhfQ== X-Gm-Message-State: AA+aEWbv1sUfnGh6AxMz37sWhQNkQo1uOxTpRoiKVBztF65Ee2MzX9FQ ogbm1yfB9BiAgHBfVZqxOvAMfFQJ X-Google-Smtp-Source: AFSGD/X+is3mwqR7mQjXXGhmbyxRJ9IfRNWRqmJ800UbuiL936Bs7x0y2a553zKN4QKUnSVXeXrAWA== X-Received: by 2002:a7b:c142:: with SMTP id z2mr7112298wmi.102.1544628213276; Wed, 12 Dec 2018 07:23:33 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 12 Dec 2018 16:22:34 +0100 Message-Id: <1544628195-37728-14-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1544628195-37728-1-git-send-email-pbonzini@redhat.com> References: <1544628195-37728-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::334 Subject: [Qemu-devel] [PULL 13/54] block/iscsi: take iscsilun->mutex in iscsi_timed_check_events() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefan Hajnoczi Commit d045c466d9e62b4321fadf586d024d54ddfd8bd4 ("iscsi: do not use aio_context_acquire/release") introduced iscsilun->mutex but appears to have overlooked iscsi_timed_check_events() when introducing the mutex. iscsi_service() and iscsi_set_events() must be called with iscsilun->mutex held. iscsi_timed_check_events() is invoked from the AioContext and does not take the mutex. Signed-off-by: Stefan Hajnoczi Message-Id: <20180203061621.7033-3-stefanha@redhat.com> Reviewed-by: Paolo Bonzini Signed-off-by: Paolo Bonzini --- block/iscsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index a4e3730..1924a2b 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -344,6 +344,8 @@ static void iscsi_timed_check_events(void *opaque) { IscsiLun *iscsilun =3D opaque; =20 + qemu_mutex_lock(&iscsilun->mutex); + /* check for timed out requests */ iscsi_service(iscsilun->iscsi, 0); =20 @@ -356,6 +358,8 @@ static void iscsi_timed_check_events(void *opaque) * to return to service once this situation changes. */ iscsi_set_events(iscsilun); =20 + qemu_mutex_unlock(&iscsilun->mutex); + timer_mod(iscsilun->event_timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + EVENT_INTERVAL); } --=20 1.8.3.1