Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751735Ab2KHJZq (ORCPT ); Thu, 8 Nov 2012 04:25:46 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:35072 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751184Ab2KHJZo (ORCPT ); Thu, 8 Nov 2012 04:25:44 -0500 MIME-Version: 1.0 In-Reply-To: <20121108085913.GA31962@amit.redhat.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> <87sj8l2cea.fsf@rustcorp.com.au> <20121108085913.GA31962@amit.redhat.com> Date: Thu, 8 Nov 2012 10:25:43 +0100 Message-ID: Subject: Re: [PATCH resend] virtio_console: Free buffers from out-queue upon close From: =?UTF-8?Q?Sjur_Br=C3=A6ndeland?= To: Amit Shah Cc: Rusty Russell , "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Masami Hiramatsu Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1057 Lines: 31 >> > 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. > > Yes -- and it's my fault; I asked Sjur to do that in the close fops > function. Thanks Amit :-), but this was really my bad. > We should only do this in the port remove case (unplug or device > remove) -- so the original patch, with just the WARN_ON removed is the > right way. > > I'll send the revised 3/3 patch for you. Thank you. Regards, Sjur -- 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/