From: Miklos Szeredi Date: Tue, 17 Jan 2006 06:14:25 +0000 (-0800) Subject: [PATCH] fuse: fuse_copy_finish() order fix X-Git-Tag: v2.6.16-rc1~61 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=222f1d69183f10d70a37de5785698fe0aa363c12;p=linux-2.6 [PATCH] fuse: fuse_copy_finish() order fix fuse_copy_finish() must be called before request_end(), since the later might sleep, and no sleeping is allowed between fuse_copy_one() and fuse_copy_finish() because of kmap_atomic()/kunmap_atomic() used in them. Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index e08ab4702d..9af88953db 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -773,8 +773,10 @@ static ssize_t fuse_dev_writev(struct file *file, const struct iovec *iov, list_del_init(&req->list); if (req->interrupted) { - request_end(fc, req); + spin_unlock(&fuse_lock); fuse_copy_finish(&cs); + spin_lock(&fuse_lock); + request_end(fc, req); return -ENOENT; } req->out.h = oh;