diff options
author | Simon Derr <simon.derr@bull.net> | 2012-09-17 15:16:28 +0200 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2012-09-17 14:54:11 -0500 |
commit | 0462194d358c2e040282d4d1a4fd1aab84417e42 (patch) | |
tree | b89845ce0e5bccbbf681b12e07cc4d4c72105c2c /fs/nfsd/Makefile | |
parent | e549c1337133e85a6d6bc868d2d141a61a80975c (diff) | |
download | linux-0462194d358c2e040282d4d1a4fd1aab84417e42.tar.bz2 |
9P: Fix race in p9_read_work()
Race scenario between p9_read_work() and p9_poll_mux()
Data arrive, Rworksched is set, p9_read_work() is called.
thread A thread B
p9_read_work()
.
reads data
.
checks if new data ready. No.
.
gets preempted
.
More data arrive, p9_poll_mux() is called. .
.
.
p9_poll_mux() .
.
if (!test_and_set_bit(Rworksched, .
&m->wsched)) { .
schedule_work(&m->rq); .
} .
.
-> does not schedule work because .
Rworksched is set .
.
clear_bit(Rworksched, &m->wsched);
return;
No work has been scheduled, and yet data are waiting.
Currently p9_read_work() checks if there is data to read,
and if not, it clears Rworksched.
I think it should clear Rworksched first, and then check if there is data to read.
Signed-off-by: Simon Derr <simon.derr@bull.net>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/nfsd/Makefile')
0 files changed, 0 insertions, 0 deletions