Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218939
b: refs/heads/master
c: 4f7ebe8
h: refs/heads/master
i:
  218937: d49eb3d
  218935: 4c6f581
v: v3
  • Loading branch information
Arun R Bharadwaj authored and Eric Van Hensbergen committed Oct 28, 2010
1 parent 22e2cf2 commit ae7843d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7c7298cffc8f4417c95117c2a432f962c066499d
refs/heads/master: 4f7ebe807242898ee08ed732d56982874442c304
4 changes: 4 additions & 0 deletions trunk/include/net/9p/9p.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ do { \

/**
* enum p9_msg_t - 9P message types
* @P9_TLERROR: not used
* @P9_RLERROR: response for any failed request for 9P2000.L
* @P9_TSTATFS: file system status request
* @P9_RSTATFS: file system status response
* @P9_TSYMLINK: make symlink request
Expand Down Expand Up @@ -137,6 +139,8 @@ do { \
*/

enum p9_msg_t {
P9_TLERROR = 6,
P9_RLERROR,
P9_TSTATFS = 8,
P9_RSTATFS,
P9_TLOPEN = 12,
Expand Down
43 changes: 27 additions & 16 deletions trunk/net/9p/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,32 +450,43 @@ static int p9_check_errors(struct p9_client *c, struct p9_req_t *req)
return err;
}

if (type == P9_RERROR) {
if (type == P9_RERROR || type == P9_RLERROR) {
int ecode;
char *ename;

err = p9pdu_readf(req->rc, c->proto_version, "s?d",
&ename, &ecode);
if (err) {
P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse error%d\n",
err);
return err;
}
if (!p9_is_proto_dotl(c)) {
char *ename;

if (p9_is_proto_dotu(c) ||
p9_is_proto_dotl(c))
err = -ecode;
err = p9pdu_readf(req->rc, c->proto_version, "s?d",
&ename, &ecode);
if (err)
goto out_err;

if (!err || !IS_ERR_VALUE(err))
err = p9_errstr2errno(ename, strlen(ename));
if (p9_is_proto_dotu(c))
err = -ecode;

P9_DPRINTK(P9_DEBUG_9P, "<<< RERROR (%d) %s\n", -ecode, ename);
if (!err || !IS_ERR_VALUE(err)) {
err = p9_errstr2errno(ename, strlen(ename));

P9_DPRINTK(P9_DEBUG_9P, "<<< RERROR (%d) %s\n", -ecode, ename);

kfree(ename);
}
} else {
err = p9pdu_readf(req->rc, c->proto_version, "d", &ecode);
err = -ecode;

P9_DPRINTK(P9_DEBUG_9P, "<<< RLERROR (%d)\n", -ecode);
}

kfree(ename);
} else
err = 0;

return err;

out_err:
P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse error%d\n", err);

return err;
}

/**
Expand Down

0 comments on commit ae7843d

Please sign in to comment.