]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cifs: wait for tcon resource_id before getting fscache super
authorShyam Prasad N <sprasad@microsoft.com>
Thu, 2 Dec 2021 07:14:42 +0000 (07:14 +0000)
committerSteve French <stfrench@microsoft.com>
Fri, 3 Dec 2021 18:29:59 +0000 (12:29 -0600)
The logic for initializing tcon->resource_id is done inside
cifs_root_iget. fscache super cookie relies on this for aux
data. So we need to push the fscache initialization to this
later point during mount.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/connect.c
fs/cifs/fscache.c
fs/cifs/inode.c

index 90f38fb9baa09c980dcbc5ff01676b5ba3f216f7..7cc469e4682a4d61e1aca384161ab1d847659c08 100644 (file)
@@ -3046,12 +3046,6 @@ 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.
-                * Inside cifs_fscache_get_super_cookie it checks
-                * that we do not get super cookie twice.
-                */
-               cifs_fscache_get_super_cookie(tcon);
        }
 
        /*
index 7e409a38a2d7c184abf3ab0c1afbea2ccbfe9f6f..f4da693760c11f56145b98307a83b1d168df4dd3 100644 (file)
@@ -92,7 +92,7 @@ void cifs_fscache_get_super_cookie(struct cifs_tcon *tcon)
         * In the future, as we integrate with newer fscache features,
         * we may want to instead add a check if cookie has changed
         */
-       if (tcon->fscache == NULL)
+       if (tcon->fscache)
                return;
 
        sharename = extract_sharename(tcon->treeName);
index 82848412ad85208f08d1fad12bc2871297c8f252..96d083db173724901e3193b51ce4e1dda3bde64d 100644 (file)
@@ -1376,6 +1376,13 @@ iget_no_retry:
                inode = ERR_PTR(rc);
        }
 
+       /*
+        * The cookie is initialized from volume info returned above.
+        * Inside cifs_fscache_get_super_cookie it checks
+        * that we do not get super cookie twice.
+        */
+       cifs_fscache_get_super_cookie(tcon);
+
 out:
        kfree(path);
        free_xid(xid);