NFS: Fix regression whereby fscache errors are appearing on 'nofsc' mounts
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 3 Aug 2019 17:39:24 +0000 (13:39 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 5 Aug 2019 02:35:41 +0000 (22:35 -0400)
commitdea1bb35c5f35e0577cfc61f79261d80b8715221
treef0485667a30a19ca07fd745ef3c88aa360edcea2
parent09a54f0ebfe263bc27c90bbd80187b9a93283887
NFS: Fix regression whereby fscache errors are appearing on 'nofsc' mounts

People are reporing seeing fscache errors being reported concerning
duplicate cookies even in cases where they are not setting up fscache
at all. The rule needs to be that if fscache is not enabled, then it
should have no side effects at all.

To ensure this is the case, we disable fscache completely on all superblocks
for which the 'fsc' mount option was not set. In order to avoid issues
with '-oremount', we also disable the ability to turn fscache on via
remount.

Fixes: f1fe29b4a02d ("NFS: Use i_writecount to control whether...")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=200145
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: Steve Dickson <steved@redhat.com>
Cc: David Howells <dhowells@redhat.com>
fs/nfs/fscache.c
fs/nfs/fscache.h
fs/nfs/super.c