aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/cluster/nodemanager.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/cluster/nodemanager.c')
-rw-r--r--fs/ocfs2/cluster/nodemanager.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c
index 234f83f2897f..357f1d551771 100644
--- a/fs/ocfs2/cluster/nodemanager.c
+++ b/fs/ocfs2/cluster/nodemanager.c
@@ -573,12 +573,21 @@ static ssize_t o2nm_cluster_attr_idle_timeout_ms_write(
573 ret = o2nm_cluster_attr_write(page, count, &val); 573 ret = o2nm_cluster_attr_write(page, count, &val);
574 574
575 if (ret > 0) { 575 if (ret > 0) {
576 if (val <= cluster->cl_keepalive_delay_ms) { 576 if (cluster->cl_idle_timeout_ms != val
577 && o2net_num_connected_peers()) {
578 mlog(ML_NOTICE,
579 "o2net: cannot change idle timeout after "
580 "the first peer has agreed to it."
581 " %d connected peers\n",
582 o2net_num_connected_peers());
583 ret = -EINVAL;
584 } else if (val <= cluster->cl_keepalive_delay_ms) {
577 mlog(ML_NOTICE, "o2net: idle timeout must be larger " 585 mlog(ML_NOTICE, "o2net: idle timeout must be larger "
578 "than keepalive delay\n"); 586 "than keepalive delay\n");
579 return -EINVAL; 587 ret = -EINVAL;
588 } else {
589 cluster->cl_idle_timeout_ms = val;
580 } 590 }
581 cluster->cl_idle_timeout_ms = val;
582 } 591 }
583 592
584 return ret; 593 return ret;
@@ -599,12 +608,21 @@ static ssize_t o2nm_cluster_attr_keepalive_delay_ms_write(
599 ret = o2nm_cluster_attr_write(page, count, &val); 608 ret = o2nm_cluster_attr_write(page, count, &val);
600 609
601 if (ret > 0) { 610 if (ret > 0) {
602 if (val >= cluster->cl_idle_timeout_ms) { 611 if (cluster->cl_keepalive_delay_ms != val
612 && o2net_num_connected_peers()) {
613 mlog(ML_NOTICE,
614 "o2net: cannot change keepalive delay after"
615 " the first peer has agreed to it."
616 " %d connected peers\n",
617 o2net_num_connected_peers());
618 ret = -EINVAL;
619 } else if (val >= cluster->cl_idle_timeout_ms) {
603 mlog(ML_NOTICE, "o2net: keepalive delay must be " 620 mlog(ML_NOTICE, "o2net: keepalive delay must be "
604 "smaller than idle timeout\n"); 621 "smaller than idle timeout\n");
605 return -EINVAL; 622 ret = -EINVAL;
623 } else {
624 cluster->cl_keepalive_delay_ms = val;
606 } 625 }
607 cluster->cl_keepalive_delay_ms = val;
608 } 626 }
609 627
610 return ret; 628 return ret;