Commit 58e3ce76 authored by Sishuai Gong's avatar Sishuai Gong Committed by Dominique Martinet
Browse files

9p/trans_fd: avoid sending req to a cancelled conn



When a connection is cancelled by p9_conn_cancel(), all requests on it
should be cancelled---mark req->status as REQ_STATUS_ERROR. However,
because a race over m->err between p9_conn_cancel() and p9_fd_request(),
p9_fd_request might see the old value of m->err, think that the connection
is NOT cancelled, and then add new requests to this cancelled connection.

Fixing this issue by lock-protecting the check on m->err.

Signed-off-by: default avatarSishuai Gong <sishuai.system@gmail.com>
Message-ID: <AA2DB53B-DFC7-4B88-9515-E4C9AFA6435D@gmail.com>
Signed-off-by: default avatarDominique Martinet <asmadeus@codewreck.org>
Reviewed-by: default avatarChristian Schoenebeck <linux_oss@crudebyte.com>
parent 05d3ef8b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment