Commit 52cbee2a authored by Sergey Alirzaev's avatar Sergey Alirzaev Committed by Dominique Martinet

9p: read only once on O_NONBLOCK

A proper way to handle O_NONBLOCK would be making the requests and
responses happen asynchronously, but this would require serious code
refactoring.

Link: http://lkml.kernel.org/r/20200205003457.24340-2-l29ah@cock.liSigned-off-by: default avatarSergey Alirzaev <l29ah@cock.li>
Signed-off-by: default avatarDominique Martinet <dominique.martinet@cea.fr>
parent 388f6966
...@@ -388,6 +388,9 @@ v9fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) ...@@ -388,6 +388,9 @@ v9fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
p9_debug(P9_DEBUG_VFS, "count %zu offset %lld\n", p9_debug(P9_DEBUG_VFS, "count %zu offset %lld\n",
iov_iter_count(to), iocb->ki_pos); iov_iter_count(to), iocb->ki_pos);
if (iocb->ki_filp->f_flags & O_NONBLOCK)
ret = p9_client_read_once(fid, iocb->ki_pos, to, &err);
else
ret = p9_client_read(fid, iocb->ki_pos, to, &err); ret = p9_client_read(fid, iocb->ki_pos, to, &err);
if (!ret) if (!ret)
return err; return err;
......
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