9p: forgetting to cancel request on interrupted zero-copy RPC
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 4 Jul 2015 20:04:19 +0000 (16:04 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 12 Aug 2015 14:33:19 +0000 (16:33 +0200)
commit a84b69cb6e0a41e86bc593904faa6def3b957343 upstream.

If we'd already sent a request and decide to abort it, we *must*
issue TFLUSH properly and not just blindly reuse the tag, or
we'll get seriously screwed when response eventually arrives
and we confuse it for response to later request that had reused
the same tag.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/9p/client.c

index 854ca7a..e958178 100644 (file)
@@ -824,7 +824,8 @@ static struct p9_req_t *p9_client_zc_rpc(struct p9_client *c, int8_t type,
        if (err < 0) {
                if (err == -EIO)
                        c->status = Disconnected;
-               goto reterr;
+               if (err != -ERESTARTSYS)
+                       goto reterr;
        }
        if (req->status == REQ_STATUS_ERROR) {
                P9_DPRINTK(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err);