summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-03-08 06:45:56 +0300
committerJakub Kicinski <kuba@kernel.org>2023-03-11 03:47:22 +0300
commit438b406055cd21105aad77db7938ee4720b09bee (patch)
treed0e450e07c600a067d0ef22578beb28f76368d7c /drivers
parentae913318bcc8ba2a9ae350c16605ea6e5c382a97 (diff)
downloadlinux-438b406055cd21105aad77db7938ee4720b09bee.tar.xz
tun: flag the device as supporting FMODE_NOWAIT
tun already checks for both O_NONBLOCK and IOCB_NOWAIT in its read and write iter handlers, so it's fully ready for FMODE_NOWAIT. But for some reason it doesn't set it. Rectify that oversight. Signed-off-by: Jens Axboe <axboe@kernel.dk> Link: https://lore.kernel.org/r/3f7dc1f0-79ca-d85c-4d16-8c12c5bd492d@kernel.dk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/tun.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index ad653b32b2f0..4c7f74904c25 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -3463,6 +3463,8 @@ static int tun_chr_open(struct inode *inode, struct file * file)
sock_set_flag(&tfile->sk, SOCK_ZEROCOPY);
+ /* tun groks IOCB_NOWAIT just fine, mark it as such */
+ file->f_mode |= FMODE_NOWAIT;
return 0;
}