}
-static int errno;
-
static DECLARE_WAIT_QUEUE_HEAD(sync_wait);
static pid_t sync_master_pid = 0;
static pid_t sync_backup_pid = 0;
if (ip_vs_sync_state & IP_VS_STATE_MASTER && !sync_master_pid) {
state = IP_VS_STATE_MASTER;
- name = "ipvs syncmaster";
+ name = "ipvs_syncmaster";
} else if (ip_vs_sync_state & IP_VS_STATE_BACKUP && !sync_backup_pid) {
state = IP_VS_STATE_BACKUP;
- name = "ipvs syncbackup";
+ name = "ipvs_syncbackup";
} else {
IP_VS_BUG();
ip_vs_use_count_dec();
static int fork_sync_thread(void *startup)
{
+ pid_t pid;
+
/* fork the sync thread here, then the parent process of the
sync thread is the init process after this thread exits. */
- if (kernel_thread(sync_thread, startup, 0) < 0)
- IP_VS_BUG();
+ repeat:
+ if ((pid = kernel_thread(sync_thread, startup, 0)) < 0) {
+ IP_VS_ERR("could not create sync_thread due to %d... "
+ "retrying.\n", pid);
+ current->state = TASK_UNINTERRUPTIBLE;
+ schedule_timeout(HZ);
+ goto repeat;
+ }
+
return 0;
}
ip_vs_backup_syncid = syncid;
}
- if ((pid = kernel_thread(fork_sync_thread, &startup, 0)) < 0)
- IP_VS_BUG();
+ repeat:
+ if ((pid = kernel_thread(fork_sync_thread, &startup, 0)) < 0) {
+ IP_VS_ERR("could not create fork_sync_thread due to %d... "
+ "retrying.\n", pid);
+ current->state = TASK_UNINTERRUPTIBLE;
+ schedule_timeout(HZ);
+ goto repeat;
+ }
wait_for_completion(&startup);