diff mbox series

tun: flag the device as supporting FMODE_NOWAIT

Message ID 3f7dc1f0-79ca-d85c-4d16-8c12c5bd492d@kernel.dk (mailing list archive)
State Accepted
Commit 438b406055cd21105aad77db7938ee4720b09bee
Delegated to: Netdev Maintainers
Headers show
Series tun: flag the device as supporting FMODE_NOWAIT | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 20 this patch: 20
netdev/cc_maintainers warning 2 maintainers not CCed: pabeni@redhat.com davem@davemloft.net
netdev/build_clang success Errors and warnings before: 18 this patch: 18
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 20 this patch: 20
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jens Axboe March 8, 2023, 3:45 a.m. UTC
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>

---

Comments

patchwork-bot+netdevbpf@kernel.org March 11, 2023, 12:50 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 7 Mar 2023 20:45:56 -0700 you wrote:
> 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>
> 
> 
> [...]

Here is the summary with links:
  - tun: flag the device as supporting FMODE_NOWAIT
    https://git.kernel.org/netdev/net-next/c/438b406055cd

You are awesome, thank you!
diff mbox series

Patch

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;
 }