]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Revert "UBUNTU: SAUCE: (noup) fuse: do not use iocb after it may have been freed"
authorTim Gardner <tim.gardner@canonical.com>
Wed, 20 Apr 2016 20:35:53 +0000 (14:35 -0600)
committerTim Gardner <tim.gardner@canonical.com>
Thu, 21 Apr 2016 12:53:21 +0000 (06:53 -0600)
BugLink: http://bugs.launchpad.net/bugs/1572722
This reverts commit 41506ac0665dcb99ea113147eaac219f32499e46.

use upstream stable patch

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/fuse/file.c

index 65ca924ef41c17102a724901f23a0bddf736f168..119f35ffeb1a56c86f36b9a2e94f812033756167 100644 (file)
@@ -2798,7 +2798,6 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
        loff_t i_size;
        size_t count = iov_iter_count(iter);
        struct fuse_io_priv *io;
-       bool is_sync = is_sync_kiocb(iocb);
 
        pos = offset;
        inode = file->f_mapping->host;
@@ -2838,11 +2837,11 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
         * to wait on real async I/O requests, so we must submit this request
         * synchronously.
         */
-       if (!is_sync && (offset + count > i_size) &&
+       if (!is_sync_kiocb(iocb) && (offset + count > i_size) &&
            iov_iter_rw(iter) == WRITE)
                io->async = false;
 
-       if (io->async && is_sync)
+       if (io->async && is_sync_kiocb(iocb))
                io->done = &wait;
 
        if (iov_iter_rw(iter) == WRITE) {
@@ -2856,7 +2855,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
                fuse_aio_complete(io, ret < 0 ? ret : 0, -1);
 
                /* we have a non-extending, async request, so return */
-               if (!is_sync)
+               if (!is_sync_kiocb(iocb))
                        return -EIOCBQUEUED;
 
                wait_for_completion(&wait);