Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C561C433EF for ; Wed, 17 Nov 2021 20:41:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8816661A07 for ; Wed, 17 Nov 2021 20:41:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8816661A07 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:57454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnRki-00040p-7n for qemu-devel@archiver.kernel.org; Wed, 17 Nov 2021 15:41:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnRjI-0002RZ-Nd for qemu-devel@nongnu.org; Wed, 17 Nov 2021 15:40:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:22718) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnRjF-0007ZS-Pi for qemu-devel@nongnu.org; Wed, 17 Nov 2021 15:40:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637181624; 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: in-reply-to:in-reply-to:references:references; bh=TVdXCR7Z/YsZlPH1Zz55p2Gnx82x1ivwPRHo0VIW0sw=; b=bwxgkanphMdU6rapuMX5ZG2WuLviBV73165nyLs74/7rmeHie3dMAZrZOX0C5f1lhGZwP/ kEJ4QcK3NhcdvU1+gpasucNUBQpA7yUBSEaLq6ERg9kziOTkxGgz1qnuTVCdlHN0fCHm3Q qfo/ODInAreS05c+3lCWPvBrxT37ca8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-213-poyUaqCuPQ6xHg7OWKy7_Q-1; Wed, 17 Nov 2021 15:40:21 -0500 X-MC-Unique: poyUaqCuPQ6xHg7OWKy7_Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 03772CC621; Wed, 17 Nov 2021 20:40:20 +0000 (UTC) Received: from redhat.com (ovpn-114-146.phx2.redhat.com [10.3.114.146]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 34CEA10023AB; Wed, 17 Nov 2021 20:40:18 +0000 (UTC) Date: Wed, 17 Nov 2021 14:40:17 -0600 From: Eric Blake To: Vladimir Sementsov-Ogievskiy Subject: Re: [PATCH for-6.2 1/2] nbd/server: Don't complain on certain client disconnects Message-ID: <20211117204017.nvzbm4nys7brzfe7@redhat.com> References: <20211117170230.1128262-1-eblake@redhat.com> <20211117170230.1128262-2-eblake@redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20211029-16-b680fe X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eblake@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: pass client-ip=170.10.129.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.701, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: , Cc: qemu-stable@nongnu.org, qemu-devel@nongnu.org, qemu-block@nongnu.org, rjones@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Wed, Nov 17, 2021 at 08:57:35PM +0300, Vladimir Sementsov-Ogievskiy wrote: > 17.11.2021 20:02, Eric Blake wrote: > > This patch fixes things to avoid uninitialized memory, and in general > > avoids warning about a client that does a hard shutdown when not in > > the middle of a packet. A client that aborts mid-request, or which > > does not read the full server's reply, can still result in warnings, > > but those are indeed much more unusual situations. > > > > CC: qemu-stable@nongnu.org > > Fixes: f148ae7d36 (nbd/server: Quiesce coroutines on context switch) > > Signed-off-by: Eric Blake > > --- > > nbd/server.c | 7 +++++-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/nbd/server.c b/nbd/server.c > > index d9164ee6d0da..85877f630533 100644 > > --- a/nbd/server.c > > +++ b/nbd/server.c > > @@ -1418,6 +1418,9 @@ static int nbd_receive_request(NBDClient *client, NBDRequest *request, > > if (ret < 0) { > > return ret; > > } > > + if (ret == 0) { > > + return -EIO; > > + } > > Reviewed-by: Vladimir Sementsov-Ogievskiy > > I'd prefer not include following hunks to the patch, as they are unrelated. > > > > > /* Request > > [ 0 .. 3] magic (NBD_REQUEST_MAGIC) > > @@ -2285,7 +2288,7 @@ static int nbd_co_receive_request(NBDRequestData *req, NBDRequest *request, > > assert(client->recv_coroutine == qemu_coroutine_self()); > > ret = nbd_receive_request(client, request, errp); > > if (ret < 0) { > > - return ret; > > + return ret; > > } > > > > trace_nbd_co_receive_request_decode_type(request->handle, request->type, > > @@ -2662,7 +2665,7 @@ static coroutine_fn void nbd_trip(void *opaque) > > } > > > > if (ret < 0) { > > - /* It wans't -EIO, so, according to nbd_co_receive_request() > > + /* It wasn't -EIO, so, according to nbd_co_receive_request() Yeah, they were typo fixes I noticed while investigating the code; I should have either called them out in the commit message, or as you say, split them into a separate trivial patch (in which case they aren't urgent for 6.2). I'm happy to do the latter, since I'm working on more patches for qemu 7.0 to add a new NBD protocol extension NBD_OPT_EXTENDED_HEADERS to expose your work on 64-bit write-zero support end-to-end. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org