diff options
-rw-r--r-- | include/net/9p/9p.h | 4 | ||||
-rw-r--r-- | net/9p/client.c | 43 |
2 files changed, 31 insertions, 16 deletions
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index a8de812ccbc8..a4a1b043a8c4 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h | |||
@@ -86,6 +86,8 @@ do { \ | |||
86 | 86 | ||
87 | /** | 87 | /** |
88 | * enum p9_msg_t - 9P message types | 88 | * enum p9_msg_t - 9P message types |
89 | * @P9_TLERROR: not used | ||
90 | * @P9_RLERROR: response for any failed request for 9P2000.L | ||
89 | * @P9_TSTATFS: file system status request | 91 | * @P9_TSTATFS: file system status request |
90 | * @P9_RSTATFS: file system status response | 92 | * @P9_RSTATFS: file system status response |
91 | * @P9_TSYMLINK: make symlink request | 93 | * @P9_TSYMLINK: make symlink request |
@@ -137,6 +139,8 @@ do { \ | |||
137 | */ | 139 | */ |
138 | 140 | ||
139 | enum p9_msg_t { | 141 | enum p9_msg_t { |
142 | P9_TLERROR = 6, | ||
143 | P9_RLERROR, | ||
140 | P9_TSTATFS = 8, | 144 | P9_TSTATFS = 8, |
141 | P9_RSTATFS, | 145 | P9_RSTATFS, |
142 | P9_TLOPEN = 12, | 146 | P9_TLOPEN = 12, |
diff --git a/net/9p/client.c b/net/9p/client.c index 83bf0541d66f..c155cc45eff9 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -450,32 +450,43 @@ static int p9_check_errors(struct p9_client *c, struct p9_req_t *req) | |||
450 | return err; | 450 | return err; |
451 | } | 451 | } |
452 | 452 | ||
453 | if (type == P9_RERROR) { | 453 | if (type == P9_RERROR || type == P9_RLERROR) { |
454 | int ecode; | 454 | int ecode; |
455 | char *ename; | ||
456 | 455 | ||
457 | err = p9pdu_readf(req->rc, c->proto_version, "s?d", | 456 | if (!p9_is_proto_dotl(c)) { |
458 | &ename, &ecode); | 457 | char *ename; |
459 | if (err) { | ||
460 | P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse error%d\n", | ||
461 | err); | ||
462 | return err; | ||
463 | } | ||
464 | 458 | ||
465 | if (p9_is_proto_dotu(c) || | 459 | err = p9pdu_readf(req->rc, c->proto_version, "s?d", |
466 | p9_is_proto_dotl(c)) | 460 | &ename, &ecode); |
467 | err = -ecode; | 461 | if (err) |
462 | goto out_err; | ||
468 | 463 | ||
469 | if (!err || !IS_ERR_VALUE(err)) | 464 | if (p9_is_proto_dotu(c)) |
470 | err = p9_errstr2errno(ename, strlen(ename)); | 465 | err = -ecode; |
471 | 466 | ||
472 | P9_DPRINTK(P9_DEBUG_9P, "<<< RERROR (%d) %s\n", -ecode, ename); | 467 | if (!err || !IS_ERR_VALUE(err)) { |
468 | err = p9_errstr2errno(ename, strlen(ename)); | ||
469 | |||
470 | P9_DPRINTK(P9_DEBUG_9P, "<<< RERROR (%d) %s\n", -ecode, ename); | ||
471 | |||
472 | kfree(ename); | ||
473 | } | ||
474 | } else { | ||
475 | err = p9pdu_readf(req->rc, c->proto_version, "d", &ecode); | ||
476 | err = -ecode; | ||
477 | |||
478 | P9_DPRINTK(P9_DEBUG_9P, "<<< RLERROR (%d)\n", -ecode); | ||
479 | } | ||
473 | 480 | ||
474 | kfree(ename); | ||
475 | } else | 481 | } else |
476 | err = 0; | 482 | err = 0; |
477 | 483 | ||
478 | return err; | 484 | return err; |
485 | |||
486 | out_err: | ||
487 | P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse error%d\n", err); | ||
488 | |||
489 | return err; | ||
479 | } | 490 | } |
480 | 491 | ||
481 | /** | 492 | /** |