]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
[PATCH] fuse: fuse_copy_finish() order fix
authorMiklos Szeredi <miklos@szeredi.hu>
Tue, 17 Jan 2006 06:14:25 +0000 (22:14 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 17 Jan 2006 07:15:29 +0000 (23:15 -0800)
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 <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/fuse/dev.c

index e08ab4702d97ca1099474c2833778d9e72c879b4..9af88953db692495654f48969bf23d5164fa82f0 100644 (file)
@@ -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;