connector: Fix proc_event_num_listeners count not cleared
When we register a cn_proc listening event, the proc_event_num_listener variable will be incremented by one, but if PROC_CN_MCAST_IGNORE is not called, the count will not decrease. This will cause the proc_*_connector function to take the wrong path. It will reappear when the forkstat tool exits via ctrl + c. We solve this problem by determining whether there are still listeners to clear proc_event_num_listener. Signed-off-by: wangkeqi <wangkeqiwang@didiglobal.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
059d37b718
commit
c46bfba133
1 changed files with 3 additions and 2 deletions
|
@ -108,8 +108,9 @@ static inline void send_msg(struct cn_msg *msg)
|
||||||
filter_data[1] = 0;
|
filter_data[1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT,
|
if (cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT,
|
||||||
cn_filter, (void *)filter_data);
|
cn_filter, (void *)filter_data) == -ESRCH)
|
||||||
|
atomic_set(&proc_event_num_listeners, 0);
|
||||||
|
|
||||||
local_unlock(&local_event.lock);
|
local_unlock(&local_event.lock);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue