diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2010-02-15 17:27:02 +0000 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2010-03-05 15:04:41 -0600 |
commit | c1a7c2262035e83a8f70ebe1328b3451702cf51b (patch) | |
tree | e5bdb780478c839c20099cc3b5f6ecce7f88c0ea /net/9p/trans_virtio.c | |
parent | 37c1209d413242d9560e343c040777049a8dd869 (diff) | |
download | op-kernel-dev-c1a7c2262035e83a8f70ebe1328b3451702cf51b.zip op-kernel-dev-c1a7c2262035e83a8f70ebe1328b3451702cf51b.tar.gz |
net/9p: Handle mount errors correctly.
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>
Diffstat (limited to 'net/9p/trans_virtio.c')
-rw-r--r-- | net/9p/trans_virtio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 05918d3..0aaed48 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -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); @@ -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; |