From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755277Ab2A0Ost (ORCPT ); Fri, 27 Jan 2012 09:48:49 -0500 Received: from eu1sys200aog105.obsmtp.com ([207.126.144.119]:39473 "EHLO eu1sys200aog105.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752017Ab2A0Osr convert rfc822-to-8bit (ORCPT ); Fri, 27 Jan 2012 09:48:47 -0500 From: Sjur BRENDELAND To: Sasha Levin , "Eric W. Biederman" Cc: David Miller , "eric.dumazet@gmail.com" , "xemul@parallels.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "davej@redhat.com" , "sjurbren@gmail.com" Date: Fri, 27 Jan 2012 15:48:00 +0100 Subject: RE: [PATCH 2/2] net caif: Register properly as a pernet subsystem. Thread-Topic: [PATCH 2/2] net caif: Register properly as a pernet subsystem. Thread-Index: Aczc9wGNCNDbquJ2Tu2VvKzx5rX0xgACvAoA Message-ID: <81C3A93C17462B4BBD7E272753C105791FB48AD1FB@EXDCVYMBSTM005.EQ1STM.local> References: <4F212E7E.2040801@parallels.com> <1327575108.2500.24.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <20120126.180754.679593869814492219.davem@davemloft.net> <1327670668.14789.4.camel@lappy> In-Reply-To: <1327670668.14789.4.camel@lappy> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > caif is a subsystem and as such it needs to register with > > register_pernet_subsys instead of register_pernet_device. > > > > Among other problems using register_pernet_device was resulting in > > net_generic being called before the caif_net structure was allocated. > > Which has been causing net_generic to fail with either BUG_ON's or by > > return NULL pointers. > > > > A more ugly problem that could be caused is packets in flight why the > > subsystem is shutting down. > > > > To remove confusion also remove the cruft cause by inappropriately > > trying to fix this bug. > > > > With the aid of the previous patch I have tested this patch and > > confirmed that using register_pernet_subsys makes the failure go away > > as it should. > > > > Signed-off-by: Eric W. Biederman > > I've tested these two patches as well, and they also work for me. > > Tested-by: Sasha Levin This looks very good to me, thank you Eric. Acked-by: Sjur Brændeland