]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
fuse: allow interrupt queuing without fc->lock
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 1 Jul 2015 14:26:03 +0000 (16:26 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 1 Jul 2015 14:26:03 +0000 (16:26 +0200)
commit8f7bb368dbdda76f5e98e05ee49ae2dc138fd42f
treeaea509906f365c33f54070780905f0c45b18a084
parent4ce6081260ea4c1b5bfa8ecca5cbb93eea279ad4
fuse: allow interrupt queuing without fc->lock

Interrupt is only queued after the request has been sent to userspace.
This is either done in request_wait_answer() or fuse_dev_do_read()
depending on which state the request is in at the time of the interrupt.
If it's not yet sent, then queuing the interrupt is postponed until the
request is read.  Otherwise (the request has already been read and is
waiting for an answer) the interrupt is queued immedidately.

We want to call queue_interrupt() without fc->lock protection, in which
case there can be a race between the two functions:

 - neither of them queue the interrupt (thinking the other one has already
   done it).

 - both of them queue the interrupt

The first one is prevented by adding memory barriers, the second is
prevented by checking (under fiq->waitq.lock) if the interrupt has already
been queued.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/fuse/dev.c