2006-01-14 00:41:29

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 02/17] 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 <[email protected]>

Index: linux/fs/fuse/dev.c
===================================================================
--- linux.orig/fs/fuse/dev.c 2006-01-13 21:52:16.000000000 +0100
+++ linux/fs/fuse/dev.c 2006-01-13 22:51:43.000000000 +0100
@@ -773,8 +773,10 @@ static ssize_t fuse_dev_writev(struct fi

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;

--