aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-12-21 11:02:32 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-21 11:32:09 -0500
commitc4271c6e37c32105492cbbed35f45330cb327b94 (patch)
treea3fd8be5fb51c29539ae3e540837e1e59ecd4e8b /fs
parentc129c29347b6cf0d64bfe53848f68320286612ab (diff)
NFS: Kill fscache warnings when mounting without -ofsc
The fscache code will currently bleat a "non-unique superblock keys" warning even if the user is mounting without the 'fsc' option. There should be no reason to even initialise the superblock cache cookie unless we're planning on using fscache for something, so ensure that we check for the NFS_OPTION_FSCACHE flag before calling into the fscache code. Reported-by: Paweł Sikora <pawel.sikora@agmk.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: David Howells <dhowells@redhat.com> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/super.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index aa5315bb3666..c25cadf8f8c4 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2375,19 +2375,30 @@ static void nfs_get_cache_cookie(struct super_block *sb,
2375 struct nfs_parsed_mount_data *parsed, 2375 struct nfs_parsed_mount_data *parsed,
2376 struct nfs_clone_mount *cloned) 2376 struct nfs_clone_mount *cloned)
2377{ 2377{
2378 struct nfs_server *nfss = NFS_SB(sb);
2378 char *uniq = NULL; 2379 char *uniq = NULL;
2379 int ulen = 0; 2380 int ulen = 0;
2380 2381
2381 if (parsed && parsed->fscache_uniq) { 2382 nfss->fscache_key = NULL;
2382 uniq = parsed->fscache_uniq; 2383 nfss->fscache = NULL;
2383 ulen = strlen(parsed->fscache_uniq); 2384
2385 if (parsed) {
2386 if (!(parsed->options & NFS_OPTION_FSCACHE))
2387 return;
2388 if (parsed->fscache_uniq) {
2389 uniq = parsed->fscache_uniq;
2390 ulen = strlen(parsed->fscache_uniq);
2391 }
2384 } else if (cloned) { 2392 } else if (cloned) {
2385 struct nfs_server *mnt_s = NFS_SB(cloned->sb); 2393 struct nfs_server *mnt_s = NFS_SB(cloned->sb);
2394 if (!(mnt_s->options & NFS_OPTION_FSCACHE))
2395 return;
2386 if (mnt_s->fscache_key) { 2396 if (mnt_s->fscache_key) {
2387 uniq = mnt_s->fscache_key->key.uniquifier; 2397 uniq = mnt_s->fscache_key->key.uniquifier;
2388 ulen = mnt_s->fscache_key->key.uniq_len; 2398 ulen = mnt_s->fscache_key->key.uniq_len;
2389 }; 2399 };
2390 } 2400 } else
2401 return;
2391 2402
2392 nfs_fscache_get_super_cookie(sb, uniq, ulen); 2403 nfs_fscache_get_super_cookie(sb, uniq, ulen);
2393} 2404}