diff options
Diffstat (limited to 'net/9p')
| -rw-r--r-- | net/9p/client.c | 24 | ||||
| -rw-r--r-- | net/9p/protocol.c | 1 | ||||
| -rw-r--r-- | net/9p/trans_fd.c | 1 | ||||
| -rw-r--r-- | net/9p/trans_rdma.c | 1 | ||||
| -rw-r--r-- | net/9p/trans_virtio.c | 1 | ||||
| -rw-r--r-- | net/9p/util.c | 1 |
6 files changed, 25 insertions, 4 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index e3e5bf4469ce..0aa79faa9850 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/poll.h> | 29 | #include <linux/poll.h> |
| 30 | #include <linux/idr.h> | 30 | #include <linux/idr.h> |
| 31 | #include <linux/mutex.h> | 31 | #include <linux/mutex.h> |
| 32 | #include <linux/slab.h> | ||
| 32 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
| 33 | #include <linux/uaccess.h> | 34 | #include <linux/uaccess.h> |
| 34 | #include <net/9p/9p.h> | 35 | #include <net/9p/9p.h> |
| @@ -71,9 +72,10 @@ inline int p9_is_proto_dotu(struct p9_client *clnt) | |||
| 71 | EXPORT_SYMBOL(p9_is_proto_dotu); | 72 | EXPORT_SYMBOL(p9_is_proto_dotu); |
| 72 | 73 | ||
| 73 | /* Interpret mount option for protocol version */ | 74 | /* Interpret mount option for protocol version */ |
| 74 | static unsigned char get_protocol_version(const substring_t *name) | 75 | static int get_protocol_version(const substring_t *name) |
| 75 | { | 76 | { |
| 76 | unsigned char version = -EINVAL; | 77 | int version = -EINVAL; |
| 78 | |||
| 77 | if (!strncmp("9p2000", name->from, name->to-name->from)) { | 79 | if (!strncmp("9p2000", name->from, name->to-name->from)) { |
| 78 | version = p9_proto_legacy; | 80 | version = p9_proto_legacy; |
| 79 | P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n"); | 81 | P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n"); |
| @@ -533,7 +535,12 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...) | |||
| 533 | 535 | ||
| 534 | P9_DPRINTK(P9_DEBUG_MUX, "client %p op %d\n", c, type); | 536 | P9_DPRINTK(P9_DEBUG_MUX, "client %p op %d\n", c, type); |
| 535 | 537 | ||
| 536 | if (c->status != Connected) | 538 | /* we allow for any status other than disconnected */ |
| 539 | if (c->status == Disconnected) | ||
| 540 | return ERR_PTR(-EIO); | ||
| 541 | |||
| 542 | /* if status is begin_disconnected we allow only clunk request */ | ||
| 543 | if ((c->status == BeginDisconnect) && (type != P9_TCLUNK)) | ||
| 537 | return ERR_PTR(-EIO); | 544 | return ERR_PTR(-EIO); |
| 538 | 545 | ||
| 539 | if (signal_pending(current)) { | 546 | if (signal_pending(current)) { |
| @@ -799,8 +806,10 @@ void p9_client_destroy(struct p9_client *clnt) | |||
| 799 | 806 | ||
| 800 | v9fs_put_trans(clnt->trans_mod); | 807 | v9fs_put_trans(clnt->trans_mod); |
| 801 | 808 | ||
| 802 | list_for_each_entry_safe(fid, fidptr, &clnt->fidlist, flist) | 809 | list_for_each_entry_safe(fid, fidptr, &clnt->fidlist, flist) { |
| 810 | printk(KERN_INFO "Found fid %d not clunked\n", fid->fid); | ||
| 803 | p9_fid_destroy(fid); | 811 | p9_fid_destroy(fid); |
| 812 | } | ||
| 804 | 813 | ||
| 805 | if (clnt->fidpool) | 814 | if (clnt->fidpool) |
| 806 | p9_idpool_destroy(clnt->fidpool); | 815 | p9_idpool_destroy(clnt->fidpool); |
| @@ -818,6 +827,13 @@ void p9_client_disconnect(struct p9_client *clnt) | |||
| 818 | } | 827 | } |
| 819 | EXPORT_SYMBOL(p9_client_disconnect); | 828 | EXPORT_SYMBOL(p9_client_disconnect); |
| 820 | 829 | ||
| 830 | void p9_client_begin_disconnect(struct p9_client *clnt) | ||
| 831 | { | ||
| 832 | P9_DPRINTK(P9_DEBUG_9P, "clnt %p\n", clnt); | ||
| 833 | clnt->status = BeginDisconnect; | ||
| 834 | } | ||
| 835 | EXPORT_SYMBOL(p9_client_begin_disconnect); | ||
| 836 | |||
| 821 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, | 837 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, |
| 822 | char *uname, u32 n_uname, char *aname) | 838 | char *uname, u32 n_uname, char *aname) |
| 823 | { | 839 | { |
diff --git a/net/9p/protocol.c b/net/9p/protocol.c index 94f5a8f65e9c..e7541d5b0118 100644 --- a/net/9p/protocol.c +++ b/net/9p/protocol.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
| 29 | #include <linux/errno.h> | 29 | #include <linux/errno.h> |
| 30 | #include <linux/uaccess.h> | 30 | #include <linux/uaccess.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | #include <linux/sched.h> | 32 | #include <linux/sched.h> |
| 32 | #include <linux/types.h> | 33 | #include <linux/types.h> |
| 33 | #include <net/9p/9p.h> | 34 | #include <net/9p/9p.h> |
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 31d0b05582a9..98ce9bcb0e15 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #include <linux/idr.h> | 38 | #include <linux/idr.h> |
| 39 | #include <linux/file.h> | 39 | #include <linux/file.h> |
| 40 | #include <linux/parser.h> | 40 | #include <linux/parser.h> |
| 41 | #include <linux/slab.h> | ||
| 41 | #include <net/9p/9p.h> | 42 | #include <net/9p/9p.h> |
| 42 | #include <net/9p/client.h> | 43 | #include <net/9p/client.h> |
| 43 | #include <net/9p/transport.h> | 44 | #include <net/9p/transport.h> |
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 2c95a89c0f46..041101ab4aa5 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c | |||
| @@ -40,6 +40,7 @@ | |||
| 40 | #include <linux/file.h> | 40 | #include <linux/file.h> |
| 41 | #include <linux/parser.h> | 41 | #include <linux/parser.h> |
| 42 | #include <linux/semaphore.h> | 42 | #include <linux/semaphore.h> |
| 43 | #include <linux/slab.h> | ||
| 43 | #include <net/9p/9p.h> | 44 | #include <net/9p/9p.h> |
| 44 | #include <net/9p/client.h> | 45 | #include <net/9p/client.h> |
| 45 | #include <net/9p/transport.h> | 46 | #include <net/9p/transport.h> |
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index afde1a89fbb3..7eb78ecc1618 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #include <linux/inet.h> | 37 | #include <linux/inet.h> |
| 38 | #include <linux/idr.h> | 38 | #include <linux/idr.h> |
| 39 | #include <linux/file.h> | 39 | #include <linux/file.h> |
| 40 | #include <linux/slab.h> | ||
| 40 | #include <net/9p/9p.h> | 41 | #include <net/9p/9p.h> |
| 41 | #include <linux/parser.h> | 42 | #include <linux/parser.h> |
| 42 | #include <net/9p/client.h> | 43 | #include <net/9p/client.h> |
diff --git a/net/9p/util.c b/net/9p/util.c index dc4ec05ad93d..e048701a72d2 100644 --- a/net/9p/util.c +++ b/net/9p/util.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/sched.h> | 30 | #include <linux/sched.h> |
| 31 | #include <linux/parser.h> | 31 | #include <linux/parser.h> |
| 32 | #include <linux/idr.h> | 32 | #include <linux/idr.h> |
| 33 | #include <linux/slab.h> | ||
| 33 | #include <net/9p/9p.h> | 34 | #include <net/9p/9p.h> |
| 34 | 35 | ||
| 35 | /** | 36 | /** |
