]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
fuse: move list_del_init() from request_end() into callers
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 1 Jul 2015 14:26:04 +0000 (16:26 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 1 Jul 2015 14:26:04 +0000 (16:26 +0200)
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/fuse/dev.c

index 6321d761c3c373a3a00c981c0e81191c755871c8..98568bd2d81bde6902789fc73d2cb82e72ca5a80 100644 (file)
@@ -385,7 +385,6 @@ __releases(fc->lock)
        struct fuse_iqueue *fiq = &fc->iq;
        void (*end) (struct fuse_conn *, struct fuse_req *) = req->end;
        req->end = NULL;
-       list_del_init(&req->list);
        spin_lock(&fiq->waitq.lock);
        list_del_init(&req->intr_entry);
        spin_unlock(&fiq->waitq.lock);
@@ -1291,6 +1290,7 @@ static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
                /* SETXATTR is special, since it may contain too large data */
                if (in->h.opcode == FUSE_SETXATTR)
                        req->out.h.error = -E2BIG;
+               list_del_init(&req->list);
                request_end(fc, req);
                goto restart;
        }
@@ -1304,15 +1304,18 @@ static ssize_t fuse_dev_do_read(struct fuse_conn *fc, struct file *file,
        spin_lock(&fc->lock);
        clear_bit(FR_LOCKED, &req->flags);
        if (!fpq->connected) {
+               list_del_init(&req->list);
                request_end(fc, req);
                return -ENODEV;
        }
        if (err) {
                req->out.h.error = -EIO;
+               list_del_init(&req->list);
                request_end(fc, req);
                return err;
        }
        if (!test_bit(FR_ISREPLY, &req->flags)) {
+               list_del_init(&req->list);
                request_end(fc, req);
        } else {
                list_move_tail(&req->list, &fpq->processing);
@@ -1932,6 +1935,7 @@ static ssize_t fuse_dev_do_write(struct fuse_conn *fc,
                err = -ENOENT;
        else if (err)
                req->out.h.error = -EIO;
+       list_del_init(&req->list);
        request_end(fc, req);
 
        return err ? err : nbytes;
@@ -2073,6 +2077,7 @@ __acquires(fc->lock)
                req->out.h.error = -ECONNABORTED;
                clear_bit(FR_PENDING, &req->flags);
                clear_bit(FR_SENT, &req->flags);
+               list_del_init(&req->list);
                request_end(fc, req);
                spin_lock(&fc->lock);
        }
@@ -2150,6 +2155,7 @@ void fuse_abort_conn(struct fuse_conn *fc)
                while (!list_empty(&to_end1)) {
                        req = list_first_entry(&to_end1, struct fuse_req, list);
                        __fuse_get_request(req);
+                       list_del_init(&req->list);
                        request_end(fc, req);
                        spin_lock(&fc->lock);
                }