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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 041C9C43334 for ; Tue, 14 Jun 2022 08:42:04 +0000 (UTC) Received: from localhost ([::1]:50174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o127f-00080n-25 for qemu-devel@archiver.kernel.org; Tue, 14 Jun 2022 04:42:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o124U-0006F8-4S for qemu-devel@nongnu.org; Tue, 14 Jun 2022 04:38:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:46984) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o124S-00070L-1U for qemu-devel@nongnu.org; Tue, 14 Jun 2022 04:38:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655195923; h=from:from:reply-to: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=mBsOW3HkS6y7KAFsi3tagG3UEL+UNkesaCMPyjtL10o=; b=LHlFub770cPyYSUtGreKDkRtn+5VwLvtxKUgldqxjKpk60gNRFqy6Ih0cvrmryvkBW0aDD 6wYWwYkkOTk+fU0E3kkqpIj/a4t6hRgcNOHWYiqg4Jm+IKqkSkVcrE5gCq3ijKqN8EVmhN YGXB3yEIGa+9ln3YdaaqqaWn0fg3e4Y= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-439-jKiuODSbPqK7ZYH_vCcC0A-1; Tue, 14 Jun 2022 04:38:40 -0400 X-MC-Unique: jKiuODSbPqK7ZYH_vCcC0A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C3AC818E6C41; Tue, 14 Jun 2022 08:38:39 +0000 (UTC) Received: from redhat.com (unknown [10.33.36.137]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 636D940CF8E5; Tue, 14 Jun 2022 08:38:38 +0000 (UTC) Date: Tue, 14 Jun 2022 09:38:36 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: Leonardo Bras Cc: Peter Xu , =?utf-8?B?5b6Q6Zev?= , David Gilbert , Juan Quintela , qemu-devel@nongnu.org Subject: Re: [PATCH v3 2/2] QIOChannelSocket: Fix zero-copy send so socket flush works Message-ID: References: <20220614051725.143985-1-leobras@redhat.com> <20220614051725.143985-2-leobras@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220614051725.143985-2-leobras@redhat.com> User-Agent: Mutt/2.2.1 (2022-02-19) X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, Jun 14, 2022 at 02:17:26AM -0300, Leonardo Bras wrote: > Somewhere between v6 and v7 the of the zero-copy-send patchset a crucial > part of the flushing mechanism got missing: incrementing zero_copy_queued. > > Without that, the flushing interface becomes a no-op, and there is no > guarantee the buffer is really sent. > > This can go as bad as causing a corruption in RAM during migration. > > Fixes: 2bc58ffc2926 ("QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX") > Reported-by: 徐闯 > Signed-off-by: Leonardo Bras > --- > io/channel-socket.c | 5 +++++ > 1 file changed, 5 insertions(+) Reviewed-by: Daniel P. Berrangé With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|