Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp551647pxb; Mon, 8 Nov 2021 18:28:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJylU9++WvHD2QscFPC1k0YyI84Xlosr9vWTh1zmUowO6E/zFv4+QVrIh/DaWB+fF62nUj7C X-Received: by 2002:a05:6e02:12ce:: with SMTP id i14mr2733639ilm.45.1636424887778; Mon, 08 Nov 2021 18:28:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636424887; cv=none; d=google.com; s=arc-20160816; b=pGMBTD7d5uFO20TAxwiWkQjcV/H2t5NB9xL5kIrbNXVnzVXTcLO8xtceWKyC5nvxi1 O+inaPCGEgOzpkh0qn+hJQ/0fk71cg/knsGzJ95c5QLDP/xgk1M1MAuIK4urTZqEqLvM wsk7tcpQUDBTwIEkLNYGF5jJNIYEVMduDZIcc0T29j/RObiudPzH+NpRQgoC53PhudrA q7fEEI/aQ+wI1C2Z9cV4S2UNYUZMsZQz3dfOC3hDtt59z6bQt+EdTZqhkOlaPNuclSak xWNkMjOyiV3HTVElk2f9sXokaNgeQEnu4dT8UKIGewNQcpwzsrVHWn30/91pDEBhlZrw eTBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:jabber-id:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=z00A43K3LCe5IH/2fEoUqJj7f2Dd16xMECNnuAExluI=; b=tOXRiHkhuKJ0j50pcvtvPvS0L5hhgZgdZqbqp2YvE3VkMp9SNzgucu07npSLY5t5Sn JVRrB2TFND8BxZ637G4IUpkoDx01f+ZMmwFaTV4MyGF83kpZmns+VY/Ucamdo2ZOF4H1 pL7y/BE5XAKOFS5fHYfaqmEBsbNgfD7NNpHSBNnI6VGq5cb/bF6bvGZoDc39SYFhrO33 1XomKVIF4CTylFEBQzeQS5GmOjW3tBaK9qSRZphro+QzatyFfd8YqU2xdUIGV2i4C6R8 76uLgyVv/nEcVO/a0Ky4WV4tefvXd8yoY3heVWtdW/SRzMAT3yYsC8vHEv01Lq0iouix 3B3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b="ATxD+/7N"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n10si1404791ioz.37.2021.11.08.18.27.53; Mon, 08 Nov 2021 18:28:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b="ATxD+/7N"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236124AbhKHSxY (ORCPT + 99 others); Mon, 8 Nov 2021 13:53:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236093AbhKHSxX (ORCPT ); Mon, 8 Nov 2021 13:53:23 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF233C061570; Mon, 8 Nov 2021 10:50:38 -0800 (PST) Date: Mon, 8 Nov 2021 19:50:34 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1636397436; bh=L6MFlY7fncI7DTAhySExlSyQ36N0y6PwyRwcayAnt6s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ATxD+/7NQrBK6w98+St8hye1dyDqJ/XVefzz3A+E4wsY/9IPnPcEuie7Bx8TdpWPk 4J+viPttbySzEI1AQl+GCBK8rdPh9ml/P3cCzMXsdQE5e1rtNKA2oja7w51XSXuTau 3SrTnH6BZR2VbxLua9Vr1Ycbxmyv6lrMv4SP2qXU= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Dominique Martinet Cc: v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org, Eric Van Hensbergen , Latchesar Ionkov , "David S. Miller" , Jakub Kicinski , Stefano Stabellini , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/4] net/p9: load default transports Message-ID: References: <20211103193823.111007-1-linux@weissschuh.net> <20211103193823.111007-5-linux@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211103193823.111007-5-linux@weissschuh.net> Jabber-ID: thomas@t-8ch.de X-Accept: text/plain, text/html;q=0.2, text/*;q=0.1 X-Accept-Language: en-us, en;q=0.8, de-de;q=0.7, de;q=0.6 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dominique, On 2021-11-03 20:38+0100, Thomas Weißschuh wrote: > Now that all transports are split into modules it may happen that no > transports are registered when v9fs_get_default_trans() is called. > When that is the case try to load more transports from modules. > > Signed-off-by: Thomas Weißschuh > --- > net/9p/mod.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/net/9p/mod.c b/net/9p/mod.c > index 8f1d067b272e..7bb875cd279f 100644 > --- a/net/9p/mod.c > +++ b/net/9p/mod.c > @@ -128,6 +128,10 @@ struct p9_trans_module *v9fs_get_trans_by_name(const char *s) > } > EXPORT_SYMBOL(v9fs_get_trans_by_name); > > +static const char * const v9fs_default_transports[] = { > + "virtio", "tcp", "fd", "unix", "xen", "rdma", > +}; > + > /** > * v9fs_get_default_trans - get the default transport > * > @@ -136,6 +140,7 @@ EXPORT_SYMBOL(v9fs_get_trans_by_name); > struct p9_trans_module *v9fs_get_default_trans(void) > { > struct p9_trans_module *t, *found = NULL; > + int i; > > spin_lock(&v9fs_trans_lock); > > @@ -153,6 +158,10 @@ struct p9_trans_module *v9fs_get_default_trans(void) > } > > spin_unlock(&v9fs_trans_lock); > + > + for (i = 0; !found && i < ARRAY_SIZE(v9fs_default_transports); i++) > + found = v9fs_get_trans_by_name(v9fs_default_transports[i]); > + > return found; > } > EXPORT_SYMBOL(v9fs_get_default_trans); > -- > 2.33.1 I did not notice that you already had applied "net/9p: autoload transport modules" to your tree when sending this series. Please note that in this series I modified patch 1 a bit, from the ony you applied, to prevent warnings in patch 4. Concretely I modified the prototypes of `v9fs_get_trans_by_name()` and `_p9_get_trans_by_name()` to take const parameters. Feel free to roll those changes into this patch when applying or I can resend the patch/series. Thomas