diff mbox series

wait until we have the FS info from the server befor initializing fscache cookie

Message ID CAH2r5mvM2hEP6TTOWipZayRapLwZ-=BzrLBJDK_0J4ZHiRc6og@mail.gmail.com (mailing list archive)
State New, archived
Headers show
Series wait until we have the FS info from the server befor initializing fscache cookie | expand

Commit Message

Steve French Nov. 10, 2021, 9:20 a.m. UTC
With this patch now that the fscache cookie is initialized properly -
I do see an oops on the 2nd unmount if we mount the same share twice
... any ideas on fixing that?


    smb3: do not call setup the fscache_super_cookie until fsinfo initialized

    We were calling cifs_fscache_get_super_cookie after tcon but before
    we queried the info (QFS_Info) we need to initialize the cookie
    properly.

    Suggested-by: David Howells <dhowells@redhat.com>
    Signed-off-by: Steve French <stfrench@microsoft.com>

Comments

Steve French Nov. 11, 2021, 10:28 p.m. UTC | #1
Updated patch to check whether would be initializing the super cookie twice

cifs

On Wed, Nov 10, 2021 at 3:20 AM Steve French <smfrench@gmail.com> wrote:
>
> With this patch now that the fscache cookie is initialized properly -
> I do see an oops on the 2nd unmount if we mount the same share twice
> ... any ideas on fixing that?
>
>
>     smb3: do not call setup the fscache_super_cookie until fsinfo initialized
>
>     We were calling cifs_fscache_get_super_cookie after tcon but before
>     we queried the info (QFS_Info) we need to initialize the cookie
>     properly.
>
>     Suggested-by: David Howells <dhowells@redhat.com>
>     Signed-off-by: Steve French <stfrench@microsoft.com>
>
>
> --
> Thanks,
>
> Steve
diff mbox series

Patch

From 090f51ab455dee249a4bc13428f964bd7e848956 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Wed, 10 Nov 2021 03:15:29 -0600
Subject: [PATCH] smb3: do not call setup the fscache_super_cookie until fsinfo
 initialized

We were calling cifs_fscache_get_super_cookie after tcon but before
we queried the info (QFS_Info) we need to initialize the cookie
properly.

Suggested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/connect.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index f645f994a523..186c953c47ec 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2349,8 +2349,6 @@  cifs_get_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx)
 	list_add(&tcon->tcon_list, &ses->tcon_list);
 	spin_unlock(&cifs_tcp_ses_lock);
 
-	cifs_fscache_get_super_cookie(tcon);
-
 	return tcon;
 
 out_fail:
@@ -3002,6 +3000,8 @@  static int mount_get_conns(struct mount_ctx *mnt_ctx)
 				cifs_dbg(VFS, "read only mount of RW share\n");
 			/* no need to log a RW mount of a typical RW share */
 		}
+		/* The cookie is initialized from volume info returned above */
+		cifs_fscache_get_super_cookie(tcon);
 	}
 
 	/*
-- 
2.32.0