Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nfsd: add a runtime switch for disabling delegated timestamps

The delegated timestamp code seems to be working well enough now that we
want to make it always be built in. In the event that there are problems
though, we still want to be able to disable them for debugging purposes.
Add a switch to debugfs to enable them at runtime.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

authored by

Jeff Layton and committed by
Chuck Lever
6237a17f ed7f4d32

+13
+4
fs/nfsd/debugfs.c
··· 140 140 141 141 debugfs_create_file("io_cache_write", 0644, nfsd_top_dir, NULL, 142 142 &nfsd_io_cache_write_fops); 143 + #ifdef CONFIG_NFSD_V4 144 + debugfs_create_bool("delegated_timestamps", 0644, nfsd_top_dir, 145 + &nfsd_delegts_enabled); 146 + #endif 143 147 }
+8
fs/nfsd/nfs4state.c
··· 76 76 77 77 static u64 current_sessionid = 1; 78 78 79 + bool nfsd_delegts_enabled __read_mostly = true; 80 + 79 81 #define ZERO_STATEID(stateid) (!memcmp((stateid), &zero_stateid, sizeof(stateid_t))) 80 82 #define ONE_STATEID(stateid) (!memcmp((stateid), &one_stateid, sizeof(stateid_t))) 81 83 #define CURRENT_STATEID(stateid) (!memcmp((stateid), &currentstateid, sizeof(stateid_t))) ··· 6047 6045 } 6048 6046 6049 6047 #ifdef CONFIG_NFSD_V4_DELEG_TIMESTAMPS 6048 + /* 6049 + * Timestamp delegation was introduced in RFC7862. Runtime switch for disabling 6050 + * this feature is /sys/kernel/debug/nfsd/delegated_timestamps. 6051 + */ 6050 6052 static bool nfsd4_want_deleg_timestamps(const struct nfsd4_open *open) 6051 6053 { 6054 + if (!nfsd_delegts_enabled) 6055 + return false; 6052 6056 return open->op_deleg_want & OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS; 6053 6057 } 6054 6058 #else /* CONFIG_NFSD_V4_DELEG_TIMESTAMPS */
+1
fs/nfsd/nfsd.h
··· 160 160 #endif 161 161 162 162 extern bool nfsd_disable_splice_read __read_mostly; 163 + extern bool nfsd_delegts_enabled __read_mostly; 163 164 164 165 enum { 165 166 /* Any new NFSD_IO enum value must be added at the end */