]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
fuse: flush background queue on connection close
authorMiklos Szeredi <mszeredi@suse.cz>
Tue, 7 Sep 2010 11:42:41 +0000 (13:42 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Sep 2010 20:36:14 +0000 (13:36 -0700)
commitb7a83862f3f9b3b95719a5c3dafacdf2bb52ddda
tree2e4929cf77cbd8a1380c62b7473aeababd644e39
parenteddbe634c915e5243906558cd091a00988b86b00
fuse: flush background queue on connection close

commit 595afaf9e6ee1b48e13ec4b8bcc8c7dee888161a upstream.

David Bartly reported that fuse can hang in fuse_get_req_nofail() when
the connection to the filesystem server is no longer active.

If bg_queue is not empty then flush_bg_queue() called from
request_end() can put more requests on to the pending queue.  If this
happens while ending requests on the processing queue then those
background requests will be queued to the pending list and never
ended.

Another problem is that fuse_dev_release() didn't wake up processes
sleeping on blocked_waitq.

Solve this by:

 a) flushing the background queue before calling end_requests() on the
    pending and processing queues

 b) setting blocked = 0 and waking up processes waiting on
    blocked_waitq()

Thanks to David for an excellent bug report.

Reported-by: David Bartley <andareed@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/fuse/dev.c