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.
Unified · Split
| @@ -3046,12 +3046,6 @@ static int mount_get_conns(struct mount_ctx *mnt_ctx) · 3045 unmodified lines | |||
| 3046 | cifs_dbg(VFS, "read only mount of RW share\n"); | 3046 | cifs_dbg(VFS, "read only mount of RW share\n"); |
| 3047 | /* no need to log a RW mount of a typical RW share */ | 3047 | /* no need to log a RW mount of a typical RW share */ |
| 3048 | } | 3048 | } |
| 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); | ||
| 3055 | } | 3049 | } |
| 3056 | 3050 | ||
| 3057 | /* | 3051 | /* |
| @@ -92,7 +92,7 @@ void cifs_fscache_get_super_cookie(struct cifs_tcon *tcon) · 91 unmodified lines | |||
| 92 | * In the future, as we integrate with newer fscache features, | 92 | * In the future, as we integrate with newer fscache features, |
| 93 | * we may want to instead add a check if cookie has changed | 93 | * we may want to instead add a check if cookie has changed |
| 94 | */ | 94 | */ |
| 95 | if (tcon->fscache == NULL) | 95 | if (tcon->fscache) |
| 96 | return; | 96 | return; |
| 97 | 97 | ||
| 98 | sharename = extract_sharename(tcon->treeName); | 98 | sharename = extract_sharename(tcon->treeName); |
| @@ -1376,6 +1376,13 @@ iget_no_retry: · 1375 unmodified lines | |||
| 1376 | inode = ERR_PTR(rc); | 1376 | inode = ERR_PTR(rc); |
| 1377 | } | 1377 | } |
| 1378 | 1378 | ||
| 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 | |||
| 1379 | out: | 1386 | out: |
| 1380 | kfree(path); | 1387 | kfree(path); |
| 1381 | free_xid(xid); | 1388 | free_xid(xid); |