From nobody Sun Oct 5 19:25:05 2025 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588627184; cv=none; d=zohomail.com; s=zohoarc; b=NBE+HjG68HqVzPC429R0vYpRq5ASrfMEqf81fUtECoAOnYAb6iq0uu5TbrZ/6WqufRmU5x6qq5DbfazsSrWGGHTcYleyxYGXLiiT61psuIcQ45RmXDrjz+uJRcLMPrXGs+6NM1J9U2UYfbi4aUFAjmDzB1ze9vnP7s7zIxNpv1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588627184; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CS2yMyIdMIcYBk9KxJ4n/OXgIx22cYjoT4vg/NXgLDE=; b=TlYIyA3ugO9AW+0sKg+OROGQmdFWe3JfmUIjLWHjSMhh8tP+gGu1rK3mlYR33H9NXDmshbl7SsjzgV2z71ZtVtFVfpmrD2mWr9iyV0YEK3CNgL9MI4G1m5yyUiNMDnS2pgFTAU0qY5BHNi6uaT4t9P2RpmRLKyU9EpdiPzVM0go= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588627184099317.9053227918213; Mon, 4 May 2020 14:19:44 -0700 (PDT) Received: from localhost ([::1]:35566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jViV4-00084O-OW for importer@patchew.org; Mon, 04 May 2020 17:19:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jViQP-0003np-09 for qemu-devel@nongnu.org; Mon, 04 May 2020 17:14:53 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:38690 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jViQN-0000mA-NV for qemu-devel@nongnu.org; Mon, 04 May 2020 17:14:52 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-290-mt2liLIkN9a_BHVGUZwKpg-1; Mon, 04 May 2020 17:14:48 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53B1A464; Mon, 4 May 2020 21:14:47 +0000 (UTC) Received: from blue.redhat.com (ovpn-114-73.phx2.redhat.com [10.3.114.73]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08FE46FF1B; Mon, 4 May 2020 21:14:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588626890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CS2yMyIdMIcYBk9KxJ4n/OXgIx22cYjoT4vg/NXgLDE=; b=KthiqCBRHegGl8IV8ReNUoCGqs/pkKE9AnFl7hl0xMk8b7tW8soY0PwULy7ymWooODzQP5 fl0KHJNdxtB1eR66bs/oZYvt8x43GLqQ1+D1hILl4uOtPXh+avmueh49hT+wBScb8X0PUd 91VEID/YuDtNoSRXXJNnxfB0tH3yB9w= X-MC-Unique: mt2liLIkN9a_BHVGUZwKpg-1 From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 1/4] tools: Fix use of fcntl(F_SETFD) during socket activation Date: Mon, 4 May 2020 16:14:35 -0500 Message-Id: <20200504211438.195926-2-eblake@redhat.com> In-Reply-To: <20200504211438.195926-1-eblake@redhat.com> References: <20200504211438.195926-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.61; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/04 01:21:32 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] 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, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Blindly setting FD_CLOEXEC without a read-modify-write will inadvertently clear any other intentionally-set bits, such as a proposed new bit for designating a fd that must behave in 32-bit mode. However, we cannot use our wrapper qemu_set_cloexec(), because that wrapper intentionally abort()s on failure, whereas the probe here intentionally tolerates failure to deal with incorrect socket activation gracefully. Instead, fix the code to do the proper read-modify-write. Signed-off-by: Eric Blake Message-Id: <20200420175309.75894-3-eblake@redhat.com> Reviewed-by: Peter Maydell --- util/systemd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/systemd.c b/util/systemd.c index 1dd0367d9a84..5bcac9b40169 100644 --- a/util/systemd.c +++ b/util/systemd.c @@ -23,6 +23,7 @@ unsigned int check_socket_activation(void) unsigned long nr_fds; unsigned int i; int fd; + int f; int err; s =3D getenv("LISTEN_PID"); @@ -54,7 +55,8 @@ unsigned int check_socket_activation(void) /* So the file descriptors don't leak into child processes. */ for (i =3D 0; i < nr_fds; ++i) { fd =3D FIRST_SOCKET_ACTIVATION_FD + i; - if (fcntl(fd, F_SETFD, FD_CLOEXEC) =3D=3D -1) { + f =3D fcntl(fd, F_GETFD); + if (f =3D=3D -1 || fcntl(fd, F_SETFD, f | FD_CLOEXEC) =3D=3D -1) { /* If we cannot set FD_CLOEXEC then it probably means the file * descriptor is invalid, so socket activation has gone wrong * and we should exit. --=20 2.26.2 From nobody Sun Oct 5 19:25:05 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1588627006; cv=none; d=zohomail.com; s=zohoarc; b=gwBQ3vXtcxaeNxjSEeOMIKfzGl8pk70b/a1I89e9TqQ7zSHMhn3m2peHzXBQpTR+XcPrAv9r41nwmjXr41jnEgltKKBDFAbRUEIRgsVO/SQMwKvnyCCy1TlHW5DDMMdR4gDXH6Cihq6vDIIMoK6cEBdL7JAHULZX5fw8yREyAyU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588627006; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EreIJQ4hJ/hcapIcvpXQICfb5MIGrsU9rUtkQuqOyIc=; b=NJW0Rs7e8xD8qlo7k8YOnPQnF5i8jLk4FX07YrlAgft7zPwAD0iV6kKJjwZPwEugcw7DjGskcpwtQ9WyP6ONvfgUgDqyPLZ6UqLVjZFuM5rUPBsap0uPKZREc/bYrddhI3hkxLsX0VNFt79675l/0jNWD2kW9bt0lYSu6Dlx2ow= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588627006709200.02245227138076; Mon, 4 May 2020 14:16:46 -0700 (PDT) Received: from localhost ([::1]:57438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jViSC-0005HR-Mq for importer@patchew.org; Mon, 04 May 2020 17:16:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jViQR-0003sX-S7 for qemu-devel@nongnu.org; Mon, 04 May 2020 17:14:55 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:31170 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jViQQ-0000nj-Sl for qemu-devel@nongnu.org; Mon, 04 May 2020 17:14:55 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-342-_fKDn3UZMj6_6hFppjCE3Q-1; Mon, 04 May 2020 17:14:51 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B4688464; Mon, 4 May 2020 21:14:50 +0000 (UTC) Received: from blue.redhat.com (ovpn-114-73.phx2.redhat.com [10.3.114.73]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8052A7052A; Mon, 4 May 2020 21:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588626893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EreIJQ4hJ/hcapIcvpXQICfb5MIGrsU9rUtkQuqOyIc=; b=Tb20N+whEQtuY+793W5mi8KConYRuD9RvIYa/4M2ubgmDzt7OHp9AQH1v90cJdTRkEmOf5 J2/VJSTJhWmruVISUWbkF4J6lfSXslBdJivtiNmwNxzLtm2Xk05brqDC5LVzxSZ5wMrLX3 5yOu9XhntIOTLXK7KZsXkqIeE8rsqpM= X-MC-Unique: _fKDn3UZMj6_6hFppjCE3Q-1 From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 2/4] iotests/041: Fix NBD socket path Date: Mon, 4 May 2020 16:14:36 -0500 Message-Id: <20200504211438.195926-3-eblake@redhat.com> In-Reply-To: <20200504211438.195926-1-eblake@redhat.com> References: <20200504211438.195926-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.61; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/04 01:21:32 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] 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, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: Elena Ufimtseva , Kevin Wolf , "open list:Block layer core" , Stefan Hajnoczi , Max Reitz 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" From: Max Reitz We should put all UNIX socket files into the sock_dir, not test_dir. Reported-by: Elena Ufimtseva Signed-off-by: Max Reitz Message-Id: <20200424134626.78945-1-mreitz@redhat.com> Reviewed-by: Eric Blake Fixes: a1da1878607a Reviewed-by: Stefan Hajnoczi Signed-off-by: Eric Blake --- tests/qemu-iotests/041 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index 5d67bf14bfe8..46bf1f6c8164 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -35,7 +35,7 @@ quorum_img3 =3D os.path.join(iotests.test_dir, 'quorum3.i= mg') quorum_repair_img =3D os.path.join(iotests.test_dir, 'quorum_repair.img') quorum_snapshot_file =3D os.path.join(iotests.test_dir, 'quorum_snapshot.i= mg') -nbd_sock_path =3D os.path.join(iotests.test_dir, 'nbd.sock') +nbd_sock_path =3D os.path.join(iotests.sock_dir, 'nbd.sock') class TestSingleDrive(iotests.QMPTestCase): image_len =3D 1 * 1024 * 1024 # MB --=20 2.26.2 From nobody Sun Oct 5 19:25:05 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1588627074; cv=none; d=zohomail.com; s=zohoarc; b=K/a+Ku7V18MT1HfmAj4EVH90tFu8WBV9WK0Rdx8FID8ZKadfcLH3s+uW8XV8XNsvT8SGJm13VFO1Ol9Rh49fPr7jLudL6xzmNMTSpQenlRIYyi1EJEK2vdil8mQySzobfElRuyTDKlHMFE1VzPsbs3fE859xatqoj5UCufMyEVE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588627074; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=31dqIqUDKnqlmZMDCenW/Ew7xptQt0PLlXwqQjzyVL0=; b=Lpt6mKB0m8Q0MSSKt8CKorRUPWBb/QQ00Zj/jQBR3cbIATnxyjaVINnq1G2Sb+fsFsM3qfEeadeZLyjeJozqosfLftUTIWvuldWoyltiV/voXxjXAArrcDcOOr4y/+cBm/1HPKpST+SahxbhJIeuePkYWBD1Tc77R2JgWJmVG4M= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588627074566204.42475149020493; Mon, 4 May 2020 14:17:54 -0700 (PDT) Received: from localhost ([::1]:59996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jViTJ-0006O0-AT for importer@patchew.org; Mon, 04 May 2020 17:17:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jViQU-0003wW-6E for qemu-devel@nongnu.org; Mon, 04 May 2020 17:14:58 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:50905 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jViQT-0000oy-GX for qemu-devel@nongnu.org; Mon, 04 May 2020 17:14:57 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-79-AszOWea5MvCv6YRiDZntbg-1; Mon, 04 May 2020 17:14:52 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5D7AB462; Mon, 4 May 2020 21:14:51 +0000 (UTC) Received: from blue.redhat.com (ovpn-114-73.phx2.redhat.com [10.3.114.73]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE5C36FF1B; Mon, 4 May 2020 21:14:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588626896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=31dqIqUDKnqlmZMDCenW/Ew7xptQt0PLlXwqQjzyVL0=; b=UBcEL043EBqCsJRhOItuP2CsreWMGdp1YLl5VwUoSrljYQRGRqMwN2hDOig4CeEhYlg0uN KsBHObXSURANJkaclgBDlvXq/AjRKbEEyzD2d9Fao48N/cmw7NzS2XUfCjmcUh+yRW3jNw 4vcE3N9AmiMurNu18lI6ROFDR+qawqQ= X-MC-Unique: AszOWea5MvCv6YRiDZntbg-1 From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 3/4] block/nbd-client: drop max_block restriction from block_status Date: Mon, 4 May 2020 16:14:37 -0500 Message-Id: <20200504211438.195926-4-eblake@redhat.com> In-Reply-To: <20200504211438.195926-1-eblake@redhat.com> References: <20200504211438.195926-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=207.211.31.81; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/04 16:03:08 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: Kevin Wolf , Vladimir Sementsov-Ogievskiy , "open list:Network Block Dev..." , Max Reitz 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" From: Vladimir Sementsov-Ogievskiy The NBD spec was updated (see nbd.git commit 9f30fedb) so that max_block doesn't relate to NBD_CMD_BLOCK_STATUS. So, drop the restriction. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Message-Id: <20200401150112.9557-2-vsementsov@virtuozzo.com> [eblake: tweak commit message to call out NBD commit] Signed-off-by: Eric Blake --- block/nbd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index 2160859f6499..d4d518a780c9 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1320,9 +1320,7 @@ static int coroutine_fn nbd_client_co_block_status( NBDRequest request =3D { .type =3D NBD_CMD_BLOCK_STATUS, .from =3D offset, - .len =3D MIN(MIN_NON_ZERO(QEMU_ALIGN_DOWN(INT_MAX, - bs->bl.request_alignment), - s->info.max_block), + .len =3D MIN(QEMU_ALIGN_DOWN(INT_MAX, bs->bl.request_alignment), MIN(bytes, s->info.size - offset)), .flags =3D NBD_CMD_FLAG_REQ_ONE, }; --=20 2.26.2 From nobody Sun Oct 5 19:25:05 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1588627386; cv=none; d=zohomail.com; s=zohoarc; b=UUi6K0/dH7mqM9N6d385HB2pkZEYZ3/fwbhBF4l+Ty/UXrmhYt53eyOt05zMk9gsF3w7OLWUPhKAqxWrolTHRW+P5IQ3R4o8w1HTvU17YiexoI+rBx4AI/Jq3D/eOE0PpnHDpX64qWr/Kn/4/8cBhl1Qg4QPRyVmuL1yP4jQRr0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588627386; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YyeVe7pGLDoxmKcIGHGJ1Xo7k60pAoX6pd3YEH7norA=; b=JX+bxiwBf0SZU+g5LquEsrUeHy73+mFic8VomGnEFMAP7mOfg55dpFq/z3H/4bdUX0B6EilyfRrAyuG+kPzWsWLjYqYd+wB9fmg2O3eHOQAlHxcrGZtH989Xt2APYbSBDeTgEIZkx9XrSrdxLjc7O39Hl+TqG/4QsgDaGLs61/A= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15886273868721.8752903929261038; Mon, 4 May 2020 14:23:06 -0700 (PDT) Received: from localhost ([::1]:41584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jViYL-0002No-GF for importer@patchew.org; Mon, 04 May 2020 17:23:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jViQU-0003xT-Hg for qemu-devel@nongnu.org; Mon, 04 May 2020 17:14:58 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:35373 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jViQT-0000pK-QW for qemu-devel@nongnu.org; Mon, 04 May 2020 17:14:58 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-6-kxpV4nuSPmmLXrV5_he0-Q-1; Mon, 04 May 2020 17:14:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 06980872FE0; Mon, 4 May 2020 21:14:52 +0000 (UTC) Received: from blue.redhat.com (ovpn-114-73.phx2.redhat.com [10.3.114.73]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8850170525; Mon, 4 May 2020 21:14:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588626897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YyeVe7pGLDoxmKcIGHGJ1Xo7k60pAoX6pd3YEH7norA=; b=c+QytrQwm/iZNf2yieYGy3cJ0ovz4X73St+j9V/DhCUejyPcP8bHEthz0vp9ek/6X4mlUW eInvKoAdz0li4BcEE/OGBGmFeVpIqLosIMuaW5nbZgn3z5112yNL9zbHBXXMlnqQOdG2TS qnZsOfC/FUj7zURGSQpT+Pk0Du39xqg= X-MC-Unique: kxpV4nuSPmmLXrV5_he0-Q-1 From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 4/4] block/nbd-client: drop max_block restriction from discard Date: Mon, 4 May 2020 16:14:38 -0500 Message-Id: <20200504211438.195926-5-eblake@redhat.com> In-Reply-To: <20200504211438.195926-1-eblake@redhat.com> References: <20200504211438.195926-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.120; envelope-from=eblake@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/04 04:24:57 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] 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, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: Kevin Wolf , Vladimir Sementsov-Ogievskiy , "open list:Network Block Dev..." , Max Reitz 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" From: Vladimir Sementsov-Ogievskiy The NBD spec was updated (see nbd.git commit 9f30fedb) so that max_block doesn't relate to NBD_CMD_TRIM. So, drop the restriction. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20200401150112.9557-3-vsementsov@virtuozzo.com> Reviewed-by: Eric Blake [eblake: tweak commit message to call out NBD commit] Signed-off-by: Eric Blake --- block/nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nbd.c b/block/nbd.c index d4d518a780c9..4ac23c8f6299 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1955,7 +1955,7 @@ static void nbd_refresh_limits(BlockDriverState *bs, = Error **errp) } bs->bl.request_alignment =3D min; - bs->bl.max_pdiscard =3D max; + bs->bl.max_pdiscard =3D QEMU_ALIGN_DOWN(INT_MAX, min); bs->bl.max_pwrite_zeroes =3D max; bs->bl.max_transfer =3D max; --=20 2.26.2