# git rev-parse -q --verify 2be7d348fe924f0c5583c6a805bd42cecda93104^{commit} 2be7d348fe924f0c5583c6a805bd42cecda93104 already have revision, skipping fetch # git checkout -q -f -B kisskb 2be7d348fe924f0c5583c6a805bd42cecda93104 # git clean -qxdf # < git log -1 # commit 2be7d348fe924f0c5583c6a805bd42cecda93104 # Author: Linus Torvalds # Date: Tue Nov 26 11:34:06 2019 -0800 # # Revert "vfs: properly and reliably lock f_pos in fdget_pos()" # # This reverts commit 0be0ee71816b2b6725e2b4f32ad6726c9d729777. # # I was hoping it would be benign to switch over entirely to FMODE_STREAM, # and we'd have just a couple of small fixups we'd need, but it looks like # we're not quite there yet. # # While it worked fine on both my desktop and laptop, they are fairly # similar in other respects, and run mostly the same loads. Kenneth # Crudup reports that it seems to break both his vmware installation and # the KDE upower service. In both cases apparently leading to timeouts # due to waitinmg for the f_pos lock. # # There are a number of character devices in particular that definitely # want stream-like behavior, but that currently don't get marked as # streams, and as a result get the exclusion between concurrent # read()/write() on the same file descriptor. Which doesn't work well for # them. # # The most obvious example if this is /dev/console and /dev/tty, which use # console_fops and tty_fops respectively (and ptmx_fops for the pty master # side). It may be that it's just this that causes problems, but we # clearly weren't ready yet. # # Because there's a number of other likely common cases that don't have # llseek implementations and would seem to act as stream devices: # # /dev/fuse (fuse_dev_operations) # /dev/mcelog (mce_chrdev_ops) # /dev/mei0 (mei_fops) # /dev/net/tun (tun_fops) # /dev/nvme0 (nvme_dev_fops) # /dev/tpm0 (tpm_fops) # /proc/self/ns/mnt (ns_file_operations) # /dev/snd/pcm* (snd_pcm_f_ops[]) # # and while some of these could be trivially automatically detected by the # vfs layer when the character device is opened by just noticing that they # have no read or write operations either, it often isn't that obvious. # # Some character devices most definitely do use the file position, even if # they don't allow seeking: the firmware update code, for example, uses # simple_read_from_buffer() that does use f_pos, but doesn't allow seeking # back and forth. # # We'll revisit this when there's a better way to detect the problem and # fix it (possibly with a coccinelle script to do more of the FMODE_STREAM # annotations). # # Reported-by: Kenneth R. Crudup # Cc: Kirill Smelkov # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/s390-linux/bin/s390-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/s390-linux/bin/s390-linux-ld --version # < git log --format=%s --max-count=1 2be7d348fe924f0c5583c6a805bd42cecda93104 # < make -s -j 8 ARCH=s390 O=/kisskb/build/linus_s390-allmodconfig_s390x-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/s390-linux/bin/s390-linux- allmodconfig # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_SAMPLES=n # yes \n | make -s -j 8 ARCH=s390 O=/kisskb/build/linus_s390-allmodconfig_s390x-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/s390-linux/bin/s390-linux- oldconfig yes: standard output: Broken pipe # make -s -j 8 ARCH=s390 O=/kisskb/build/linus_s390-allmodconfig_s390x-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/s390-linux/bin/s390-linux- In file included from /kisskb/src/include/linux/kernel.h:15, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/wait.h:7, from /kisskb/src/include/linux/wait_bit.h:8, from /kisskb/src/include/linux/fs.h:6, from /kisskb/src/fs/ubifs/ubifs.h:16, from /kisskb/src/fs/ubifs/orphan.c:10: /kisskb/src/fs/ubifs/orphan.c: In function 'orphan_delete': /kisskb/src/fs/ubifs/debug.h:158:11: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'ino_t' {aka 'unsigned int'} [-Wformat=] pr_debug("UBIFS DBG " type " (pid %d): " fmt "\n", current->pid, \ ^~~~~~~~~~~~ /kisskb/src/include/linux/printk.h:288:21: note: in definition of macro 'pr_fmt' #define pr_fmt(fmt) fmt ^~~ /kisskb/src/include/linux/dynamic_debug.h:143:2: note: in expansion of macro '__dynamic_func_call' __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/dynamic_debug.h:153:2: note: in expansion of macro '_dynamic_func_call' _dynamic_func_call(fmt, __dynamic_pr_debug, \ ^~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/printk.h:336:2: note: in expansion of macro 'dynamic_pr_debug' dynamic_pr_debug(fmt, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~ /kisskb/src/fs/ubifs/debug.h:158:2: note: in expansion of macro 'pr_debug' pr_debug("UBIFS DBG " type " (pid %d): " fmt "\n", current->pid, \ ^~~~~~~~ /kisskb/src/fs/ubifs/debug.h:170:29: note: in expansion of macro 'ubifs_dbg_msg' #define dbg_gen(fmt, ...) ubifs_dbg_msg("gen", fmt, ##__VA_ARGS__) ^~~~~~~~~~~~~ /kisskb/src/fs/ubifs/orphan.c:132:3: note: in expansion of macro 'dbg_gen' dbg_gen("deleted twice ino %lu", orph->inum); ^~~~~~~ /kisskb/src/fs/ubifs/orphan.c:132:32: note: format string is defined here dbg_gen("deleted twice ino %lu", orph->inum); ~~^ %u In file included from /kisskb/src/include/linux/kernel.h:15, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/wait.h:7, from /kisskb/src/include/linux/wait_bit.h:8, from /kisskb/src/include/linux/fs.h:6, from /kisskb/src/fs/ubifs/ubifs.h:16, from /kisskb/src/fs/ubifs/orphan.c:10: /kisskb/src/fs/ubifs/debug.h:158:11: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'ino_t' {aka 'unsigned int'} [-Wformat=] pr_debug("UBIFS DBG " type " (pid %d): " fmt "\n", current->pid, \ ^~~~~~~~~~~~ /kisskb/src/include/linux/printk.h:288:21: note: in definition of macro 'pr_fmt' #define pr_fmt(fmt) fmt ^~~ /kisskb/src/include/linux/dynamic_debug.h:143:2: note: in expansion of macro '__dynamic_func_call' __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/dynamic_debug.h:153:2: note: in expansion of macro '_dynamic_func_call' _dynamic_func_call(fmt, __dynamic_pr_debug, \ ^~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/printk.h:336:2: note: in expansion of macro 'dynamic_pr_debug' dynamic_pr_debug(fmt, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~ /kisskb/src/fs/ubifs/debug.h:158:2: note: in expansion of macro 'pr_debug' pr_debug("UBIFS DBG " type " (pid %d): " fmt "\n", current->pid, \ ^~~~~~~~ /kisskb/src/fs/ubifs/debug.h:170:29: note: in expansion of macro 'ubifs_dbg_msg' #define dbg_gen(fmt, ...) ubifs_dbg_msg("gen", fmt, ##__VA_ARGS__) ^~~~~~~~~~~~~ /kisskb/src/fs/ubifs/orphan.c:140:3: note: in expansion of macro 'dbg_gen' dbg_gen("delete later ino %lu", orph->inum); ^~~~~~~ /kisskb/src/fs/ubifs/orphan.c:140:31: note: format string is defined here dbg_gen("delete later ino %lu", orph->inum); ~~^ %u /kisskb/src/lib/test_kasan.c: In function 'kasan_alloca_oob_left': /kisskb/src/lib/test_kasan.c:527:1: warning: 'kasan_alloca_oob_left' uses dynamic stack allocation } ^ /kisskb/src/lib/test_kasan.c: In function 'kasan_alloca_oob_right': /kisskb/src/lib/test_kasan.c:537:1: warning: 'kasan_alloca_oob_right' uses dynamic stack allocation } ^ /kisskb/src/drivers/input/joystick/analog.c:160:2: warning: #warning Precise timer not defined for this architecture. [-Wcpp] #warning Precise timer not defined for this architecture. ^~~~~~~ /kisskb/src/net/netfilter/nf_flow_table_offload.c: In function 'nf_flow_rule_match': /kisskb/src/net/netfilter/nf_flow_table_offload.c:80:21: warning: unsigned conversion from 'int' to '__be16' {aka 'short unsigned int'} changes value from '327680' to '0' [-Woverflow] mask->tcp.flags = TCP_FLAG_RST | TCP_FLAG_FIN; ^~~~~~~~~~~~ In file included from /kisskb/src/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c:40: /kisskb/src/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c: In function 'mvpp2_setup_bm_pool': /kisskb/src/drivers/net/ethernet/marvell/mvpp2/mvpp2.h:634:2: warning: overflow in conversion from 'long unsigned int' to 'int' changes value from '18446744073709551584' to '-32' [-Woverflow] ((total_size) - NET_SKB_PAD - MVPP2_SKB_SHINFO_SIZE) ^ /kisskb/src/drivers/net/ethernet/marvell/mvpp2/mvpp2.h:699:33: note: in expansion of macro 'MVPP2_RX_MAX_PKT_SIZE' #define MVPP2_BM_SHORT_PKT_SIZE MVPP2_RX_MAX_PKT_SIZE(MVPP2_BM_SHORT_FRAME_SIZE) ^~~~~~~~~~~~~~~~~~~~~ /kisskb/src/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c:577:41: note: in expansion of macro 'MVPP2_BM_SHORT_PKT_SIZE' mvpp2_pools[MVPP2_BM_SHORT].pkt_size = MVPP2_BM_SHORT_PKT_SIZE; ^~~~~~~~~~~~~~~~~~~~~~~ Completed OK # rm -rf /kisskb/build/linus_s390-allmodconfig_s390x-gcc8 # Build took: 0:40:51.364236