From nobody Thu Nov 28 08:44:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1692936442; cv=none; d=zohomail.com; s=zohoarc; b=myc+d4qtCLi3/xyg96hcr2qBrSJsz9DrOkSg23cMZMiAf9SajCKGUwr8YFAfmd2nCyEFd+K6cHJOf54k1Bv7LkfwIGA1Uc8sKN4Keo1EaxDsfkhTXKzR3+yM2zSkkwzt8NPZHn74i0LIMJ2wzDcaY593voHlqrfBrKqcv1zSdBQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692936442; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=CgyduE1cNWQmXiArc/LpZuyhlEVZYQGVKd5wnAV5op8=; b=Eorv6Y4wznHNEYaoGIqn/6Nh1C8SFN4xeUS5MTITZe/nSHh4Cp9fIVcRd91n3TK28bKojijtO4Rxqx++8xM52jlUu22TpV4zkIoC3ZE1/IfsX86kKL9wdhQaZNkg5sRyskpzLRs40R6xiW+bYv933+8NFJsNwXdIeU5ozOoq6KY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692936442149697.528818048446; Thu, 24 Aug 2023 21:07:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZO5c-0000ip-SQ; Fri, 25 Aug 2023 00:06:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZO5b-0000iF-5I; Fri, 25 Aug 2023 00:06:27 -0400 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZO5Z-0002a7-0m; Fri, 25 Aug 2023 00:06:26 -0400 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3a81154c570so345822b6e.1; Thu, 24 Aug 2023 21:06:24 -0700 (PDT) Received: from fedlinux.. ([106.84.134.102]) by smtp.gmail.com with ESMTPSA id a23-20020a637057000000b00563e1ef0491sm455068pgn.8.2023.08.24.21.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 21:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692936383; x=1693541183; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=CgyduE1cNWQmXiArc/LpZuyhlEVZYQGVKd5wnAV5op8=; b=DtAEp+x48eypFDvRUNplws+xJa1sRcnYJ4U3VOLkipBVE1StMZ/i7a5WXBbs6tli5I 3ZpjQwqbsBrJyMx7i7xB8+cyIPYH7OjvhQhU85Qh3Cpvobtzj/y4n9kkNbNOrCXQysK5 cPaLqzyXng1A2Gh0WhgNgxFkBlUKUrNI3zePQVF4j9F2mnwfaxCgKPmXyQKjouySZ3mR E0p0HGs7hwb9I3KFLz2b9uf/G0xR0Je7WGDRcb1yNPBWjxvaVCD+upw1LPFg9AURLvqJ CAhJbrpPtF3B+tAqM7+xPgumvog3cikzvaTK32SMqtORLgy+hs3dIQ1ShcJqgyVpUe9d Em3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692936383; x=1693541183; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CgyduE1cNWQmXiArc/LpZuyhlEVZYQGVKd5wnAV5op8=; b=VR+mY3VO3zsQj81D1qg3lXzxjDsKDbmNXmegPdlUP3Z17LDzDvWWjvYsZOK7zOgFmJ iaK8xLGaH8Hxxb7TdNz5lZp4anQMrEmkTur2VWc60qYBrvvU5Iq+Z0Qpi4PYWF2MV53u 0vy/7VkC1crxvotJYgKU+U0zjoGdjmPjZ6Qh1pmkLJRbdxEbBspWdI2OX1B+g83DuOQF 8AVTc3ZxV2cGTAjaYSPhc3YNQ+u5FgMqXKOkffruj017L5EroeGRqjT6SriZo7ZI7p41 AyDNx/9VNSdZ3KwWm/iafmouUHnD4AhzP2hSPQ2Oz7VGRAVkfbmzaR9MO2HuV2DK/yUZ lL/g== X-Gm-Message-State: AOJu0YwPh9DnqURAVnSMEReiu23gtmEcJv4tMPohyOkZDUKmj0Tiy9ES 1IsT0ruIAMyDeGhJCvLiUgL9ICPW/dLkCo39 X-Google-Smtp-Source: AGHT+IEOzW4Nvrj3lbVExdGP6QiOm9mJNYmrSmsp5BI5DU1MxtlxWJh90gUtI1+tI+yUGfdV3foH6Q== X-Received: by 2002:a05:6808:181:b0:3a7:6acd:c7c with SMTP id w1-20020a056808018100b003a76acd0c7cmr1722489oic.18.1692936382359; Thu, 24 Aug 2023 21:06:22 -0700 (PDT) From: Sam Li To: qemu-devel@nongnu.org Cc: hare@suse.de, Hanna Reitz , Kevin Wolf , dlemoal@kernel.org, stefanha@redhat.com, qemu-block@nongnu.org, dmitry.fomichev@wdc.com, Sam Li Subject: [PATCH v2] block/file-posix: fix update_zones_wp() caller Date: Fri, 25 Aug 2023 12:05:56 +0800 Message-Id: <20230825040556.4217-1-faithilikerun@gmail.com> X-Mailer: git-send-email 2.40.1 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=2607:f8b0:4864:20::22d; envelope-from=faithilikerun@gmail.com; helo=mail-oi1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1692936442610100001 Content-Type: text/plain; charset="utf-8" When the zoned request fail, it needs to update only the wp of the target zones for not disrupting the in-flight writes on these other zones. The wp is updated successfully after the request completes. Fixed the callers with right offset and nr_zones. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- block/file-posix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index b16e9c21a1..55e7f06a2f 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2522,7 +2522,8 @@ out: } } else { if (type & (QEMU_AIO_WRITE | QEMU_AIO_ZONE_APPEND)) { - update_zones_wp(bs, s->fd, 0, 1); + /* write and append write are not allowed to cross zone bounar= ies */ + update_zones_wp(bs, s->fd, offset, 1); } } =20 @@ -3472,7 +3473,7 @@ static int coroutine_fn raw_co_zone_mgmt(BlockDriverS= tate *bs, BlockZoneOp op, len >> BDRV_SECTOR_BITS); ret =3D raw_thread_pool_submit(handle_aiocb_zone_mgmt, &acb); if (ret !=3D 0) { - update_zones_wp(bs, s->fd, offset, i); + update_zones_wp(bs, s->fd, offset, nrz); error_report("ioctl %s failed %d", op_name, ret); return ret; } --=20 2.40.1