diff mbox series

[RFC,24/24] nfs: add a module parameter to disable directory delegations

Message ID 20240315-dir-deleg-v1-24-a1d6209a3654@kernel.org (mailing list archive)
State New, archived
Headers show
Series vfs, nfsd, nfs: implement directory delegations | expand

Commit Message

Jeff Layton March 15, 2024, 4:53 p.m. UTC
For testing purposes, add a module parameter that will prevent the
client from requesting further directory delegations.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/nfs/nfs4proc.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 3dbe9a18c9be..a85a594cad88 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4318,8 +4318,14 @@  static int nfs4_get_referral(struct rpc_clnt *client, struct inode *dir,
 	return status;
 }
 
+static bool nfs_dir_delegation_enabled = true;
+module_param(nfs_dir_delegation_enabled, bool, 0644);
+MODULE_PARM_DESC(nfs_dir_delegation_enabled, "Enable directory delegations?");
+
 static bool should_request_dir_deleg(struct inode *inode)
 {
+	if (!nfs_dir_delegation_enabled)
+		return false;
 	if (!inode)
 		return false;
 	if (!S_ISDIR(inode->i_mode))