# git rev-parse -q --verify ee5e001196d1345b8fee25925ff5f1d67936081e^{commit} ee5e001196d1345b8fee25925ff5f1d67936081e already have revision, skipping fetch # git checkout -q -f -B kisskb ee5e001196d1345b8fee25925ff5f1d67936081e # git clean -qxdf # < git log -1 # commit ee5e001196d1345b8fee25925ff5f1d67936081e # Author: Slavomir Kaslev # Date: Thu Feb 7 17:45:19 2019 +0200 # # fs: Make splice() and tee() take into account O_NONBLOCK flag on pipes # # The current implementation of splice() and tee() ignores O_NONBLOCK set # on pipe file descriptors and checks only the SPLICE_F_NONBLOCK flag for # blocking on pipe arguments. This is inconsistent since splice()-ing # from/to non-pipe file descriptors does take O_NONBLOCK into # consideration. # # Fix this by promoting O_NONBLOCK, when set on a pipe, to # SPLICE_F_NONBLOCK. # # Some context for how the current implementation of splice() leads to # inconsistent behavior. In the ongoing work[1] to add VM tracing # capability to trace-cmd we stream tracing data over named FIFOs or # vsockets from guests back to the host. # # When we receive SIGINT from user to stop tracing, we set O_NONBLOCK on # the input file descriptor and set SPLICE_F_NONBLOCK for the next call to # splice(). If splice() was blocked waiting on data from the input FIFO, # after SIGINT splice() restarts with the same arguments (no # SPLICE_F_NONBLOCK) and blocks again instead of returning -EAGAIN when no # data is available. # # This differs from the splice() behavior when reading from a vsocket or # when we're doing a traditional read()/write() loop (trace-cmd's # --nosplice argument). # # With this patch applied we get the same behavior in all situations after # setting O_NONBLOCK which also matches the behavior of doing a # read()/write() loop instead of splice(). # # This change does have potential of breaking users who don't expect # EAGAIN from splice() when SPLICE_F_NONBLOCK is not set. OTOH programs # that set O_NONBLOCK and don't anticipate EAGAIN are arguably buggy[2]. # # [1] https://github.com/skaslev/trace-cmd/tree/vsock # [2] https://github.com/torvalds/linux/blob/d47e3da1759230e394096fd742aad423c291ba48/fs/read_write.c#L1425 # # Signed-off-by: Slavomir Kaslev # Reviewed-by: Steven Rostedt (VMware) # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/nds32le-linux/bin/nds32le-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/nds32le-linux/bin/nds32le-linux-ld --version # < git log --format=%s --max-count=1 ee5e001196d1345b8fee25925ff5f1d67936081e # < make -s -j 8 ARCH=nds32 O=/kisskb/build/linus_nds32-allmodconfig_nds32le CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/nds32le-linux/bin/nds32le-linux- allmodconfig # make -s -j 8 ARCH=nds32 O=/kisskb/build/linus_nds32-allmodconfig_nds32le CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/nds32le-linux/bin/nds32le-linux- /kisskb/src/drivers/input/joystick/analog.c:172:2: warning: #warning Precise timer not defined for this architecture. [-Wcpp] #warning Precise timer not defined for this architecture. ^~~~~~~ /kisskb/src/drivers/i2c/i2c-core-base.c: In function 'i2c_generic_scl_recovery': /kisskb/src/drivers/i2c/i2c-core-base.c:235:5: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] if (ret == -EOPNOTSUPP) ^ WARNING: EXPORT symbol "clear_page" [vmlinux] version generation failed, symbol will not be versioned. WARNING: EXPORT symbol "copy_page" [vmlinux] version generation failed, symbol will not be versioned. WARNING: "clear_page" [fs/ocfs2/dlm/ocfs2_dlm.ko] has no CRC! WARNING: "clear_page" [fs/ntfs/ntfs.ko] has no CRC! WARNING: "copy_page" [fs/nilfs2/nilfs2.ko] has no CRC! WARNING: "clear_page" [fs/gfs2/gfs2.ko] has no CRC! WARNING: "copy_page" [fs/fuse/fuse.ko] has no CRC! WARNING: "clear_page" [fs/fuse/fuse.ko] has no CRC! WARNING: "clear_page" [fs/exofs/libore.ko] has no CRC! WARNING: "clear_page" [fs/exofs/exofs.ko] has no CRC! WARNING: "copy_page" [fs/cachefiles/cachefiles.ko] has no CRC! WARNING: "copy_page" [fs/btrfs/btrfs.ko] has no CRC! WARNING: "clear_page" [fs/btrfs/btrfs.ko] has no CRC! WARNING: "clear_page" [drivers/scsi/sd_mod.ko] has no CRC! WARNING: "clear_page" [drivers/md/raid456.ko] has no CRC! WARNING: "clear_page" [drivers/md/dm-integrity.ko] has no CRC! WARNING: "copy_page" [drivers/gpu/drm/ttm/ttm.ko] has no CRC! WARNING: "clear_page" [drivers/gpu/drm/ttm/ttm.ko] has no CRC! WARNING: "copy_page" [drivers/block/drbd/drbd.ko] has no CRC! Completed OK # rm -rf /kisskb/build/linus_nds32-allmodconfig_nds32le # Build took: 0:16:13.261815