diff options
| author | Brian Foster <bfoster@redhat.com> | 2013-05-30 15:35:50 -0400 |
|---|---|---|
| committer | TARKZiM <tom8476oo@gmail.com> | 2021-08-25 14:54:57 +0800 |
| commit | 1efecfa82147b098bb99fc5d33f426b5b0c6aeae (patch) | |
| tree | d5ba00eecce4a7fa4aa6a553c3861437b8d97cbf | |
| parent | c414ab2e539d61ef700dc98b6da5b2fa7508eea9 (diff) | |
fuse: return -EIOCBQUEUED from fuse_direct_IO() for all async requests
If request submission fails for an async request (i.e.,
get_user_pages() returns -ERESTARTSYS), we currently skip the
-EIOCBQUEUED return and drop into wait_for_sync_kiocb() forever.
Avoid this by always returning -EIOCBQUEUED for async requests. If
an error occurs, the error is passed into fuse_aio_complete(),
returned via aio_complete() and thus propagated to userspace via
io_getevents().
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Maxim Patlasov <MPatlasov@parallels.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Change-Id: Ia3cd16c73f4f1f34f6e504806ccc934c1c17d7a2
| -rw-r--r-- | fs/fuse/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 5a41db1340a..f65988c7876 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -2471,7 +2471,7 @@ fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, fuse_aio_complete(io, ret < 0 ? ret : 0, -1); /* we have a non-extending, async request, so return */ - if (ret > 0 && !is_sync_kiocb(iocb)) + if (!is_sync_kiocb(iocb)) return -EIOCBQUEUED; ret = wait_on_sync_kiocb(iocb); |
