aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Aring <[email protected]>2020-09-24 10:31:25 -0400
committerDavid Teigland <[email protected]>2020-09-29 14:00:32 -0500
commit4e192ee68e5af301470a925b76700d788db35d96 (patch)
treee76c51d5ff054fc431ca6a6b05dfae86e485f9a8
parente1a0ec30a571f176e9b324daba4c0e3f200fe882 (diff)
fs: dlm: disallow buffer size below default
I observed that the upper layer will not send messages above this value. As conclusion the application receive buffer should not below that value, otherwise we are not capable to deliver the dlm message to the upper layer. This patch forbids to set the receive buffer below the maximum possible dlm message size. Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: David Teigland <[email protected]>
-rw-r--r--fs/dlm/config.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index e03b409a4df0..a4bed304a843 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -166,8 +166,14 @@ static bool dlm_check_zero(unsigned int x)
return !x;
}
+#define DEFAULT_BUFFER_SIZE 4096
+static bool dlm_check_buffer_size(unsigned int x)
+{
+ return (x < DEFAULT_BUFFER_SIZE);
+}
+
CLUSTER_ATTR(tcp_port, dlm_check_zero);
-CLUSTER_ATTR(buffer_size, dlm_check_zero);
+CLUSTER_ATTR(buffer_size, dlm_check_buffer_size);
CLUSTER_ATTR(rsbtbl_size, dlm_check_zero);
CLUSTER_ATTR(recover_timer, dlm_check_zero);
CLUSTER_ATTR(toss_secs, dlm_check_zero);
@@ -901,7 +907,6 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num)
/* Config file defaults */
#define DEFAULT_TCP_PORT 21064
-#define DEFAULT_BUFFER_SIZE 4096
#define DEFAULT_RSBTBL_SIZE 1024
#define DEFAULT_RECOVER_TIMER 5
#define DEFAULT_TOSS_SECS 10