OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
388f696
)
9p: read only once on O_NONBLOCK
author
Sergey Alirzaev
<l29ah@cock.li>
Wed, 5 Feb 2020 00:34:57 +0000
(
03:34
+0300)
committer
Dominique Martinet
<dominique.martinet@cea.fr>
Fri, 27 Mar 2020 09:29:56 +0000
(09:29 +0000)
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.li
Signed-off-by: Sergey Alirzaev <l29ah@cock.li>
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
fs/9p/vfs_file.c
patch
|
blob
|
history
diff --git
a/fs/9p/vfs_file.c
b/fs/9p/vfs_file.c
index
fe7f0bd
..
92cd1d8
100644
(file)
--- a/
fs/9p/vfs_file.c
+++ b/
fs/9p/vfs_file.c
@@
-388,7
+388,10
@@
v9fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
p9_debug(P9_DEBUG_VFS, "count %zu offset %lld\n",
iov_iter_count(to), iocb->ki_pos);
- ret = p9_client_read(fid, iocb->ki_pos, to, &err);
+ 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);
if (!ret)
return err;