From: Jason Wang Date: Wed, 5 Jun 2013 23:54:33 +0000 (+0000) Subject: macvtap: fix a possible race between queue selection and changing queues X-Git-Tag: v3.11-rc1~16^2~141 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed0483fa06e0efb86a82e382a00dbad02b62807c;p=pandora-kernel.git macvtap: fix a possible race between queue selection and changing queues Complier may generate codes that re-read the vlan->numvtaps during macvtap_get_queue(). This may lead a race if vlan->numvtaps were changed in the same time and which can lead unexpected result (e.g. very huge value). We need prevent the compiler from generating such codes by adding an ACCESS_ONCE() to make sure vlan->numvtaps were only read once. Acked-by: Michael S. Tsirkin Signed-off-by: Jason Wang Signed-off-by: David S. Miller --- Reading git-diff-tree failed