Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

macvtap: use prepare_to_wait/finish_wait to ensure mb

instead of raw assignment to current->state

Signed-off-by: Hong Zhiguo <honkiko@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Hong zhi guo and committed by
David S. Miller
ccf7e72b e9939c80

+3 -5
+3 -5
drivers/net/macvtap.c
··· 847 847 const struct iovec *iv, unsigned long len, 848 848 int noblock) 849 849 { 850 - DECLARE_WAITQUEUE(wait, current); 850 + DEFINE_WAIT(wait); 851 851 struct sk_buff *skb; 852 852 ssize_t ret = 0; 853 853 854 - add_wait_queue(sk_sleep(&q->sk), &wait); 855 854 while (len) { 856 - current->state = TASK_INTERRUPTIBLE; 855 + prepare_to_wait(sk_sleep(&q->sk), &wait, TASK_INTERRUPTIBLE); 857 856 858 857 /* Read frames from the queue */ 859 858 skb = skb_dequeue(&q->sk.sk_receive_queue); ··· 874 875 break; 875 876 } 876 877 877 - current->state = TASK_RUNNING; 878 - remove_wait_queue(sk_sleep(&q->sk), &wait); 878 + finish_wait(sk_sleep(&q->sk), &wait); 879 879 return ret; 880 880 } 881 881