From: David Vrabel Date: Thu, 14 Feb 2013 03:18:58 +0000 (+0000) Subject: xen-netback: cancel the credit timer when taking the vif down X-Git-Tag: v3.9-rc1~139^2~29^2~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e55f8b306cf305832a4ac78aa82e1b40e818ece;p=pandora-kernel.git xen-netback: cancel the credit timer when taking the vif down If the credit timer is left armed after calling xen_netbk_remove_xenvif(), then it may fire and attempt to schedule the vif which will then oops as vif->netbk == NULL. This may happen both in the fatal error path and during normal disconnection from the front end. The sequencing during shutdown is critical to ensure that: a) vif->netbk doesn't become unexpectedly NULL; and b) the net device/vif is not freed. 1. Mark as unschedulable (netif_carrier_off()). 2. Synchronously cancel the timer. 3. Remove the vif from the schedule list. 4. Remove it from it netback thread group. 5. Wait for vif->refcnt to become 0. Signed-off-by: David Vrabel Acked-by: Ian Campbell Reported-by: Christopher S. Aker Signed-off-by: David S. Miller --- Reading git-diff-tree failed