Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp15721259rwd; Sun, 25 Jun 2023 23:52:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IuXPjbllazTK2iNlKHxF/P0GHMLX4HLXVBRB8YTXLXFxZBy9GQTofJ76Qh6oGQQlH+Bf6 X-Received: by 2002:aa7:c754:0:b0:51d:7d5c:f686 with SMTP id c20-20020aa7c754000000b0051d7d5cf686mr3922147eds.0.1687762340811; Sun, 25 Jun 2023 23:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687762340; cv=none; d=google.com; s=arc-20160816; b=lUIVxbQo/EFqD9xk57XbocXcWfPdCfIdkyj0cyT3BtzC+5ctFlqGZdKREqpKG4elge HycqCB04rLiZ4sKof7x0Foa9KSXgo/wcX8yW2tc++57G23dy2E91ZHWKWcDaRFLkw075 7oXnEN+2Xd0BAmnyEFp7XKWMSNEE9WKtC0Iwe7pLURoBRRnwU47hAaC/rcoeHhRCs5Th uqLA0GSTtTmfdPAQflF07ICKecxrr2yVT1Ngz3bUfzi6W1j1Eh2dhUmk/2yaoQYgdUb1 Q5ufuNe9s2ekoRTAy1ILVhyBIV5sR6stCRQAibEukduyl8PzYaJ17CyqpMUEuNKeVJs7 zj5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XNWl6Pzm/j30XrxXgNItHbHgg8wHh7AL8v8n4+xlhJQ=; fh=5AjknOF2LJvSaw5BplOC5HTCEH6MKv/jBvg4EJH29DM=; b=qG2WOi0EtROnfUb3CyKsD+Lhksiw+DC6GBx22VFQX5JH+biWvdiT+dKhqbxOpd/t9h fr1ukhq9sUj7sx2etLkdkW8rTIAp/HKlh9kMYOz/TCBUSPQSzbQjvpv0DUZMwGu5F/Wh 7pE6Y8fKbW8cyw8HlSX7fhOJ7+Pod4IAJ3UAk/3lj2JE4KvlyDj+6IpnjPpJZa3CmsE6 sChyM4MlZD7xiEMDgzTbGXZmM7e5WRiO0X8wh2XVYCFqOcMJzFpcoqlxgctP6NRpxn01 vK19VjowODQpcwE7gRlen5RhUVlRK9LaCxTtEne8qfzZxps5100fhi2Bx6wijKndpsWA iImQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="hmkF/rPX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z3-20020a50eb43000000b0051a4e8b625fsi2468942edp.273.2023.06.25.23.51.56; Sun, 25 Jun 2023 23:52:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="hmkF/rPX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230161AbjFZGOD (ORCPT + 99 others); Mon, 26 Jun 2023 02:14:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbjFZGN5 (ORCPT ); Mon, 26 Jun 2023 02:13:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0356CE66; Sun, 25 Jun 2023 23:13:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8B91660C8B; Mon, 26 Jun 2023 06:13:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9042CC433C0; Mon, 26 Jun 2023 06:13:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1687760033; bh=54PtTxWRzFP0itf/Mt4orIihn+z6G/UUgX7hBydsugs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hmkF/rPXG9eQj6OGjBFN4dFWFRcGsMKk0gm++h01AQ/avdwPb7yyG7aAnZx4fxs4R KDaN0TuRCZzzP+HRruBhFjaSiP7Ds3xczQgS7QM5aiNtvGmBdrG6Huo0cjY/Qv1hIx Z/CWyZmFWGASwSNFUgySHcrRxqySr3BKpPtgT9vg= Date: Mon, 26 Jun 2023 08:13:49 +0200 From: Greg KH To: Shyam Prasad N Cc: Rishabh Bhatnagar , pc@cjr.nz, stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cifs@vger.kernel.org, Aurelien Aptel , Steve French Subject: Re: [PATCH 5.4 3/5] cifs: Introduce helpers for finding TCP connection Message-ID: <2023062626-bless-cytoplast-a147@gregkh> References: <20230623213406.5596-1-risbhat@amazon.com> <20230623213406.5596-4-risbhat@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 26, 2023 at 11:34:44AM +0530, Shyam Prasad N wrote: > On Sat, Jun 24, 2023 at 3:14 AM Rishabh Bhatnagar wrote: > > > > From: "Paulo Alcantara (SUSE)" > > > > commit 345c1a4a9e09dc5842b7bbb6728a77910db69c52 upstream. > > > > Add helpers for finding TCP connections that are good candidates for > > being used by DFS refresh worker. > > > > Signed-off-by: Paulo Alcantara (SUSE) > > Reviewed-by: Aurelien Aptel > > Signed-off-by: Steve French > > Signed-off-by: Rishabh Bhatnagar > > --- > > fs/cifs/dfs_cache.c | 44 +++++++++++++++++++++++++++++++------------- > > 1 file changed, 31 insertions(+), 13 deletions(-) > > > > diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c > > index 3ca65051b55c..31b3dc09e109 100644 > > --- a/fs/cifs/dfs_cache.c > > +++ b/fs/cifs/dfs_cache.c > > @@ -1305,6 +1305,30 @@ static char *get_dfs_root(const char *path) > > return npath; > > } > > > > +static inline void put_tcp_server(struct TCP_Server_Info *server) > > +{ > > + cifs_put_tcp_session(server, 0); > > +} > > + > > +static struct TCP_Server_Info *get_tcp_server(struct smb_vol *vol) > > +{ > > + struct TCP_Server_Info *server; > > + > > + server = cifs_find_tcp_session(vol); > > + if (IS_ERR_OR_NULL(server)) > > + return NULL; > > + > > + spin_lock(&GlobalMid_Lock); > > + if (server->tcpStatus != CifsGood) { > > + spin_unlock(&GlobalMid_Lock); > > + put_tcp_server(server); > > + return NULL; > > + } > > + spin_unlock(&GlobalMid_Lock); > > We've moved away from using GlobalMid_Lock for anything other than MIDs. > Please use server->srv_lock instead. This is just a backport of a commit that showed up in the 5.6 release. It's not new development. thanks, greg k-h