Commit 1d15c6c6 authored by Tim Gardner's avatar Tim Gardner

Revert "UBUNTU: SAUCE: (noup) fuse: do not use iocb after it may have been freed"

BugLink: http://bugs.launchpad.net/bugs/1572722

This reverts commit 41506ac0.

use upstream stable patch
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 22495eff
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment