Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754668Ab2KHAB2 (ORCPT ); Wed, 7 Nov 2012 19:01:28 -0500 Received: from ozlabs.org ([203.10.76.45]:40453 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753637Ab2KHABW convert rfc822-to-8bit (ORCPT ); Wed, 7 Nov 2012 19:01:22 -0500 From: Rusty Russell To: sjur.brandeland@stericsson.com, Amit Shah Cc: "Michael S. Tsirkin" , Masami Hiramatsu , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, sjur@brendeland.net, Sjur =?utf-8?Q?Br=C3=A6ndeland?= Subject: Re: [PATCH resend] virtio_console: Free buffers from out-queue upon close In-Reply-To: <1352295822-22906-1-git-send-email-sjur.brandeland@stericsson.com> References: <1350287856-5284-1-git-send-email-sjur.brandeland@stericsson.com> <1350287856-5284-5-git-send-email-sjur.brandeland@stericsson.com> <878vayhsca.fsf@rustcorp.com.au> <20121101073951.GA17012@amit.redhat.com> <87r4oc52ov.fsf@rustcorp.com.au> <20121102102047.GE10483@amit.redhat.com> <81C3A93C17462B4BBD7E272753C1057923BE98E5C6@EXDCVYMBSTM005.EQ1STM.local> <1352298171-21869-1-git-send-email-sjur.brandeland@stericsson.com> <1352295822-22906-1-git-send-email-sjur.brandeland@stericsson.com> User-Agent: Notmuch/0.14 (http://notmuchmail.org) Emacs/23.4.1 (i686-pc-linux-gnu) Date: Thu, 08 Nov 2012 10:28:53 +1030 Message-ID: <87sj8l2cea.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1086 Lines: 34 sjur.brandeland@stericsson.com writes: > From: Sjur Brændeland > > Free pending output buffers from the virtio out-queue when > host has acknowledged port_close. Also removed WARN_ON() > in remove_port_data(). > > Signed-off-by: Sjur Brændeland > --- > > Resending, this time including a proper "Subject"... > -- > > Hi Amit, > > Note: This patch is compile tested only. I have done the removal > of buffers from out-queue in handle_control_message() > when host has acked the close request. This seems less > racy than doing it in the release function. This confuses me... why are we doing this in case VIRTIO_CONSOLE_PORT_OPEN:? We can't pull unconsumed buffers out of the ring when the other side may still access it, and this seems to be doing that. Thanks, Rusty. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/