search for: port_fops_read

Displaying 20 results from an estimated 38 matches for "port_fops_read".

2013 Jul 19
2
[PATCH 04/10] virtio: console: return -ENODEV on all read operations after unplug
...++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c > index 6bf0df3..a39702a 100644 > --- a/drivers/char/virtio_console.c > +++ b/drivers/char/virtio_console.c > @@ -749,6 +749,10 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf, > > port = filp->private_data; > > + /* Port is hot-unplugged. */ > + if (!port->guest_connected) > + return -ENODEV; > + What if the port is hot-unplugged after this check? Should we serialize the hot plug with inbuf_lock her...
2013 Jul 19
2
[PATCH 04/10] virtio: console: return -ENODEV on all read operations after unplug
...++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c > index 6bf0df3..a39702a 100644 > --- a/drivers/char/virtio_console.c > +++ b/drivers/char/virtio_console.c > @@ -749,6 +749,10 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf, > > port = filp->private_data; > > + /* Port is hot-unplugged. */ > + if (!port->guest_connected) > + return -ENODEV; > + What if the port is hot-unplugged after this check? Should we serialize the hot plug with inbuf_lock her...
2013 Jul 19
2
[PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug
...> port = filp->private_data; > + if (!port->guest_connected) { > + /* Port was unplugged before we could proceed */ > + return POLLHUP; > + } > poll_wait(filp, &port->waitqueue, wait); > > if (!port->guest_connected) { Looks still racy here. Unlike port_fops_read() which check will_read_block(). If unplug happens after the check but before the poll_wait(), caller will be blocked forever.
2013 Jul 19
2
[PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug
...> port = filp->private_data; > + if (!port->guest_connected) { > + /* Port was unplugged before we could proceed */ > + return POLLHUP; > + } > poll_wait(filp, &port->waitqueue, wait); > > if (!port->guest_connected) { Looks still racy here. Unlike port_fops_read() which check will_read_block(). If unplug happens after the check but before the poll_wait(), caller will be blocked forever.
2013 Jul 22
3
[PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug
...gged before we could proceed */ >> >>> + return POLLHUP; >> >>> + } >> >>> poll_wait(filp, &port->waitqueue, wait); >> >>> >> >>> if (!port->guest_connected) { >> >> Looks still racy here. Unlike port_fops_read() which check >> >> will_read_block(). If unplug happens after the check but before the >> >> poll_wait(), caller will be blocked forever. >> > unplug_port() calls wake_up_interruptible on the waitqueue. >> >> I mean the following cases: > > (form...
2013 Jul 22
3
[PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug
...gged before we could proceed */ >> >>> + return POLLHUP; >> >>> + } >> >>> poll_wait(filp, &port->waitqueue, wait); >> >>> >> >>> if (!port->guest_connected) { >> >> Looks still racy here. Unlike port_fops_read() which check >> >> will_read_block(). If unplug happens after the check but before the >> >> poll_wait(), caller will be blocked forever. >> > unplug_port() calls wake_up_interruptible on the waitqueue. >> >> I mean the following cases: > > (form...
2013 Jul 19
2
[PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug
...t;guest_connected) { >>> + /* Port was unplugged before we could proceed */ >>> + return POLLHUP; >>> + } >>> poll_wait(filp, &port->waitqueue, wait); >>> >>> if (!port->guest_connected) { >> Looks still racy here. Unlike port_fops_read() which check >> will_read_block(). If unplug happens after the check but before the >> poll_wait(), caller will be blocked forever. > unplug_port() calls wake_up_interruptible on the waitqueue. I mean the following cases: CPU0: CPU1:...
2013 Jul 19
2
[PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug
...t;guest_connected) { >>> + /* Port was unplugged before we could proceed */ >>> + return POLLHUP; >>> + } >>> poll_wait(filp, &port->waitqueue, wait); >>> >>> if (!port->guest_connected) { >> Looks still racy here. Unlike port_fops_read() which check >> will_read_block(). If unplug happens after the check but before the >> poll_wait(), caller will be blocked forever. > unplug_port() calls wake_up_interruptible on the waitqueue. I mean the following cases: CPU0: CPU1:...
2013 Jul 18
0
[PATCH 04/10] virtio: console: return -ENODEV on all read operations after unplug
...vers/char/virtio_console.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 6bf0df3..a39702a 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -749,6 +749,10 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf, port = filp->private_data; + /* Port is hot-unplugged. */ + if (!port->guest_connected) + return -ENODEV; + if (!port_has_data(port)) { /* * If nothing's connected on the host just return 0 in @@ -765,7 +769,7 @@ static ssize_t port_fo...
2013 Jul 25
0
[PATCH v3 5/9] virtio: console: return -ENODEV on all read operations after unplug
...vers/char/virtio_console.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 3435348..2b68075 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -749,6 +749,10 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf, port = filp->private_data; + /* Port is hot-unplugged. */ + if (!port->guest_connected) + return -ENODEV; + if (!port_has_data(port)) { /* * If nothing's connected on the host just return 0 in @@ -765,7 +769,7 @@ static ssize_t port_fo...
2010 Sep 15
1
PATCH: virtio_console: Fix poll blocking even though there is data to read
...symptom I was seeing was select blocking on the spice vdagent virtio serial port even though there were messages queued up there. virtio_console's port_fops_poll checks port->inbuf != NULL to determine if read won't block. However if an application reads enough bytes from inbuf through port_fops_read, to empty the current port->inbuf, port->inbuf will be NULL even though there may be buffers left in the virtqueue. This causes poll() to block even though there is data to be read, this patch fixes this by using the alredy defined will_read_block utility function instead of the port->inb...
2010 Sep 15
1
PATCH: virtio_console: Fix poll blocking even though there is data to read
...symptom I was seeing was select blocking on the spice vdagent virtio serial port even though there were messages queued up there. virtio_console's port_fops_poll checks port->inbuf != NULL to determine if read won't block. However if an application reads enough bytes from inbuf through port_fops_read, to empty the current port->inbuf, port->inbuf will be NULL even though there may be buffers left in the virtqueue. This causes poll() to block even though there is data to be read, this patch fixes this by using the alredy defined will_read_block utility function instead of the port->inb...
2010 Sep 16
2
[PATCH 1/2] virtio: console: Fix poll blocking even though there is data to read
...symptom I was seeing was select blocking on the spice vdagent virtio serial port even though there were messages queued up there. virtio_console's port_fops_poll checks port->inbuf != NULL to determine if read won't block. However if an application reads enough bytes from inbuf through port_fops_read, to empty the current port->inbuf, port->inbuf will be NULL even though there may be buffers left in the virtqueue. This causes poll() to block even though there is data to be read, this patch fixes this by using will_read_block(port) instead of the port->inbuf != NULL check. Signed-off-...
2010 Sep 16
2
[PATCH 1/2] virtio: console: Fix poll blocking even though there is data to read
...symptom I was seeing was select blocking on the spice vdagent virtio serial port even though there were messages queued up there. virtio_console's port_fops_poll checks port->inbuf != NULL to determine if read won't block. However if an application reads enough bytes from inbuf through port_fops_read, to empty the current port->inbuf, port->inbuf will be NULL even though there may be buffers left in the virtqueue. This causes poll() to block even though there is data to be read, this patch fixes this by using will_read_block(port) instead of the port->inbuf != NULL check. Signed-off-...
2013 Jul 23
1
[PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug
...t;>>>> + return POLLHUP; >>>>>>> + } >>>>>>> poll_wait(filp, &port->waitqueue, wait); >>>>>>> >>>>>>> if (!port->guest_connected) { >>>>>> Looks still racy here. Unlike port_fops_read() which check >>>>>> will_read_block(). If unplug happens after the check but before the >>>>>> poll_wait(), caller will be blocked forever. >>>>> unplug_port() calls wake_up_interruptible on the waitqueue. >>>> I mean the following cas...
2013 Jul 23
1
[PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug
...t;>>>> + return POLLHUP; >>>>>>> + } >>>>>>> poll_wait(filp, &port->waitqueue, wait); >>>>>>> >>>>>>> if (!port->guest_connected) { >>>>>> Looks still racy here. Unlike port_fops_read() which check >>>>>> will_read_block(). If unplug happens after the check but before the >>>>>> poll_wait(), caller will be blocked forever. >>>>> unplug_port() calls wake_up_interruptible on the waitqueue. >>>> I mean the following cas...
2013 Jul 18
16
[PATCH 00/10] virtio: console: fixes for races with port unplug
Hello, This series fixes a few races with port unplug and the various file operations: read(), write(), close() and poll(). There still might be more races lurking, but testing this series looks good to at least solve the easily-triggerable ones. I've run the virtio-serial testsuite and a few open/close/unplug tests, and haven't seen any badness. I've marked these patches for
2013 Jul 18
16
[PATCH 00/10] virtio: console: fixes for races with port unplug
Hello, This series fixes a few races with port unplug and the various file operations: read(), write(), close() and poll(). There still might be more races lurking, but testing this series looks good to at least solve the easily-triggerable ones. I've run the virtio-serial testsuite and a few open/close/unplug tests, and haven't seen any badness. I've marked these patches for
2010 Sep 15
1
PATCH: virtio_console: Fix poll blocking even though there is data to read (version 2)
...symptom I was seeing was select blocking on the spice vdagent virtio serial port even though there were messages queued up there. virtio_console's port_fops_poll checks port->inbuf != NULL to determine if read won't block. However if an application reads enough bytes from inbuf through port_fops_read, to empty the current port->inbuf, port->inbuf will be NULL even though there may be buffers left in the virtqueue. This causes poll() to block even though there is data ready to be read, this patch fixes this by using port_has_data(port) instead of the port->inbuf != NULL check. Signed-...
2010 Sep 15
1
PATCH: virtio_console: Fix poll blocking even though there is data to read (version 2)
...symptom I was seeing was select blocking on the spice vdagent virtio serial port even though there were messages queued up there. virtio_console's port_fops_poll checks port->inbuf != NULL to determine if read won't block. However if an application reads enough bytes from inbuf through port_fops_read, to empty the current port->inbuf, port->inbuf will be NULL even though there may be buffers left in the virtqueue. This causes poll() to block even though there is data ready to be read, this patch fixes this by using port_has_data(port) instead of the port->inbuf != NULL check. Signed-...