# git rev-parse -q --verify d9fb678414c048e185eaddadd18d75f5e8832ff3^{commit} d9fb678414c048e185eaddadd18d75f5e8832ff3 already have revision, skipping fetch # git checkout -q -f -B kisskb d9fb678414c048e185eaddadd18d75f5e8832ff3 # git clean -qxdf # < git log -1 # commit d9fb678414c048e185eaddadd18d75f5e8832ff3 # Merge: 707a63e9a9dd 9d37e1cab2a9 # Author: Linus Torvalds # Date: Mon Sep 20 15:49:02 2021 -0700 # # Merge tag 'afs-fixes-20210913' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs # # Pull AFS fixes from David Howells: # "Fixes for AFS problems that can cause data corruption due to # interaction with another client modifying data cached locally: # # - When d_revalidating a dentry, don't look at the inode to which it # points. Only check the directory to which the dentry belongs. This # was confusing things and causing the silly-rename cleanup code to # remove the file now at the dentry of a file that got deleted. # # - Fix mmap data coherency. When a callback break is received that # relates to a file that we have cached, the data content may have # been changed (there are other reasons, such as the user's rights # having been changed). However, we're checking it lazily, only on # entry to the kernel, which doesn't happen if we have a writeable # shared mapped page on that file. # # We make the kernel keep track of mmapped files and clear all PTEs # mapping to that file as soon as the callback comes in by calling # unmap_mapping_pages() (we don't necessarily want to zap the # pagecache). This causes the kernel to be reentered when userspace # tries to access the mmapped address range again - and at that point # we can query the server and, if we need to, zap the page cache. # # Ideally, I would check each file at the point of notification, but # that involves poking the server[*] - which is holding an exclusive # lock on the vnode it is changing, waiting for all the clients it # notified to reply. This could then deadlock against the server. # Further, invalidating the pagecache might call ->launder_page(), # which would try to write to the file, which would definitely # deadlock. (AFS doesn't lease file access). # # [*] Checking to see if the file content has changed is a matter of # comparing the current data version number, but we have to ask # the server for that. We also need to get a new callback promise # and we need to poke the server for that too. # # - Add some more points at which the inode is validated, since we're # doing it lazily, notably in ->read_iter() and ->page_mkwrite(), but # also when performing some directory operations. # # Ideally, checking in ->read_iter() would be done in some derivation # of filemap_read(). If we're going to call the server to read the # file, then we get the file status fetch as part of that. # # - The above is now causing us to make a lot more calls to # afs_validate() to check the inode - and afs_validate() takes the # RCU read lock each time to make a quick check (ie. # afs_check_validity()). This is entirely for the purpose of checking # cb_s_break to see if the server we're using reinitialised its list # of callbacks - however this isn't a very common event, so most of # the time we're taking this needlessly. # # Add a new cell-wide counter to count the number of # reinitialisations done by any server and check that - and only if # that changes, take the RCU read lock and check the server list (the # server list may change, but the cell a file is part of won't). # # - Don't update vnode->cb_s_break and ->cb_v_break inside the validity # checking loop. The cb_lock is done with read_seqretry, so we might # go round the loop a second time after resetting those values - and # that could cause someone else checking validity to miss something # (I think). # # Also included are patches for fixes for some bugs encountered whilst # debugging this: # # - Fix a leak of afs_read objects and fix a leak of keys hidden by # that. # # - Fix a leak of pages that couldn't be added to extend a writeback. # # - Fix the maintenance of i_blocks when i_size is changed by a local # write or a local dir edit" # # Link: https://bugzilla.kernel.org/show_bug.cgi?id=214217 [1] # Link: https://lore.kernel.org/r/163111665183.283156.17200205573146438918.stgit@warthog.procyon.org.uk/ # v1 # Link: https://lore.kernel.org/r/163113612442.352844.11162345591911691150.stgit@warthog.procyon.org.uk/ # i_blocks patch # # * tag 'afs-fixes-20210913' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: # afs: Fix updating of i_blocks on file/dir extension # afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server # afs: Try to avoid taking RCU read lock when checking vnode validity # afs: Fix mmap coherency vs 3rd-party changes # afs: Fix incorrect triggering of sillyrename on 3rd-party invalidation # afs: Add missing vnode validation checks # afs: Fix page leak # afs: Fix missing put on afs_read objects and missing get on the key therein # < /opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux-gcc --version # < /opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux-ld --version # < git log --format=%s --max-count=1 d9fb678414c048e185eaddadd18d75f5e8832ff3 # < make -s -j 32 ARCH=um O=/kisskb/build/linus_um-allmodconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 allmodconfig # Added to kconfig CONFIG_STANDALONE=y # Added to kconfig CONFIG_KCOV=n # Added to kconfig CONFIG_GCC_PLUGINS=n # Added to kconfig CONFIG_GCC_PLUGIN_CYC_COMPLEXITY=n # Added to kconfig CONFIG_GCC_PLUGIN_SANCOV=n # Added to kconfig CONFIG_GCC_PLUGIN_LATENT_ENTROPY=n # Added to kconfig CONFIG_GCC_PLUGIN_STRUCTLEAK=n # Added to kconfig CONFIG_GCC_PLUGIN_RANDSTRUCT=n # Added to kconfig CONFIG_UML_NET=n # Added to kconfig CONFIG_UML_NET_ETHERTAP=n # Added to kconfig CONFIG_UML_NET_TUNTAP=n # Added to kconfig CONFIG_UML_NET_SLIP=n # Added to kconfig CONFIG_UML_NET_DAEMON=n # Added to kconfig CONFIG_UML_NET_VDE=n # Added to kconfig CONFIG_UML_NET_MCAST=n # Added to kconfig CONFIG_UML_NET_PCAP=n # Added to kconfig CONFIG_UML_NET_SLIRP=n # Added to kconfig CONFIG_GCOV_KERNEL=n # Added to kconfig CONFIG_DEBUG_INFO_BTF=n # Added to kconfig CONFIG_BPF_PRELOAD=n # < make -s -j 32 ARCH=um O=/kisskb/build/linus_um-allmodconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 help # make -s -j 32 ARCH=um O=/kisskb/build/linus_um-allmodconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 olddefconfig .config:11719:warning: override: reassigning to symbol GCC_PLUGIN_SANCOV .config:11722:warning: override: reassigning to symbol GCC_PLUGIN_RANDSTRUCT .config:11724:warning: override: reassigning to symbol UML_NET_ETHERTAP .config:11726:warning: override: reassigning to symbol UML_NET_SLIP .config:11729:warning: override: reassigning to symbol UML_NET_MCAST .config:11731:warning: override: reassigning to symbol UML_NET_SLIRP # make -s -j 32 ARCH=um O=/kisskb/build/linus_um-allmodconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 /kisskb/src/arch/x86/um/Makefile:44: FORCE prerequisite is missing /kisskb/src/drivers/video/fbdev/riva/fbdev.c: In function 'rivafb_probe': /kisskb/src/drivers/video/fbdev/riva/fbdev.c:2062:11: error: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [-Werror=discarded-qualifiers] iounmap(default_par->riva.PRAMIN); ^ In file included from /kisskb/src/arch/um/include/asm/io.h:7:0, from /kisskb/src/include/linux/io.h:13, from /kisskb/src/include/linux/irq.h:20, from /kisskb/src/include/asm-generic/hardirq.h:17, from /kisskb/src/arch/um/include/asm/hardirq.h:5, from /kisskb/src/include/linux/hardirq.h:11, from /kisskb/src/include/linux/interrupt.h:11, from /kisskb/src/include/linux/trace_recursion.h:5, from /kisskb/src/include/linux/ftrace.h:10, from /kisskb/src/include/linux/kprobes.h:29, from /kisskb/src/include/linux/kgdb.h:19, from /kisskb/src/include/linux/fb.h:6, from /kisskb/src/drivers/video/fbdev/riva/fbdev.c:39: /kisskb/src/include/asm-generic/logic_io.h:36:17: note: expected 'void *' but argument is of type 'volatile U032 * {aka volatile unsigned int *}' #define iounmap iounmap ^ /kisskb/src/include/asm-generic/logic_io.h:37:6: note: in expansion of macro 'iounmap' void iounmap(void __iomem *addr); ^ /kisskb/src/drivers/video/fbdev/riva/fbdev.c: In function 'rivafb_remove': /kisskb/src/drivers/video/fbdev/riva/fbdev.c:2095:11: error: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [-Werror=discarded-qualifiers] iounmap(par->riva.PRAMIN); ^ In file included from /kisskb/src/arch/um/include/asm/io.h:7:0, from /kisskb/src/include/linux/io.h:13, from /kisskb/src/include/linux/irq.h:20, from /kisskb/src/include/asm-generic/hardirq.h:17, from /kisskb/src/arch/um/include/asm/hardirq.h:5, from /kisskb/src/include/linux/hardirq.h:11, from /kisskb/src/include/linux/interrupt.h:11, from /kisskb/src/include/linux/trace_recursion.h:5, from /kisskb/src/include/linux/ftrace.h:10, from /kisskb/src/include/linux/kprobes.h:29, from /kisskb/src/include/linux/kgdb.h:19, from /kisskb/src/include/linux/fb.h:6, from /kisskb/src/drivers/video/fbdev/riva/fbdev.c:39: /kisskb/src/include/asm-generic/logic_io.h:36:17: note: expected 'void *' but argument is of type 'volatile U032 * {aka volatile unsigned int *}' #define iounmap iounmap ^ /kisskb/src/include/asm-generic/logic_io.h:37:6: note: in expansion of macro 'iounmap' void iounmap(void __iomem *addr); ^ cc1: all warnings being treated as errors make[5]: *** [/kisskb/src/scripts/Makefile.build:277: drivers/video/fbdev/riva/fbdev.o] Error 1 make[5]: *** Waiting for unfinished jobs.... make[4]: *** [/kisskb/src/scripts/Makefile.build:540: drivers/video/fbdev/riva] Error 2 make[4]: *** Waiting for unfinished jobs.... /kisskb/src/drivers/pci/controller/vmd.c:117:21: error: field 'sysdata' has incomplete type struct pci_sysdata sysdata; ^ /kisskb/src/drivers/pci/controller/vmd.c: In function 'vmd_compose_msi_msg': /kisskb/src/drivers/pci/controller/vmd.c:151:20: error: 'X86_MSI_BASE_ADDRESS_HIGH' undeclared (first use in this function) msg->address_hi = X86_MSI_BASE_ADDRESS_HIGH; ^ /kisskb/src/drivers/pci/controller/vmd.c:151:20: note: each undeclared identifier is reported only once for each function it appears in /kisskb/src/drivers/pci/controller/vmd.c:152:19: error: 'arch_msi_msg_addr_lo_t {aka struct arch_msi_msg_addr_lo}' has no member named 'base_address' msg->arch_addr_lo.base_address = X86_MSI_BASE_ADDRESS_LOW; ^ /kisskb/src/drivers/pci/controller/vmd.c:152:35: error: 'X86_MSI_BASE_ADDRESS_LOW' undeclared (first use in this function) msg->arch_addr_lo.base_address = X86_MSI_BASE_ADDRESS_LOW; ^ /kisskb/src/drivers/pci/controller/vmd.c:153:19: error: 'arch_msi_msg_addr_lo_t {aka struct arch_msi_msg_addr_lo}' has no member named 'destid_0_7' msg->arch_addr_lo.destid_0_7 = index_from_irqs(vmd, irq); ^ /kisskb/src/drivers/pci/controller/vmd.c: In function 'vmd_enable_domain': /kisskb/src/drivers/pci/controller/vmd.c:751:4: error: dereferencing pointer to incomplete type 'struct pci_sysdata' sd->vmd_dev = vmd->dev; ^ /kisskb/src/drivers/pci/controller/vmd.c: In function 'vmd_from_bus': /kisskb/src/drivers/pci/controller/vmd.c:128:1: error: control reaches end of non-void function [-Werror=return-type] } ^ cc1: all warnings being treated as errors make[4]: *** [/kisskb/src/scripts/Makefile.build:277: drivers/pci/controller/vmd.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [/kisskb/src/scripts/Makefile.build:540: drivers/pci/controller] Error 2 make[2]: *** [/kisskb/src/scripts/Makefile.build:540: drivers/pci] Error 2 make[2]: *** Waiting for unfinished jobs.... make[3]: *** [/kisskb/src/scripts/Makefile.build:540: drivers/video/fbdev] Error 2 make[2]: *** [/kisskb/src/scripts/Makefile.build:540: drivers/video] Error 2 make[1]: *** [/kisskb/src/Makefile:1868: drivers] Error 2 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:219: __sub-make] Error 2 Command 'make -s -j 32 ARCH=um O=/kisskb/build/linus_um-allmodconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 ' returned non-zero exit status 2 # rm -rf /kisskb/build/linus_um-allmodconfig_um-x86_64 # Build took: 0:05:39.649707