From nobody Tue Feb 10 04:55:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624631583360959.8324555279428; Fri, 25 Jun 2021 07:33:03 -0700 (PDT) Received: from localhost ([::1]:35664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwmtB-00043Z-Te for importer@patchew.org; Fri, 25 Jun 2021 10:33:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwmfQ-0003fL-HO for qemu-devel@nongnu.org; Fri, 25 Jun 2021 10:18:48 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:42572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwmfP-0003JK-4D for qemu-devel@nongnu.org; Fri, 25 Jun 2021 10:18:48 -0400 Received: by mail-ed1-x52e.google.com with SMTP id m14so13622878edp.9 for ; Fri, 25 Jun 2021 07:18:46 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id c28sm326579ejc.102.2021.06.25.07.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 07:18:45 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=wJvWsUqGOQTva1vOWOjj4YQ10DwGdZUCbC7uWnekL7s=; b=eCxQlIdMRXTg4PhCey4xhR9/kK8L+UT7ueMVhmu/G6GSEczaMFZpnDEDgJ56xwwScD HqAIysoxO2JnyAKImUzY5Vk9HkH7i2DC79BQrFja7YMNFN6qlQtXb9JMJsIcUdwZ1mzw VogRZsdZV6JJorviwLOOYZ0Im+6A+lxK1azuj8naiNHA9Rm6NmMLBEFPuBiea8bZ/KZK 55UchIIKm0JlZjt1C8tfwLFpdYBliUBbQXWV21G1ym8pXsvD909xwolGeY4VPcPouz/j r20l81kFk4WCrO8lhBYwVWGjZj7eTE5fHQKQJDwXw2yBcZaOPQeYqPWkbT0yNsrrqLwq LKxg== 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:mime-version:content-transfer-encoding; bh=wJvWsUqGOQTva1vOWOjj4YQ10DwGdZUCbC7uWnekL7s=; b=Y5eIIXrDTAHpgQ4CZdu1ST0HHiuZXSvSU0yO18RdtIwCcW9LKgNh6HbrOemkHr5mFG Gs7YUBkea8uy0vZ5ioia9m3Tb7hxlzx5Mn6nCspCLSNbYK/ld37OTsNbtouFWFO0N/+P zVBJCWIrFT8HgUHgeWtwED4zYOfBHTVGOBwexi4ItQ1hfCRshhKq6tOy/VF5JEhRYjxa oRXEiEmb6Q7lLhiKJv3tgt8k1PnBrR00B86WMY+aZ0orrxrJj7dQsnURA1JSu79H+MXu 0TpjdmkVihbyAxPxExZbfccoGZlIQV4vJ5EXdA7qeDTKtzBItsFX8IF7QcDNTFtxr1yI WeRQ== X-Gm-Message-State: AOAM5313YoMkTHCEt+1bnGvFWMzGzGdD8MS8A8FEYAq5kCbHyzKCcM1G y8GyobpGhAVrSWdVCMeeYHRS4RjF/Kw= X-Google-Smtp-Source: ABdhPJzakt1aWsMAZU9+RDJYt7Yz3WUBWfYiZlWkzDifPXDj4gueRqV+pjQFklaeVPfi/oDHMlNv9Q== X-Received: by 2002:a50:fc90:: with SMTP id f16mr15164610edq.254.1624630725827; Fri, 25 Jun 2021 07:18:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 23/28] file-posix: handle EINTR during ioctl Date: Fri, 25 Jun 2021 16:18:17 +0200 Message-Id: <20210625141822.1368639-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210625141822.1368639-1-pbonzini@redhat.com> References: <20210625141822.1368639-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gordon Watson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Similar to other handle_aiocb_* functions, handle_aiocb_ioctl needs to cater for the possibility that ioctl is interrupted by a signal. Otherwise, the I/O is incorrectly reported as a failure to the guest. Reported-by: Gordon Watson Signed-off-by: Paolo Bonzini --- block/file-posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index 74b8216077..a26eab0ac3 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -1347,7 +1347,9 @@ static int handle_aiocb_ioctl(void *opaque) RawPosixAIOData *aiocb =3D opaque; int ret; =20 - ret =3D ioctl(aiocb->aio_fildes, aiocb->ioctl.cmd, aiocb->ioctl.buf); + do { + ret =3D ioctl(aiocb->aio_fildes, aiocb->ioctl.cmd, aiocb->ioctl.bu= f); + } while (ret =3D=3D -1 && errno =3D=3D EINTR); if (ret =3D=3D -1) { return -errno; } --=20 2.31.1