Re: oops in fscache

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

 



This is with upstream fscache (5.16-rc) + the fix you suggested.

Without the patch those three fields of the super cookie were getting
set to zero.

Scenario is easy:
1) mount
2) mount same share again to different target
3) umount first mount
4) umount second mount (oops)

On Wed, Nov 10, 2021 at 4:57 AM David Howells <dhowells@xxxxxxxxxx> wrote:
>
> Steve French <smfrench@xxxxxxxxx> wrote:
>
> > I noticed that if I mount the same share twice (to different target
> > directories) I get the warning below.  Is that expected?
>
> This is with the upstream fscache, I presume?
>
> David
>


-- 
Thanks,

Steve
From f0f5bec3a34f85f0ecad965937df54d484aa4b41 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@xxxxxxxxxxxxx>
Date: Wed, 10 Nov 2021 03:15:29 -0600
Subject: [PATCH] smb3: do not 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@xxxxxxxxxx>
Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
---
 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


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

  Powered by Linux