]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/vhost/net.c
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[net-next-2.6.git] / drivers / vhost / net.c
index 2f6185c845e03618ca679513aecd55bfb96c76d5..7a104e2de3fa77d189bf9ae010cda3f0ee0dd706 100644 (file)
@@ -527,12 +527,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
 
        /* start polling new socket */
        oldsock = vq->private_data;
-       if (sock == oldsock)
-               goto done;
+       if (sock != oldsock) {
+                vhost_net_disable_vq(n, vq);
+                rcu_assign_pointer(vq->private_data, sock);
+                vhost_net_enable_vq(n, vq);
+       }
 
-       vhost_net_disable_vq(n, vq);
-       rcu_assign_pointer(vq->private_data, sock);
-       vhost_net_enable_vq(n, vq);
 done:
        mutex_unlock(&vq->mutex);
 
@@ -639,7 +639,7 @@ static long vhost_net_compat_ioctl(struct file *f, unsigned int ioctl,
 }
 #endif
 
-const static struct file_operations vhost_net_fops = {
+static const struct file_operations vhost_net_fops = {
        .owner          = THIS_MODULE,
        .release        = vhost_net_release,
        .unlocked_ioctl = vhost_net_ioctl,