Merge branch 'misc.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-2.6-microblaze.git] / fs / fuse / dev.c
index a5ceccc..dde341a 100644 (file)
@@ -91,7 +91,7 @@ static void fuse_drop_waiting(struct fuse_conn *fc)
 {
        /*
         * lockess check of fc->connected is okay, because atomic_dec_and_test()
-        * provides a memory barrier mached with the one in fuse_wait_aborted()
+        * provides a memory barrier matched with the one in fuse_wait_aborted()
         * to ensure no wake-up is missed.
         */
        if (atomic_dec_and_test(&fc->num_waiting) &&
@@ -288,10 +288,10 @@ void fuse_request_end(struct fuse_req *req)
 
        /*
         * test_and_set_bit() implies smp_mb() between bit
-        * changing and below intr_entry check. Pairs with
+        * changing and below FR_INTERRUPTED check. Pairs with
         * smp_mb() from queue_interrupt().
         */
-       if (!list_empty(&req->intr_entry)) {
+       if (test_bit(FR_INTERRUPTED, &req->flags)) {
                spin_lock(&fiq->lock);
                list_del_init(&req->intr_entry);
                spin_unlock(&fiq->lock);
@@ -783,6 +783,7 @@ static int fuse_check_page(struct page *page)
               1 << PG_uptodate |
               1 << PG_lru |
               1 << PG_active |
+              1 << PG_workingset |
               1 << PG_reclaim |
               1 << PG_waiters))) {
                dump_page(page, "fuse: trying to steal weird page");
@@ -1271,6 +1272,15 @@ static ssize_t fuse_dev_do_read(struct fuse_dev *fud, struct file *file,
                goto restart;
        }
        spin_lock(&fpq->lock);
+       /*
+        *  Must not put request on fpq->io queue after having been shut down by
+        *  fuse_abort_conn()
+        */
+       if (!fpq->connected) {
+               req->out.h.error = err = -ECONNABORTED;
+               goto out_end;
+
+       }
        list_add(&req->list, &fpq->io);
        spin_unlock(&fpq->lock);
        cs->req = req;
@@ -1857,7 +1867,7 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud,
        }
 
        err = -EINVAL;
-       if (oh.error <= -1000 || oh.error > 0)
+       if (oh.error <= -512 || oh.error > 0)
                goto copy_finish;
 
        spin_lock(&fpq->lock);