From nobody Tue Oct 28 02:08:42 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151611393449347.461342015029345; Tue, 16 Jan 2018 06:45:34 -0800 (PST) Received: from localhost ([::1]:39377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebSUX-00008W-Hu for importer@patchew.org; Tue, 16 Jan 2018 09:45:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebS47-00034n-10 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 09:18:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebS46-0004m0-8K for qemu-devel@nongnu.org; Tue, 16 Jan 2018 09:18:14 -0500 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:43926) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebS46-0004ke-0t; Tue, 16 Jan 2018 09:18:14 -0500 Received: by mail-wm0-x230.google.com with SMTP id g1so8675125wmg.2; Tue, 16 Jan 2018 06:18:13 -0800 (PST) Received: from 640k.lan (dynamic-adsl-78-12-229-84.clienti.tiscali.it. [78.12.229.84]) by smtp.gmail.com with ESMTPSA id u10sm1537758wrg.6.2018.01.16.06.18.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jan 2018 06:18:11 -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=LSNvDu74sxJsyHLRNAulAQUtE4ZuBiDoYdLAd5X14v4=; b=o0iIwX8dKSH7/cG6eraDReLaYPYU4rJQbOX/KeDwk61mZIwmbp5Hi4DkmuzX2/ymvX nEtopLCYU2cBUIpq+SFa9NJKxbWuvE86Md+AjImxXw2+SndDoba0UANeJwwnK4cC8m+9 45SW6476VRThC17cd2SZhMFIW5eqp6Z2i3ORShq+ax4grEc1bscfJhfeMMkofoLzrZ9f yvKgEfFMO5w6yUO3e1frlExp9loQj8GWPa1Gk90aJkq4bZk4Mx3+zj5y3sQE9Hsf6xCn ci6LxkXLXF12rV0UEvd7nlMsTjNwJUe3KLMsYcxR80ZpOwWAXV9j0mQhq4Xqnn22gHKF kWSQ== 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=LSNvDu74sxJsyHLRNAulAQUtE4ZuBiDoYdLAd5X14v4=; b=jnaVOoy+b/UpM6X9Bf0GaZU9Ih1eiq3LyGAPCtwEwzA30vBBzpS7x5GM7F14df92hb qYc2Fz2IG2GUSvGnvPjSxqS78NILBZmbwOtKGmCfi3czYnS+/jRkFkin3azKyzfjJ3Bt fPP+7Bru3ZTKf4GGGTMAr6xnIzFZI+gXvtMXBZDWQmRliVgKuu+RdQscGHgcaGQgwrX5 MVNcyZHgdyD+sjBWJtiMd2ecL0g07H4PF4E+evlU5MBHB8yg7B+rjp4i4pkR5TbwaoQl i6ryXfOVPmk2wuKgjrrJHGFtsnLyuVhbjCKVfCfU6cWYY03R4mTjOrlcwEoAeC0vLdpY Oyrw== X-Gm-Message-State: AKwxytc2EqC7k1B0JiSXtEukk/DZjZfClasVUGpBYcAl9jurCer5F+Q/ BGBXp+NRSrhUtdUTNNEQqpUFFWAf X-Google-Smtp-Source: ACJfBosO1/M1F2iiqBxjXyyx03JUQfG4dJdITaF0bJKHMTRwPMFAypU88TGrsHVzAtMr4nXGxSUrEw== X-Received: by 10.28.191.135 with SMTP id o7mr13098648wmi.143.1516112292597; Tue, 16 Jan 2018 06:18:12 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 15:17:07 +0100 Message-Id: <1516112253-14480-26-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516112253-14480-1-git-send-email-pbonzini@redhat.com> References: <1516112253-14480-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:400c:c09::230 Subject: [Qemu-devel] [PULL 25/51] scsi-disk: release AioContext in unaligned WRITE SAME case 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: qemu-stable@nongnu.org, Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefan Hajnoczi scsi_write_same_complete() can retry the write if the request was unaligned. Make sure to release the AioContext when that code path is taken! This patch fixes a hang when QEMU terminates after an unaligned WRITE SAME request has been processed with dataplane. The hang occurs because iothread_stop_all() cannot acquire the AioContext lock that was leaked by the IOThread in scsi_write_same_complete(). Fixes: b9e413dd37 ("block: explicitly acquire aiocontext in aio callbacks t= hat need it"). Cc: Paolo Bonzini Cc: qemu-stable@nongnu.org Reported-by: Cong Li Signed-off-by: Stefan Hajnoczi Message-Id: <20180104142502.15175-1-stefanha@redhat.com> Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-disk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index e58833a..49d2559 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1755,6 +1755,7 @@ static void scsi_write_same_complete(void *opaque, in= t ret) data->sector << BDRV_SECTOR_BITS, &data->qiov, 0, scsi_write_same_complete, data); + aio_context_release(blk_get_aio_context(s->qdev.conf.blk)); return; } =20 --=20 1.8.3.1