aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2013-04-14 22:30:15 -0400
committerRusty Russell <rusty@rustcorp.com.au>2013-04-15 01:47:39 -0400
commit74ff582cd65ad01c45f1971feac28f23b7eb2687 (patch)
treed3a4222a562e7ee16b5ac053461fb5132a3b63f6
parent285e71ea6f3583a85e27cb2b9a7d8c35d4c0d558 (diff)
virtio: console: replace EMFILE with EBUSY for already-open port
Returning EMFILE (process has too many open files) is incorrect to indicate a port is already open by another process. Use EBUSY for that. This does change what we report to userspace, but I believe userspace can look at it this way: it gets EBUSY, a new error code, instead of EMFILE. It's still an error, and that's not changing. Reported-by: Mateusz Guzik <mguzik@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r--drivers/char/virtio_console.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index f4f31fe88902..5ee776595ced 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -1036,7 +1036,7 @@ static int port_fops_open(struct inode *inode, struct file *filp)
1036 spin_lock_irq(&port->inbuf_lock); 1036 spin_lock_irq(&port->inbuf_lock);
1037 if (port->guest_connected) { 1037 if (port->guest_connected) {
1038 spin_unlock_irq(&port->inbuf_lock); 1038 spin_unlock_irq(&port->inbuf_lock);
1039 ret = -EMFILE; 1039 ret = -EBUSY;
1040 goto out; 1040 goto out;
1041 } 1041 }
1042 1042