Skip to content

Commit 438b406

Browse files
axboekuba-moo
authored andcommitted
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>
1 parent ae91331 commit 438b406

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/tun.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3463,6 +3463,8 @@ static int tun_chr_open(struct inode *inode, struct file * file)
34633463

34643464
sock_set_flag(&tfile->sk, SOCK_ZEROCOPY);
34653465

3466+
/* tun groks IOCB_NOWAIT just fine, mark it as such */
3467+
file->f_mode |= FMODE_NOWAIT;
34663468
return 0;
34673469
}
34683470

0 commit comments

Comments
 (0)