Skip to content

Commit

Permalink
tun: flag the device as supporting FMODE_NOWAIT
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe authored and Jakub Kicinski committed Mar 11, 2023
1 parent ae91331 commit 438b406
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 438b406

Please sign in to comment.