aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/9p/client.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/net/9p/client.c b/net/9p/client.c
index 6e6b928a597..0aa79faa985 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -72,9 +72,10 @@ inline int p9_is_proto_dotu(struct p9_client *clnt)
72EXPORT_SYMBOL(p9_is_proto_dotu); 72EXPORT_SYMBOL(p9_is_proto_dotu);
73 73
74/* Interpret mount option for protocol version */ 74/* Interpret mount option for protocol version */
75static unsigned char get_protocol_version(const substring_t *name) 75static int get_protocol_version(const substring_t *name)
76{ 76{
77 unsigned char version = -EINVAL; 77 int version = -EINVAL;
78
78 if (!strncmp("9p2000", name->from, name->to-name->from)) { 79 if (!strncmp("9p2000", name->from, name->to-name->from)) {
79 version = p9_proto_legacy; 80 version = p9_proto_legacy;
80 P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n"); 81 P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n");
@@ -534,7 +535,12 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
534 535
535 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);
536 537
537 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))
538 return ERR_PTR(-EIO); 544 return ERR_PTR(-EIO);
539 545
540 if (signal_pending(current)) { 546 if (signal_pending(current)) {
@@ -800,8 +806,10 @@ void p9_client_destroy(struct p9_client *clnt)
800 806
801 v9fs_put_trans(clnt->trans_mod); 807 v9fs_put_trans(clnt->trans_mod);
802 808
803 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);
804 p9_fid_destroy(fid); 811 p9_fid_destroy(fid);
812 }
805 813
806 if (clnt->fidpool) 814 if (clnt->fidpool)
807 p9_idpool_destroy(clnt->fidpool); 815 p9_idpool_destroy(clnt->fidpool);
@@ -819,6 +827,13 @@ void p9_client_disconnect(struct p9_client *clnt)
819} 827}
820EXPORT_SYMBOL(p9_client_disconnect); 828EXPORT_SYMBOL(p9_client_disconnect);
821 829
830void p9_client_begin_disconnect(struct p9_client *clnt)
831{
832 P9_DPRINTK(P9_DEBUG_9P, "clnt %p\n", clnt);
833 clnt->status = BeginDisconnect;
834}
835EXPORT_SYMBOL(p9_client_begin_disconnect);
836
822struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, 837struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
823 char *uname, u32 n_uname, char *aname) 838 char *uname, u32 n_uname, char *aname)
824{ 839{