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=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 C91BDC433E1 for ; Wed, 17 Jun 2020 11:28:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D9E220CC7 for ; Wed, 17 Jun 2020 11:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592393298; bh=uMUZtfAmMrhJAMLssv8rVjKEsFdEfwWGE0KmDSJhEVk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=v5/jZdLaF/8SZU/bF3D+PbXXagnH9CDDVSr9LOuv1o+hYdDe9Z8Nu+LgQlEzN2vZd lkjpAtmnYXjAQB7w1wAaSau5amAXixFA79FsGBAQfWTU8r5vBCw/HwvNECGeRJzGe8 BxjSKogj2i3//xUkbf7/h3+45cHdJYeFOnRf5Siw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726494AbgFQL2Q (ORCPT ); Wed, 17 Jun 2020 07:28:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:50466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbgFQL2Q (ORCPT ); Wed, 17 Jun 2020 07:28:16 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A74E620CC7; Wed, 17 Jun 2020 11:28:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592393295; bh=uMUZtfAmMrhJAMLssv8rVjKEsFdEfwWGE0KmDSJhEVk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Rt0fZJ7CclIEeHetVWCKpS0DwLEW/RxYBD8ARjNXAmK/ontpPUlNt0F9GIlorUJkg O71hjLOkOhNitALg+hnC5m7huitZIqvP0mOE2MxAeSGcOJQbnQTvQtu4zTFI6/SC45 88mNuj8pVwECX3MZky9O7jsBaPVZYkDZDZCd41tk= Date: Wed, 17 Jun 2020 14:28:11 +0300 From: Leon Romanovsky To: haris.iqbal@cloud.ionos.com Cc: linux-block@vger.kernel.org, linux-rdma@vger.kernel.org, danil.kipnis@cloud.ionos.com, jinpu.wang@cloud.ionos.com, dledford@redhat.com, jgg@ziepe.ca, kernel test robot Subject: Re: [PATCH] Delay the initialization of rnbd_server module to late_initcall level Message-ID: <20200617112811.GL2383158@unreal> References: <20200617103732.10356-1-haris.iqbal@cloud.ionos.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200617103732.10356-1-haris.iqbal@cloud.ionos.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Wed, Jun 17, 2020 at 04:07:32PM +0530, haris.iqbal@cloud.ionos.com wrote: > From: Md Haris Iqbal > > Fixes: 2de6c8de192b ("block/rnbd: server: main functionality") > Reported-by: kernel test robot > Signed-off-by: Md Haris Iqbal > > The rnbd_server module's communication manager initialization depends on the > registration of the "network namespace subsystem" of the RDMA CM agent module. > As such, when the kernel is configured to load the rnbd_server and the RDMA > cma module during initialization; and if the rnbd_server module is initialized > before RDMA cma module, a null ptr dereference occurs during the RDMA bind > operation. > This patch delays the initialization of the rnbd_server module to the > late_initcall level, since RDMA cma module uses module_init which puts it into > the device_initcall level. > --- > drivers/block/rnbd/rnbd-srv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c > index 86e61523907b..213df05e5994 100644 > --- a/drivers/block/rnbd/rnbd-srv.c > +++ b/drivers/block/rnbd/rnbd-srv.c > @@ -840,5 +840,5 @@ static void __exit rnbd_srv_cleanup_module(void) > rnbd_srv_destroy_sysfs_files(); > } > > -module_init(rnbd_srv_init_module); > +late_initcall(rnbd_srv_init_module); I don't think that this is correct change. Somehow nvme-rdma works: module_init(nvme_rdma_init_module); -> nvme_rdma_init_module -> nvmf_register_transport(&nvme_rdma_transport); -> nvme_rdma_create_ctrl -> nvme_rdma_setup_ctrl -> nvme_rdma_configure_admin_queue -> nvme_rdma_alloc_queue -> rdma_create_id > module_exit(rnbd_srv_cleanup_module); > -- > 2.25.1 >