Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262606AbUKQWMS (ORCPT ); Wed, 17 Nov 2004 17:12:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262602AbUKQWJN (ORCPT ); Wed, 17 Nov 2004 17:09:13 -0500 Received: from ozlabs.org ([203.10.76.45]:17047 "EHLO ozlabs.org") by vger.kernel.org with ESMTP id S262606AbUKQWHu (ORCPT ); Wed, 17 Nov 2004 17:07:50 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16795.52144.648958.233683@cargo.ozlabs.ibm.com> Date: Thu, 18 Nov 2004 09:07:44 +1100 From: Paul Mackerras To: Ravikiran G Thirumalai Cc: Al Viro , linux-kernel@vger.kernel.org, Andrew Morton , Kai Makisara , Willem Riede , coda@cs.cmu.edu Subject: Re: [patch 0/4] Cleanup file_count usage In-Reply-To: <20041117165021.GC3152@impedimenta.in.ibm.com> References: <20041116135200.GA23257@impedimenta.in.ibm.com> <16794.32730.184008.344036@cargo.ozlabs.ibm.com> <20041117165021.GC3152@impedimenta.in.ibm.com> X-Mailer: VM 7.18 under Emacs 21.3.1 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1238 Lines: 27 Ravikiran G Thirumalai writes: > How about this patch? This doesn't leak memory hopefully. > > --- > Patch to cleanup reads to f_count from ppp driver, deprecate PPPIOCDETACH > ioctl, and print warning messages if the ioctl is used. > > A new 'detached' field is included in struct ppp_file, and the ppp > channel/interface is marked as detached when PPPIOCDETACH is invoked > instead of checking the f_count and failing the ioctl for 'if the fd was > dup'd' case. The ppp structure is freed on last close. The difficulty comes when pppd does a PPPIOCNEWUNIT, a PPPIOCDETACH, and another PPPIOCNEWUNIT. To test that, you would need to use ppp-2.4.0 or ppp-2.4.1 and use the persist option to pppd. Make one connection and then terminate it (unplug the modem, or use the idle option to pppd). Pppd should then try to reestablish the connection. The question is whether the second connection attempt succeeds or not. I think that with your patch it won't (from a quick look). Paul. - 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/