Skip to content

Commit 5bf91ef

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: wait for tcon resource_id before getting fscache super
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>
1 parent 65de262 commit 5bf91ef

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

fs/cifs/connect.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3046,12 +3046,6 @@ static int mount_get_conns(struct mount_ctx *mnt_ctx)
30463046
cifs_dbg(VFS, "read only mount of RW share\n");
30473047
/* no need to log a RW mount of a typical RW share */
30483048
}
3049-
/*
3050-
* The cookie is initialized from volume info returned above.
3051-
* Inside cifs_fscache_get_super_cookie it checks
3052-
* that we do not get super cookie twice.
3053-
*/
3054-
cifs_fscache_get_super_cookie(tcon);
30553049
}
30563050

30573051
/*

fs/cifs/fscache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void cifs_fscache_get_super_cookie(struct cifs_tcon *tcon)
9292
* In the future, as we integrate with newer fscache features,
9393
* we may want to instead add a check if cookie has changed
9494
*/
95-
if (tcon->fscache == NULL)
95+
if (tcon->fscache)
9696
return;
9797

9898
sharename = extract_sharename(tcon->treeName);

fs/cifs/inode.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,13 @@ struct inode *cifs_root_iget(struct super_block *sb)
13761376
inode = ERR_PTR(rc);
13771377
}
13781378

1379+
/*
1380+
* The cookie is initialized from volume info returned above.
1381+
* Inside cifs_fscache_get_super_cookie it checks
1382+
* that we do not get super cookie twice.
1383+
*/
1384+
cifs_fscache_get_super_cookie(tcon);
1385+
13791386
out:
13801387
kfree(path);
13811388
free_xid(xid);

0 commit comments

Comments
 (0)