From 74ff582cd65ad01c45f1971feac28f23b7eb2687 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Mon, 15 Apr 2013 12:00:15 +0930 Subject: 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 Signed-off-by: Amit Shah Signed-off-by: Rusty Russell --- drivers/char/virtio_console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) spin_lock_irq(&port->inbuf_lock); if (port->guest_connected) { spin_unlock_irq(&port->inbuf_lock); - ret = -EMFILE; + ret = -EBUSY; goto out; } -- cgit v1.2.3-59-g8ed1b