diff options
author | Steve French <stfrench@microsoft.com> | 2019-09-04 00:49:46 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-09-16 18:43:38 +0200 |
commit | cae53f70f812c845fcedb577b0d40ec97ee4b920 (patch) | |
tree | 8ac4254f88973b488fdc6067275113d37c39c5f2 /fs/cifs/connect.c | |
parent | smb3: add mount option to allow RW caching of share accessed by only 1 client (diff) | |
download | linux-cae53f70f812c845fcedb577b0d40ec97ee4b920.tar.xz linux-cae53f70f812c845fcedb577b0d40ec97ee4b920.zip |
smb3: log warning if CSC policy conflicts with cache mount option
If the server config (e.g. Samba smb.conf "csc policy = disable)
for the share indicates that the share should not be cached, log
a warning message if forced client side caching ("cache=ro" or
"cache=singleclient") is requested on mount.
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | fs/cifs/connect.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index d9a995588c74..85f8d943a05a 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -3478,6 +3478,14 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info) tcon->use_resilient = true; } + /* If the user really knows what they are doing they can override */ + if (tcon->share_flags & SMB2_SHAREFLAG_NO_CACHING) { + if (volume_info->cache_ro) + cifs_dbg(VFS, "cache=ro requested on mount but NO_CACHING flag set on share\n"); + else if (volume_info->cache_rw) + cifs_dbg(VFS, "cache=singleclient requested on mount but NO_CACHING flag set on share\n"); + } + /* * We can have only one retry value for a connection to a share so for * resources mounted more than once to the same server share the last |