]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tun: honor IOCB_NOWAIT flag
authorJens Axboe <axboe@kernel.dk>
Fri, 20 Nov 2020 14:59:54 +0000 (07:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Dec 2020 09:17:33 +0000 (10:17 +0100)
commitd1bea88509fb84852593cacbd5f3c59501936c3c
tree285537dd2b0e3ef51f61bac358c75b039e3d644e
parent2d375e703f00a2ac60f6530b8dc924bdcfac4ef4
tun: honor IOCB_NOWAIT flag

[ Upstream commit 5aac0390a63b8718237a61dd0d24a29201d1c94a ]

tun only checks the file O_NONBLOCK flag, but it should also be checking
the iocb IOCB_NOWAIT flag. Any fops using ->read/write_iter() should check
both, otherwise it breaks users that correctly expect O_NONBLOCK semantics
if IOCB_NOWAIT is set.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/r/e9451860-96cc-c7c7-47b8-fe42cadd5f4c@kernel.dk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/tun.c