linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@cjr.nz>
To: linux-cifs@vger.kernel.org, smfrench@gmail.com
Cc: Paulo Alcantara <pc@cjr.nz>
Subject: [PATCH 3/3] cifs: fix find_root_ses() when refresing dfs cache
Date: Tue, 11 May 2021 13:36:09 -0300	[thread overview]
Message-ID: <20210511163609.11019-4-pc@cjr.nz> (raw)
In-Reply-To: <20210511163609.11019-1-pc@cjr.nz>

get_tcp_server() and cifs_get_smb_ses() require most of the fs context
info in order to find the respective tcp and ses pointers, so before
calling them, dup original fs context and set new unc path with
cifs_setup_volume_info().

Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
---
 fs/cifs/dfs_cache.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c
index 5c3129d4af1d..972aba397fdb 100644
--- a/fs/cifs/dfs_cache.c
+++ b/fs/cifs/dfs_cache.c
@@ -1430,6 +1430,12 @@ static struct cifs_ses *find_root_ses(struct vol_info *vi,
 	if (IS_ERR(rpath))
 		return ERR_CAST(rpath);
 
+	rc = smb3_fs_context_dup(&ctx, &vi->ctx);
+	if (rc) {
+		ses = ERR_PTR(rc);
+		goto out;
+	}
+
 	down_read(&htable_rw_lock);
 
 	ce = lookup_cache_entry(rpath, NULL);
-- 
2.31.1


      parent reply	other threads:[~2021-05-11 16:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 16:36 [PATCH 0/3] Support multiple ips per hostname Paulo Alcantara
2021-05-11 16:36 ` [PATCH 1/3] cifs: introduce smb3_options_for_each() helper Paulo Alcantara
2021-05-11 18:15   ` kernel test robot
2021-05-11 16:36 ` [PATCH 2/3] cifs: handle multiple ip addresses per hostname Paulo Alcantara
2021-05-11 18:47   ` kernel test robot
2021-05-11 18:47   ` kernel test robot
2021-05-11 16:36 ` Paulo Alcantara [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210511163609.11019-4-pc@cjr.nz \
    --to=pc@cjr.nz \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.com \
    --subject='Re: [PATCH 3/3] cifs: fix find_root_ses() when refresing dfs cache' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).