# 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/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-gcc --version # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-ld --version # < git log --format=%s --max-count=1 ee5e001196d1345b8fee25925ff5f1d67936081e # < make -s -j 8 ARCH=powerpc O=/kisskb/build/linus_ppc44x_defconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- ppc44x_defconfig # make -s -j 8 ARCH=powerpc O=/kisskb/build/linus_ppc44x_defconfig_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:186:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c: In function 'proc_reg_open': /kisskb/src/include/linux/list.h:65:12: warning: 'pdeo' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c:339:21: note: 'pdeo' was declared here /kisskb/src/net/bridge/br_netlink.c: In function 'br_afspec.isra.35': /kisskb/src/net/bridge/br_netlink.c:652:7: warning: 'err' may be used uninitialized in this function [-Wuninitialized] /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 [-Wuninitialized] /kisskb/src/drivers/net/tun.c: In function 'tun_get_user': /kisskb/src/drivers/net/tun.c:1845:30: warning: 'copylen' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/tun.c:1755:46: warning: 'linear' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c: In function 'univ8250_release_irq': /kisskb/src/drivers/tty/serial/8250/8250_core.c:247:18: warning: 'i' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c:227:19: note: 'i' was declared here /kisskb/src/arch/powerpc/boot/dts/katmai.dts:322.26-361.5: Warning (pci_bridge): /plb/pciex@d00000000: node name is not "pci" or "pcie" /kisskb/src/arch/powerpc/boot/dts/katmai.dts:363.26-402.5: Warning (pci_bridge): /plb/pciex@d20000000: node name is not "pci" or "pcie" /kisskb/src/arch/powerpc/boot/dts/katmai.dts:404.26-443.5: Warning (pci_bridge): /plb/pciex@d40000000: node name is not "pci" or "pcie" arch/powerpc/boot/dts/katmai.dtb: Warning (pci_device_bus_num): Failed prerequisite 'pci_bridge' INFO: Uncompressed kernel (size 0x551854) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x551854) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x551854) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x551854) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5411a8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) Image Name: Linux-5.0.0-gee5e001196d1 Created: Tue Mar 5 14:03:04 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2683921 Bytes = 2621.02 KiB = 2.56 MiB Load Address: 00000000 Entry Point: 00000000 INFO: Uncompressed kernel (size 0x551854) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x551854) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) Image Name: Linux-5.0.0-gee5e001196d1 Created: Tue Mar 5 14:03:04 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2716722 Bytes = 2653.05 KiB = 2.59 MiB Load Address: 00600000 Entry Point: 006000c8 INFO: Uncompressed kernel (size 0x551854) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x551854) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x551854) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x551854) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x551854) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) Image Name: Linux-5.0.0-gee5e001196d1 Created: Tue Mar 5 14:03:04 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2716349 Bytes = 2652.68 KiB = 2.59 MiB Load Address: 00600000 Entry Point: 006001bc Image Name: Linux-5.0.0-gee5e001196d1 Created: Tue Mar 5 14:03:04 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2716059 Bytes = 2652.40 KiB = 2.59 MiB Load Address: 00600000 Entry Point: 006014e0 Image Name: Linux-5.0.0-gee5e001196d1 Created: Tue Mar 5 14:03:04 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2716743 Bytes = 2653.07 KiB = 2.59 MiB Load Address: 00600000 Entry Point: 006014e0 Image Name: Linux-5.0.0-gee5e001196d1 Created: Tue Mar 5 14:03:04 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2716524 Bytes = 2652.86 KiB = 2.59 MiB Load Address: 00600000 Entry Point: 006014e0 Image Name: Linux-5.0.0-gee5e001196d1 Created: Tue Mar 5 14:03:04 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2716755 Bytes = 2653.08 KiB = 2.59 MiB Load Address: 00600000 Entry Point: 006014d8 Image Name: Linux-5.0.0-gee5e001196d1 Created: Tue Mar 5 14:03:04 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2716764 Bytes = 2653.09 KiB = 2.59 MiB Load Address: 00600000 Entry Point: 006014c0 Image Name: Linux-5.0.0-gee5e001196d1 Created: Tue Mar 5 14:03:04 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2716419 Bytes = 2652.75 KiB = 2.59 MiB Load Address: 00600000 Entry Point: 006014cc Image Name: Linux-5.0.0-gee5e001196d1 Created: Tue Mar 5 14:03:04 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2716455 Bytes = 2652.79 KiB = 2.59 MiB Load Address: 00600000 Entry Point: 006014ec Completed OK # rm -rf /kisskb/build/linus_ppc44x_defconfig_powerpc-gcc4.6 # Build took: 0:01:03.094044