pipe: set FMODE_NOWAIT on pipes pipe-nonblock.2 pipe-nonblock-2023-05-06
authorJens Axboe <axboe@kernel.dk>
Wed, 8 Mar 2023 00:56:28 +0000 (17:56 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 25 Apr 2023 20:08:59 +0000 (14:08 -0600)
commitafed6271f5b0d78ca1a3739c1da4aa3629b26bba
tree33691f325a88cedf1241a01e02522ee0f4c1096b
parent0f99fc513ddd28de155c58547824a9fd63daacea
pipe: set FMODE_NOWAIT on pipes

Pipes themselves do not hold the the pipe lock across IO, and hence are
safe for RWF_NOWAIT/IOCB_NOWAIT usage. The "contract" for NOWAIT is
really "should not do IO under this lock", not strictly that we cannot
block or that the below code is in any way atomic. Pipes fulfil that
criteria.

Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/pipe.c