Skip to content

Commit

Permalink
net/9p: Handle mount errors correctly.
Browse files Browse the repository at this point in the history
With this patch we have

# mount -t 9p -o trans=virtio virtio2 /mnt/
# mount -t 9p -o trans=virtio virtio2 /mnt/
mount: virtio2 already mounted or /mnt/ busy
mount: according to mtab, virtio2 is already mounted on /mnt
# mount -t 9p -o trans=virtio virtio3 /mnt/ -o debug=0xfff
mount: special device virtio3 does not exist

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
  • Loading branch information
Aneesh Kumar K.V authored and Eric Van Hensbergen committed Mar 5, 2010
1 parent 37c1209 commit c1a7c22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/9p/trans_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ static int
p9_virtio_create(struct p9_client *client, const char *devname, char *args)
{
struct virtio_chan *chan;
int ret = -ENOENT;
int found = 0;

mutex_lock(&virtio_9p_lock);
Expand All @@ -289,13 +290,14 @@ p9_virtio_create(struct p9_client *client, const char *devname, char *args)
found = 1;
break;
}
ret = -EBUSY;
}
}
mutex_unlock(&virtio_9p_lock);

if (!found) {
printk(KERN_ERR "9p: no channels available\n");
return -ENODEV;
return ret;
}

client->trans = (void *)chan;
Expand Down

0 comments on commit c1a7c22

Please sign in to comment.