Skip to content

Commit 4e192ee

Browse files
alexaringteigland
authored andcommitted
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 <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
1 parent e1a0ec3 commit 4e192ee

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎fs/dlm/config.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,14 @@ static bool dlm_check_zero(unsigned int x)
166166
return !x;
167167
}
168168

169+
#define DEFAULT_BUFFER_SIZE 4096
170+
static bool dlm_check_buffer_size(unsigned int x)
171+
{
172+
return (x < DEFAULT_BUFFER_SIZE);
173+
}
174+
169175
CLUSTER_ATTR(tcp_port, dlm_check_zero);
170-
CLUSTER_ATTR(buffer_size, dlm_check_zero);
176+
CLUSTER_ATTR(buffer_size, dlm_check_buffer_size);
171177
CLUSTER_ATTR(rsbtbl_size, dlm_check_zero);
172178
CLUSTER_ATTR(recover_timer, dlm_check_zero);
173179
CLUSTER_ATTR(toss_secs, dlm_check_zero);
@@ -901,7 +907,6 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num)
901907

902908
/* Config file defaults */
903909
#define DEFAULT_TCP_PORT 21064
904-
#define DEFAULT_BUFFER_SIZE 4096
905910
#define DEFAULT_RSBTBL_SIZE 1024
906911
#define DEFAULT_RECOVER_TIMER 5
907912
#define DEFAULT_TOSS_SECS 10

0 commit comments

Comments
 (0)