aboutsummaryrefslogtreecommitdiffstats
path: root/net/9p
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-04-05 16:42:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-04-05 16:42:54 -0400
commit749d229761ff0135cc4e16b8a28b41ae2f6b2c35 (patch)
tree25551c8cfb38319211f5ee59e78462a0f6fb85c4 /net/9p
parent795d580baec0d5386b83a8b557df47c20810e86b (diff)
parent3dc9fef67f6292692dba181a6d0fd0211bd0a607 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs: 9p: saving negative to unsigned char 9p: return on mutex_lock_interruptible() 9p: Creating files with names too long should fail with ENAMETOOLONG. 9p: Make sure we are able to clunk the cached fid on umount 9p: drop nlink remove fs/9p: Clunk the fid resulting from partial walk of the name 9p: documentation update 9p: Fix setting of protocol flags in v9fs_session_info structure.
Diffstat (limited to 'net/9p')
-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 6e6b928a5972..0aa79faa9850 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{