Skip to content

Commit

Permalink
net/9p: don't allow Tflush to be interrupted
Browse files Browse the repository at this point in the history
When a signal is received while sending a Tflush, the client,
which has recursed into p9_client_rpc() while sending another request,
should wait for Rflush as long as the transport is still up.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
  • Loading branch information
Jim Garlick authored and Eric Van Hensbergen committed Feb 26, 2012
1 parent 3c761ea commit a314f27
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/9p/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,10 +740,18 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
c->status = Disconnected;
goto reterr;
}
again:
/* Wait for the response */
err = wait_event_interruptible(*req->wq,
req->status >= REQ_STATUS_RCVD);

if ((err == -ERESTARTSYS) && (c->status == Connected)
&& (type == P9_TFLUSH)) {
sigpending = 1;
clear_thread_flag(TIF_SIGPENDING);
goto again;
}

if (req->status == REQ_STATUS_ERROR) {
p9_debug(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err);
err = req->t_err;
Expand Down

0 comments on commit a314f27

Please sign in to comment.