.. | .. |
---|
1802 | 1802 | proc_do_sync_threshold(struct ctl_table *table, int write, |
---|
1803 | 1803 | void *buffer, size_t *lenp, loff_t *ppos) |
---|
1804 | 1804 | { |
---|
| 1805 | + struct netns_ipvs *ipvs = table->extra2; |
---|
1805 | 1806 | int *valp = table->data; |
---|
1806 | 1807 | int val[2]; |
---|
1807 | 1808 | int rc; |
---|
.. | .. |
---|
1811 | 1812 | .mode = table->mode, |
---|
1812 | 1813 | }; |
---|
1813 | 1814 | |
---|
| 1815 | + mutex_lock(&ipvs->sync_mutex); |
---|
1814 | 1816 | memcpy(val, valp, sizeof(val)); |
---|
1815 | 1817 | rc = proc_dointvec(&tmp, write, buffer, lenp, ppos); |
---|
1816 | 1818 | if (write) { |
---|
.. | .. |
---|
1820 | 1822 | else |
---|
1821 | 1823 | memcpy(valp, val, sizeof(val)); |
---|
1822 | 1824 | } |
---|
| 1825 | + mutex_unlock(&ipvs->sync_mutex); |
---|
1823 | 1826 | return rc; |
---|
1824 | 1827 | } |
---|
1825 | 1828 | |
---|
.. | .. |
---|
4077 | 4080 | ipvs->sysctl_sync_threshold[0] = DEFAULT_SYNC_THRESHOLD; |
---|
4078 | 4081 | ipvs->sysctl_sync_threshold[1] = DEFAULT_SYNC_PERIOD; |
---|
4079 | 4082 | tbl[idx].data = &ipvs->sysctl_sync_threshold; |
---|
| 4083 | + tbl[idx].extra2 = ipvs; |
---|
4080 | 4084 | tbl[idx++].maxlen = sizeof(ipvs->sysctl_sync_threshold); |
---|
4081 | 4085 | ipvs->sysctl_sync_refresh_period = DEFAULT_SYNC_REFRESH_PERIOD; |
---|
4082 | 4086 | tbl[idx++].data = &ipvs->sysctl_sync_refresh_period; |
---|