From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35A9CC04AB4 for ; Fri, 17 May 2019 18:41:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0465C2053B for ; Fri, 17 May 2019 18:41:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728520AbfEQSlQ (ORCPT ); Fri, 17 May 2019 14:41:16 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:46306 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726740AbfEQSlQ (ORCPT ); Fri, 17 May 2019 14:41:16 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::3d8]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 4710F13F18517; Fri, 17 May 2019 11:41:15 -0700 (PDT) Date: Fri, 17 May 2019 11:41:14 -0700 (PDT) Message-Id: <20190517.114114.617879749254144661.davem@davemloft.net> To: hujunwei4@huawei.com Cc: jon.maloy@ericsson.com, ying.xue@windriver.com, netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org, mingfangsen@huawei.com, zhoukang7@huawei.com, mousuanming@huawei.com Subject: Re: [PATCH] tipc: fix modprobe tipc failed after switch order of device registration From: David Miller In-Reply-To: References: X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 17 May 2019 11:41:15 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: hujunwei Date: Fri, 17 May 2019 19:27:34 +0800 > From: Junwei Hu > > Error message printed: > modprobe: ERROR: could not insert 'tipc': Address family not > supported by protocol. > when modprobe tipc after the following patch: switch order of > device registration, commit 7e27e8d6130c > ("tipc: switch order of device registration to fix a crash") > > Because sock_create_kern(net, AF_TIPC, ...) is called by > tipc_topsrv_create_listener() in the initialization process > of tipc_net_ops, tipc_socket_init() must be execute before that. > > I move tipc_socket_init() into function tipc_init_net(). > > Fixes: 7e27e8d6130c > ("tipc: switch order of device registration to fix a crash") > Signed-off-by: Junwei Hu > Reported-by: Wang Wang > Reviewed-by: Kang Zhou > Reviewed-by: Suanming Mou Applied.