From patchwork Thu Dec 12 12:32:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangweidong X-Patchwork-Id: 300621 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D5B1B2C00A7 for ; Thu, 12 Dec 2013 23:33:36 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751617Ab3LLMdU (ORCPT ); Thu, 12 Dec 2013 07:33:20 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:18291 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751683Ab3LLMdM (ORCPT ); Thu, 12 Dec 2013 07:33:12 -0500 Received: from 172.24.2.119 (EHLO szxeml212-edg.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id AHP32744; Thu, 12 Dec 2013 20:32:48 +0800 (CST) Received: from SZXEML452-HUB.china.huawei.com (10.82.67.195) by szxeml212-edg.china.huawei.com (172.24.2.181) with Microsoft SMTP Server (TLS) id 14.3.158.1; Thu, 12 Dec 2013 20:32:47 +0800 Received: from [127.0.0.1] (10.135.68.79) by szxeml452-hub.china.huawei.com (10.82.67.195) with Microsoft SMTP Server id 14.3.158.1; Thu, 12 Dec 2013 20:32:43 +0800 Message-ID: <52A9ACE4.3080506@huawei.com> Date: Thu, 12 Dec 2013 20:32:36 +0800 From: Wang Weidong User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Vlad Yasevich , Neil Horman , David Miller CC: , Subject: [PATCH] sctp: loading sctp when load sctp_probe X-Originating-IP: [10.135.68.79] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org when I modprobe sctp_probe, it failed with "FATAL: ". I found that sctp should load before sctp_probe register jprobe. So I add a sctp_setup_jprobe for loading 'sctp' when first failed to register jprobe, just do this similar to dccp_probe. Signed-off-by: Wang Weidong --- net/sctp/probe.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/net/sctp/probe.c b/net/sctp/probe.c index 53c452e..cd9565a 100644 --- a/net/sctp/probe.c +++ b/net/sctp/probe.c @@ -182,6 +182,17 @@ static struct jprobe sctp_recv_probe = { .entry = jsctp_sf_eat_sack, }; +static __init int sctp_setup_jprobe(void) +{ + int ret = register_jprobe(&sctp_recv_probe); + + if (ret) { + request_module("sctp"); + ret = register_jprobe(&sctp_recv_probe); + } + return ret; +} + static __init int sctpprobe_init(void) { int ret = -ENOMEM; @@ -202,7 +213,7 @@ static __init int sctpprobe_init(void) &sctpprobe_fops)) goto free_kfifo; - ret = register_jprobe(&sctp_recv_probe); + ret = sctp_setup_jprobe(); if (ret) goto remove_proc;