[PATCH 3/3] cifs: fix find_root_ses() when refresing dfs cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 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




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux