summaryrefslogtreecommitdiff
path: root/drivers/vhost/net.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-06-02 08:26:36 -0700
committerDavid S. Miller <davem@davemloft.net>2010-06-02 08:26:36 -0700
commit0dea7c12fc2c15de8b2104a322a1f47919d753fd (patch)
treef6f2082164d3a1fcfe3359d02beb6f19917d4c08 /drivers/vhost/net.c
parentab95bfe01f9872459c8678572ccadbf646badad0 (diff)
parentf8322fbe049687d3676690e8ad839c7169dd306a (diff)
Merge branch 'vhost-net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r--drivers/vhost/net.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 0f41c9195e9b..4c218e910635 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -519,13 +519,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:
if (oldsock) {
vhost_net_flush_vq(n, index);
fput(oldsock->file);
@@ -626,7 +625,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,