Linux 5.4.215
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.4.215 kernel.
All users of the 5.4 kernel series must upgrade.
The updated 5.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.4.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
MAINTAINERS | 3 Makefile | 2 arch/arm64/boot/dts/rockchip/rk3399-gru-bob.dts | 5 arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi | 9 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 1 arch/mips/cavium-octeon/octeon-irq.c | 10 arch/mips/lantiq/clk.c | 1 arch/mips/loongson32/common/platform.c | 16 - arch/x86/include/asm/cpu_entry_area.h | 2 drivers/firmware/efi/libstub/secureboot.c | 8 drivers/gpio/gpio-mpc8xxx.c | 1 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 drivers/gpu/drm/amd/display/modules/color/color_gamma.c | 4 drivers/gpu/drm/meson/meson_plane.c | 2 drivers/gpu/drm/meson/meson_viu.c | 2 drivers/gpu/drm/rockchip/cdn-dp-core.c | 5 drivers/hv/vmbus_drv.c | 10 drivers/net/can/usb/gs_usb.c | 4 drivers/net/ethernet/intel/i40e/i40e_main.c | 32 ++- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 20 + drivers/net/ethernet/intel/iavf/iavf_txrx.c | 9 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 7 drivers/net/ethernet/sun/sunhme.c | 4 drivers/net/ipvlan/ipvlan_core.c | 6 drivers/net/team/team.c | 24 +- drivers/net/usb/qmi_wwan.c | 1 drivers/of/fdt.c | 2 drivers/of/of_mdio.c | 1 drivers/parisc/ccio-dma.c | 1 drivers/regulator/pfuze100-regulator.c | 2 drivers/s390/block/dasd_alias.c | 9 drivers/tty/serial/atmel_serial.c | 32 +-- drivers/tty/serial/serial-tegra.c | 5 drivers/tty/serial/tegra-tcu.c | 2 drivers/usb/cdns3/gadget.c | 1 drivers/usb/core/hub.c | 2 drivers/usb/dwc3/core.c | 2 drivers/usb/dwc3/core.h | 4 drivers/usb/dwc3/gadget.c | 81 ++++--- drivers/usb/host/xhci-mtk-sch.c | 149 ++++++++------ drivers/usb/host/xhci-mtk.h | 2 drivers/usb/serial/option.c | 6 drivers/video/fbdev/pxa3xx-gcu.c | 2 fs/afs/misc.c | 1 fs/cifs/connect.c | 7 fs/cifs/file.c | 3 fs/cifs/transport.c | 6 fs/ext4/extents.c | 4 fs/ext4/ialloc.c | 2 fs/nfs/super.c | 27 +- fs/xfs/libxfs/xfs_alloc.c | 27 +- fs/xfs/libxfs/xfs_attr_leaf.c | 12 - fs/xfs/libxfs/xfs_bmap.c | 16 + fs/xfs/libxfs/xfs_btree.c | 5 fs/xfs/libxfs/xfs_da_btree.c | 24 +- fs/xfs/libxfs/xfs_dir2.c | 4 fs/xfs/libxfs/xfs_dir2_leaf.c | 4 fs/xfs/libxfs/xfs_dir2_node.c | 12 - fs/xfs/libxfs/xfs_dir2_sf.c | 28 ++ fs/xfs/libxfs/xfs_ialloc.c | 64 ++++++ fs/xfs/libxfs/xfs_ialloc.h | 1 fs/xfs/libxfs/xfs_inode_fork.c | 6 fs/xfs/libxfs/xfs_refcount.c | 4 fs/xfs/libxfs/xfs_rtbitmap.c | 6 fs/xfs/xfs_acl.c | 15 + fs/xfs/xfs_attr_inactive.c | 10 fs/xfs/xfs_attr_list.c | 5 fs/xfs/xfs_bmap_item.c | 7 fs/xfs/xfs_bmap_util.c | 12 + fs/xfs/xfs_buf_item.c | 2 fs/xfs/xfs_dquot.c | 2 fs/xfs/xfs_error.c | 27 ++ fs/xfs/xfs_error.h | 7 fs/xfs/xfs_extfree_item.c | 5 fs/xfs/xfs_fsmap.c | 1 fs/xfs/xfs_inode.c | 40 +++ fs/xfs/xfs_inode_item.c | 5 fs/xfs/xfs_iomap.c | 17 + fs/xfs/xfs_iops.c | 10 fs/xfs/xfs_log_recover.c | 72 ++++-- fs/xfs/xfs_message.c | 2 fs/xfs/xfs_message.h | 2 fs/xfs/xfs_mount.c | 168 +++++++++++----- fs/xfs/xfs_pnfs.c | 4 fs/xfs/xfs_qm.c | 13 + fs/xfs/xfs_refcount_item.c | 5 fs/xfs/xfs_rmap_item.c | 9 fs/xfs/xfs_trace.h | 21 ++ include/linux/iomap.h | 2 include/linux/sched/task_stack.h | 2 include/linux/serial_core.h | 17 + kernel/cgroup/cgroup-v1.c | 3 kernel/trace/trace_preemptirq.c | 4 kernel/workqueue.c | 6 mm/slub.c | 5 net/bridge/netfilter/ebtables.c | 4 net/mac80211/scan.c | 11 - net/netfilter/nf_conntrack_irc.c | 34 ++- net/netfilter/nf_conntrack_sip.c | 4 net/netfilter/nfnetlink_osf.c | 4 net/rxrpc/call_event.c | 2 net/rxrpc/local_object.c | 3 net/sched/cls_api.c | 1 net/sched/sch_taprio.c | 18 + scripts/mksysmap | 2 sound/core/oss/pcm_oss.c | 5 sound/pci/hda/hda_intel.c | 2 sound/pci/hda/hda_tegra.c | 3 sound/pci/hda/patch_hdmi.c | 1 sound/pci/hda/patch_realtek.c | 31 ++ sound/pci/hda/patch_sigmatel.c | 24 ++ sound/soc/codecs/nau8824.c | 17 - tools/perf/util/genelf.c | 14 + tools/perf/util/genelf.h | 4 tools/perf/util/symbol-elf.c | 7 115 files changed, 1058 insertions(+), 389 deletions(-)
Adrian Hunter (1):
perf kcore_copy: Do not check /proc/modules is unchanged
Alan Stern (1):
USB: core: Fix RST error in hub.c
Alexander Sverdlin (1):
MIPS: OCTEON: irq: Fix octeon_irq_force_ciu_mapping()
Ard Biesheuvel (1):
efi: libstub: check Shim mode using MokSBStateRT
Benjamin Poirier (1):
net: team: Unsync device addresses on ndo_stop
Borislav Petkov (1):
task_stack, x86/cea: Force-inline stack helpers
Brett Creeley (1):
iavf: Fix cached head and tail value for iavf_get_tx_pending
Brian Foster (2):
xfs: stabilize insert range start boundary to avoid COW writeback race
xfs: use bitops interface for buf log item AIL flag check
Brian Norris (1):
arm64: dts: rockchip: Pull up wlan wake# on Gru-Bob
Callum Osmotherly (1):
ALSA: hda/realtek: Enable 4-speaker output Dell Precision 5530 laptop
Carl Yin(殷张成) (1):
USB: serial: option: add Quectel BG95 0x0203 composition
Chandan Babu R (2):
MAINTAINERS: add Chandan as xfs maintainer for 5.4.y
iomap: iomap that extends beyond EOF should be marked dirty
Chao Yu (1):
mm/slub: fix to return errno if kmalloc() fails
Christoph Hellwig (1):
xfs: slightly tweak an assert in xfs_fs_map_blocks
Chunfeng Yun (7):
usb: xhci-mtk: get the microframe boundary for ESIT
usb: xhci-mtk: add only one extra CS for FS/LS INTR
usb: xhci-mtk: use @sch_tt to check whether need do TT schedule
usb: xhci-mtk: add a function to (un)load bandwidth info
usb: xhci-mtk: add some schedule error number
usb: xhci-mtk: allow multiple Start-Split in a microframe
usb: xhci-mtk: fix issue of out-of-bounds array access
[email protected] (1):
tty/serial: atmel: RS485 & ISO7816: wait for TXRDY before sending data
Darrick J. Wong (13):
xfs: replace -EIO with -EFSCORRUPTED for corrupt metadata
xfs: add missing assert in xfs_fsmap_owner_from_rmap
xfs: range check ri_cnt when recovering log items
xfs: attach dquots and reserve quota blocks during unwritten conversion
xfs: convert EIO to EFSCORRUPTED when log contents are invalid
xfs: constify the buffer pointer arguments to error functions
xfs: always log corruption errors
xfs: fix some memory leaks in log recovery
xfs: refactor agfl length computation function
xfs: split the sunit parameter update into two parts
xfs: don't commit sunit/swidth updates to disk if that would cause repair failures
xfs: fix an ABBA deadlock in xfs_rename
xfs: fix use-after-free when aborting corrupt attr inactivation
David Howells (3):
rxrpc: Fix local destruction being repeated
rxrpc: Fix calc of resend age
afs: Return -EAGAIN, not -EREMOTEIO, when a file already locked
David Leadbeater (1):
netfilter: nf_conntrack_irc: Tighten matching on DCC message
Fabio Estevam (1):
arm64: dts: rockchip: Remove 'enable-active-low' from rk3399-puma
Florian Westphal (1):
netfilter: ebtables: fix memory leak when blob is malformed
Greg Kroah-Hartman (3):
Revert "usb: add quirks for Lenovo OneLink+ Dock" Revert "usb: gadget: udc-xilinx: replace memcpy with memcpy_toio" Linux 5.4.215
Hamza Mahfooz (1):
drm/amdgpu: use dirty framebuffer helper
Hangyu Hua (1):
net: sched: fix possible refcount leak in tc_new_tfilter()
Hyunwoo Kim (1):
video: fbdev: pxa3xx-gcu: Fix integer overflow in pxa3xx_gcu_write
Igor Ryzhov (1):
netfilter: nf_conntrack_sip: fix ct_sip_walk_headers
Ikjoon Jang (1):
usb: xhci-mtk: relax TT periodic bandwidth allocation
Ilpo Järvinen (3):
serial: Create uart_xmit_advance()
serial: tegra: Use uart_xmit_advance(), fixes icount.tx accounting
serial: tegra-tcu: Use uart_xmit_advance(), fixes icount.tx accounting
Jan Kara (1):
ext4: make directory inode spreading reflect flexbg size
Jean-Francois Le Fillatre (1):
usb: add quirks for Lenovo OneLink+ Dock
Kai Vehmanen (1):
ALSA: hda: add Intel 5 Series / 3400 PCI DID
Liang He (1):
of: mdio: Add of_node_put() when breaking out of for_each_xx
Lieven Hey (1):
perf jit: Include program header in ELF files
Lino Sanfilippo (1):
serial: atmel: remove redundant assignment in rs485_config
Lu Wei (1):
ipvlan: Fix out-of-bound bugs caused by unset skb->mac_header
Luke D. Jones (3):
ALSA: hda/realtek: Add pincfg for ASUS G513 HP jack
ALSA: hda/realtek: Add pincfg for ASUS G533Z HP jack
ALSA: hda/realtek: Add quirk for ASUS GA503R laptop
Luís Henriques (1):
ext4: fix bug in extents parsing when eh_entries == 0 and eh_depth > 0
Marc Kleine-Budde (1):
can: gs_usb: gs_can_open(): fix race dev->can.state condition
Michal Jaron (3):
iavf: Fix set max MTU size with port VLAN and jumbo frames
i40e: Fix VF set max MTU size
i40e: Fix set max_tx_rate when it is lower than 1 Mbps
Mohan Kumar (2):
ALSA: hda/tegra: Align BDL entry to 4KB boundary
ALSA: hda/tegra: set depop delay for tegra
Nathan Huckleberry (1):
drm/rockchip: Fix return type of cdn_dp_connector_mode_valid
Norbert Zulinski (1):
iavf: Fix bad page state
Pablo Neira Ayuso (1):
netfilter: nfnetlink_osf: fix possible bogus match in nf_osf_find()
Pali Rohár (1):
gpio: mpc8xxx: Fix support for IRQ_TYPE_LEVEL_LOW flow_type in mpc85xx
Pawel Laszczak (1):
usb: cdns3: fix issue with rearming ISO OUT endpoint
Piyush Mehta (1):
usb: gadget: udc-xilinx: replace memcpy with memcpy_toio
Randy Dunlap (1):
MIPS: lantiq: export clk_get_io() for lantiq_wdt.ko
Ronnie Sahlberg (1):
cifs: revalidate mapping when doing direct writes
Sasha Levin (1):
ALSA: pcm: oss: Fix race at SNDCTL_DSP_SYNC
Sean Anderson (1):
net: sunhme: Fix packet reception for len < RX_COPY_THRESHOLD
Serge Semin (1):
MIPS: Loongson32: Fix PHY-mode being left unspecified
Sergey Shtylyov (1):
of: fdt: fix off-by-one error in unflatten_dt_nodes()
Sergiu Moga (1):
tty: serial: atmel: Preserve previous USART mode if RS485 disabled
Siddh Raman Pant (1):
wifi: mac80211: Fix UAF in ieee80211_scan_rx()
Stefan Haberland (1):
s390/dasd: fix Oops in dasd_alias_get_start_dev due to missing pavgroup
Stefan Metzmacher (2):
cifs: don't send down the destination address to sendmsg for a SOCK_STREAM
cifs: always initialize struct msghdr smb_msg completely
Stuart Menefy (2):
drm/meson: Correct OSD1 global alpha value drm/meson: Fix OSD1 RGB to YCbCr coefficient
Takashi Iwai (4):
ASoC: nau8824: Fix semaphore unbalance at error paths
ALSA: hda/sigmatel: Keep power up while beep is enabled
ALSA: hda/sigmatel: Fix unused variable warning for beep power change
ALSA: hda/realtek: Re-arrange quirk table entries
Tetsuo Handa (2):
cgroup: Add missing cpus_read_lock() to cgroup_attach_task_all()
workqueue: don't skip lockdep work dependency in cancel_work_sync()
Thinh Nguyen (3):
usb: dwc3: gadget: Prevent repeat pullup()
usb: dwc3: gadget: Refactor pullup()
usb: dwc3: gadget: Don't modify GEVNTCOUNT in pullup()
Trond Myklebust (1):
NFSv4: Turn off open-by-filehandle and NFS re-export for NFSv4.0
Vitaly Kuznetsov (1):
Drivers: hv: Never allocate anything besides framebuffer from framebuffer memory region
Vladimir Oltean (2):
net/sched: taprio: avoid disabling offload when it was never enabled net/sched: taprio: make qdisc_leaf() see the per-netdev-queue pfifo child qdiscs
Wesley Cheng (3):
usb: dwc3: gadget: Avoid starting DWC3 gadget during UDC unbind
usb: dwc3: Issue core soft reset before enabling run/stop
usb: dwc3: gadget: Avoid duplicate requests to enable Run/Stop
Xiaolei Wang (1):
regulator: pfuze100: Fix the global-out-of-bounds access in pfuze100_regulator_probe()
Yang Yingliang (1):
parisc: ccio-dma: Add missing iounmap in error path in ccio_probe()
Yao Wang1 (1):
drm/amd/display: Limit user regamma to a valid value
Yipeng Zou (1):
tracing: hold caller_addr to hardirq_{enable,disable}_ip
Youling Tang (1):
mksysmap: Fix the mismatch of 'L0' symbols in System.map
huangwenhui (1):
ALSA: hda/realtek: Add quirk for Huawei WRT-WX9
jerry meng (1):
USB: serial: option: add Quectel RM520N
jerry.meng (1):
net: usb: qmi_wwan: add Quectel RM520N
kaixuxia (1):
xfs: Fix deadlock between AGI and AGF when target_ip exists in xfs_rename()
zain wang (1):
arm64: dts: rockchip: Set RK3399-Gru PCLK_EDP to 24 MHz
Greg Kroah-Hartman
maintainerMAINTAINERS +2 -1
@@ -17864,7 +17864,8 @@ S: Supported F: sound/xen/* XFS FILESYSTEM -M: Darrick J. Wong <[email protected]> +M: Chandan Babu R <[email protected]> +M: Darrick J. Wong <[email protected]> M: [email protected] L: [email protected] W: http://xfs.org/
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 4 -SUBLEVEL = 214 +SUBLEVEL = 215 EXTRAVERSION = NAME = Kleptomaniac Octopus
arch/arm64/boot/dts/rockchip/rk3399-gru-bob.dts +5 -0
@@ -77,3 +77,8 @@ }; }; }; + +&wlan_host_wake_l { + /* Kevin has an external pull up, but Bob does not. */ + rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>; +};
arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi +9 -0
@@ -237,6 +237,14 @@ &edp { status = "okay"; + /* + * eDP PHY/clk don't sync reliably at anything other than 24 MHz. Only + * set this here, because rk3399-gru.dtsi ensures we can generate this + * off GPLL=600MHz, whereas some other RK3399 boards may not. + */ + assigned-clocks = <&cru PCLK_EDP>; + assigned-clock-rates = <24000000>; + ports { edp_out: port@1 { reg = <1>;
@@ -397,6 +405,7 @@ ap_i2c_tp: &i2c5 { }; wlan_host_wake_l: wlan-host-wake-l { + /* Kevin has an external pull up, but Bob does not */ rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; }; };
arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi +0 -1
@@ -102,7 +102,6 @@ vcc5v0_host: vcc5v0-host-regulator { compatible = "regulator-fixed"; gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_LOW>; - enable-active-low; pinctrl-names = "default"; pinctrl-0 = <&vcc5v0_host_en>; regulator-name = "vcc5v0_host";
arch/mips/cavium-octeon/octeon-irq.c +10 -0
@@ -127,6 +127,16 @@ static void octeon_irq_free_cd(struct irq_domain *d, unsigned int irq)static int octeon_irq_force_ciu_mapping (struct irq_domain *domain,int irq,int line,int bit) { +struct device_node *of_node; +int ret; + + of_node =irq_domain_get_of_node (domain); +if (!of_node) +return -EINVAL ; + ret =irq_alloc_desc_at (irq,of_node_to_nid (of_node)); +if (ret <0 ) +return ret; +return irq_domain_associate (domain, irq, line <<6 | bit); }
arch/mips/lantiq/clk.c +1 -0
@@ -50,6 +50,7 @@ struct clk *clk_get_io(void) {return &cpu_clk_generic[2 ]; } +EXPORT_SYMBOL_GPL (clk_get_io);struct clk *clk_get_ppe (void ) {
arch/mips/loongson32/common/platform.c +8 -8
@@ -98,7 +98,7 @@ int ls1x_eth_mux_init(struct platform_device *pdev, void *priv)if (plat_dat->bus_id) {__raw_writel (__raw_readl (LS1X_MUX_CTRL0 ) |GMAC1_USE_UART1 |GMAC1_USE_UART0 ,LS1X_MUX_CTRL0 ); -switch (plat_dat->interface) { +switch (plat_dat->phy_interface) {case PHY_INTERFACE_MODE_RGMII : val &= ~(GMAC1_USE_TXCLK |GMAC1_USE_PWM23 );break ;
@@ -107,12 +107,12 @@ int ls1x_eth_mux_init(struct platform_device *pdev, void *priv)break ;default :pr_err ("unsupported mii mode %d\n" , - plat_dat->interface); + plat_dat->phy_interface);return -ENOTSUPP ; } val &= ~GMAC1_SHUT ; }else { -switch (plat_dat->interface) { +switch (plat_dat->phy_interface) {case PHY_INTERFACE_MODE_RGMII : val &= ~(GMAC0_USE_TXCLK |GMAC0_USE_PWM01 );break ;
@@ -121,7 +121,7 @@ int ls1x_eth_mux_init(struct platform_device *pdev, void *priv)break ;default :pr_err ("unsupported mii mode %d\n" , - plat_dat->interface); + plat_dat->phy_interface);return -ENOTSUPP ; } val &= ~GMAC0_SHUT ;
@@ -131,7 +131,7 @@ int ls1x_eth_mux_init(struct platform_device *pdev, void *priv) plat_dat =dev_get_platdata (&pdev->dev); val &= ~PHY_INTF_SELI ; -if (plat_dat->interface ==PHY_INTERFACE_MODE_RMII ) +if (plat_dat->phy_interface ==PHY_INTERFACE_MODE_RMII ) val |=0x4 <<PHY_INTF_SELI_SHIFT ;__raw_writel (val,LS1X_MUX_CTRL1 );
@@ -146,9 +146,9 @@ static struct plat_stmmacenet_data ls1x_eth0_pdata = { .bus_id = 0, .phy_addr = -1,#if defined(CONFIG_LOONGSON1_LS1B ) - .interface = PHY_INTERFACE_MODE_MII, + .phy_interface = PHY_INTERFACE_MODE_MII,#elif defined(CONFIG_LOONGSON1_LS1C ) - .interface = PHY_INTERFACE_MODE_RMII, + .phy_interface = PHY_INTERFACE_MODE_RMII, #endif .mdio_bus_data = &ls1x_mdio_bus_data, .dma_cfg = &ls1x_eth_dma_cfg,
@@ -186,7 +186,7 @@ struct platform_device ls1x_eth0_pdev = {static struct plat_stmmacenet_data ls1x_eth1_pdata = { .bus_id =1 , .phy_addr =-1 , - .interface =PHY_INTERFACE_MODE_MII , + .phy_interface =PHY_INTERFACE_MODE_MII , .mdio_bus_data = &ls1x_mdio_bus_data, .dma_cfg = &ls1x_eth_dma_cfg, .has_gmac =1 ,
arch/x86/include/asm/cpu_entry_area.h +1 -1
@@ -133,7 +133,7 @@ extern void cea_set_pte(void *cea_vaddr, phys_addr_t pa, pgprot_t flags);extern struct cpu_entry_area *get_cpu_entry_area (int cpu); -static inline struct entry_stack *cpu_entry_stack (int cpu) +static __always_inline struct entry_stack *cpu_entry_stack(int cpu) {return &get_cpu_entry_area (cpu)->entry_stack_page.stack; }
drivers/firmware/efi/libstub/secureboot.c +4 -4
@@ -19,7 +19,7 @@ static const efi_char16_t efi_SetupMode_name[] = L"SetupMode";/* SHIM variables */ static const efi_guid_t shim_guid =EFI_SHIM_LOCK_GUID ; -static const efi_char16_t shim_MokSBState_name[] =L"MokSBState" ; +static const efi_char16_t shim_MokSBState_name[] =L"MokSBStateRT" ;#define get_efi_var (name, vendor, ...) \ efi_call_runtime(get_variable, \
@@ -58,8 +58,8 @@ enum efi_secureboot_mode efi_get_secureboot(efi_system_table_t *sys_table_arg)/* * See if a user has put the shim into insecure mode. If so, and if the -* variable doesn't have the runtime attribute set, we might as well -* honor that. +* variable doesn't have the non-volatile attribute set, we might as +* well honor that. */ size =sizeof (moksbstate); status = get_efi_var(shim_MokSBState_name, &shim_guid,
@@ -68,7 +68,7 @@ enum efi_secureboot_mode efi_get_secureboot(efi_system_table_t *sys_table_arg)/* If it fails, we don't care why. Default to secure */ if (status !=EFI_SUCCESS ) goto secure_boot_enabled; -if (!(attr &EFI_VARIABLE_RUNTIME_ACCESS ) && moksbstate ==1 ) +if (!(attr &EFI_VARIABLE_NON_VOLATILE ) && moksbstate ==1 )return efi_secureboot_mode_disabled; secure_boot_enabled:
drivers/gpio/gpio-mpc8xxx.c +1 -0
@@ -190,6 +190,7 @@ static int mpc8xxx_irq_set_type(struct irq_data *d, unsigned int flow_type)switch (flow_type) {case IRQ_TYPE_EDGE_FALLING : +case IRQ_TYPE_LEVEL_LOW :raw_spin_lock_irqsave (&mpc8xxx_gc->lock, flags); gc->write_reg (mpc8xxx_gc->regs +GPIO_ICR , gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2 -0
@@ -35,6 +35,7 @@#include <linux/pci.h> #include <linux/pm_runtime.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_damage_helper.h> #include <drm/drm_edid.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_helper.h>
@@ -495,6 +496,7 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector,static const struct drm_framebuffer_funcs amdgpu_fb_funcs = { .destroy = drm_gem_fb_destroy, .create_handle = drm_gem_fb_create_handle, + .dirty = drm_atomic_helper_dirtyfb, }; uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev,
drivers/gpu/drm/amd/display/modules/color/color_gamma.c +4 -0
@@ -1486,6 +1486,7 @@ static void interpolate_user_regamma(uint32_t hw_points_num,struct fixed31_32 lut2;struct fixed31_32 delta_lut;struct fixed31_32 delta_index; +const struct fixed31_32 one =dc_fixpt_from_int (1 ); i =0 ;/* fixed_pt library has problems handling too small values */
@@ -1514,6 +1515,9 @@ static void interpolate_user_regamma(uint32_t hw_points_num, }else hw_x = coordinates_x[i].x; +if (dc_fixpt_le (one, hw_x)) + hw_x = one; + norm_x =dc_fixpt_mul (norm_factor, hw_x); index =dc_fixpt_floor (norm_x);if (index <0 || index >255 )
drivers/gpu/drm/meson/meson_plane.c +1 -1
@@ -128,7 +128,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane,/* Enable OSD and BLK0, set max global alpha */ priv->viu.osd1_ctrl_stat =OSD_ENABLE | - (0xFF <<OSD_GLOBAL_ALPHA_SHIFT ) | + (0x100 <<OSD_GLOBAL_ALPHA_SHIFT ) |OSD_BLK0_ENABLE ; canvas_id_osd1 = priv->canvas_id_osd1;
drivers/gpu/drm/meson/meson_viu.c +1 -1
@@ -91,7 +91,7 @@ static void meson_viu_set_g12a_osd1_matrix(struct meson_drm *priv, priv->io_base + _REG(VPP_WRAP_OSD1_MATRIX_COEF11_12));writel (((m[9 ] &0x1fff ) <<16 ) | (m[10 ] &0x1fff ), priv->io_base +_REG (VPP_WRAP_OSD1_MATRIX_COEF20_21 )); -writel ((m[11 ] &0x1fff ) <<16 , +writel ((m[11 ] &0x1fff ), priv->io_base +_REG (VPP_WRAP_OSD1_MATRIX_COEF22 )); writel(((m[18] & 0xfff) << 16) | (m[19] & 0xfff),
drivers/gpu/drm/rockchip/cdn-dp-core.c +3 -2
@@ -275,8 +275,9 @@ static int cdn_dp_connector_get_modes(struct drm_connector *connector)return ret; } -static int cdn_dp_connector_mode_valid (struct drm_connector *connector, -struct drm_display_mode *mode) +static enum drm_mode_status +cdn_dp_connector_mode_valid (struct drm_connector *connector, +struct drm_display_mode *mode) {struct cdn_dp_device *dp =connector_to_dp (connector);struct drm_display_info *display_info = &dp->connector.display_info;
drivers/hv/vmbus_drv.c +9 -1
@@ -2075,7 +2075,7 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj, bool fb_overlap_ok) {struct resource *iter, *shadow; -resource_size_t range_min, range_max, start; +resource_size_t range_min, range_max, start, end;const char *dev_n =dev_name (&device_obj->device);int retval;
@@ -2110,6 +2110,14 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj, range_max = iter->end; start = (range_min + align -1 ) & ~(align -1 );for (; start + size -1 <= range_max; start += align) { + end = start + size -1 ; + +/* Skip the whole fb_mmio region if not fb_overlap_ok */ +if (!fb_overlap_ok && fb_mmio && + (((start >= fb_mmio->start) && (start <= fb_mmio->end)) || + ((end >= fb_mmio->start) && (end <= fb_mmio->end)))) +continue ; + shadow =__request_region (iter, start, size,NULL ,IORESOURCE_BUSY );if (!shadow)
drivers/net/can/usb/gs_usb.c +2 -2
@@ -678,6 +678,7 @@ static int gs_can_open(struct net_device *netdev) flags |=GS_CAN_MODE_TRIPLE_SAMPLE ;/* finally start device */ + dev->can.state =CAN_STATE_ERROR_ACTIVE ; dm->mode =cpu_to_le32 (GS_CAN_MODE_START ); dm->flags =cpu_to_le32 (flags); rc = usb_control_msg(interface_to_usbdev(dev->iface),
@@ -694,13 +695,12 @@ static int gs_can_open(struct net_device *netdev)if (rc <0 ) {netdev_err (netdev,"Couldn't start device (err=%d)\n" , rc);kfree (dm); + dev->can.state =CAN_STATE_STOPPED ;return rc; }kfree (dm); - dev->can.state =CAN_STATE_ERROR_ACTIVE ; - parent->active_channels++;if (!(dev->can.ctrlmode &CAN_CTRLMODE_LISTENONLY ))netif_start_queue (netdev);
drivers/net/ethernet/intel/i40e/i40e_main.c +26 -6
@@ -5638,6 +5638,26 @@ static int i40e_get_link_speed(struct i40e_vsi *vsi) } } +/** +* i40e_bw_bytes_to_mbits - Convert max_tx_rate from bytes to mbits +* @vsi: Pointer to vsi structure +* @max_tx_rate: max TX rate in bytes to be converted into Mbits +* +* Helper function to convert units before send to set BW limit +**/ +static u64 i40e_bw_bytes_to_mbits (struct i40e_vsi *vsi,u64 max_tx_rate) +{ +if (max_tx_rate <I40E_BW_MBPS_DIVISOR ) { +dev_warn (&vsi->back->pdev->dev, +"Setting max tx rate to minimum usable value of 50Mbps.\n" ); + max_tx_rate =I40E_BW_CREDIT_DIVISOR ; + }else { +do_div (max_tx_rate,I40E_BW_MBPS_DIVISOR ); + } + +return max_tx_rate; +} +/** * i40e_set_bw_limit - setup BW limit for Tx traffic based on max_tx_rate * @vsi: VSI to be configured
@@ -5660,10 +5680,10 @@ int i40e_set_bw_limit(struct i40e_vsi *vsi, u16 seid, u64 max_tx_rate) max_tx_rate, seid);return -EINVAL ; } -if (max_tx_rate && max_tx_rate <50 ) { +if (max_tx_rate && max_tx_rate <I40E_BW_CREDIT_DIVISOR ) {dev_warn (&pf->pdev->dev,"Setting max tx rate to minimum usable value of 50Mbps.\n" ); - max_tx_rate =50 ; + max_tx_rate =I40E_BW_CREDIT_DIVISOR ; }/* Tx rate credits are in values of 50Mbps, 0 is disabled */
@@ -7591,9 +7611,9 @@ static int i40e_setup_tc(struct net_device *netdev, void *type_data)if (pf->flags &I40E_FLAG_TC_MQPRIO ) {if (vsi->mqprio_qopt.max_rate[0 ]) { -u64 max_tx_rate = vsi->mqprio_qopt.max_rate[0 ]; +u64 max_tx_rate =i40e_bw_bytes_to_mbits (vsi, + vsi->mqprio_qopt.max_rate[0 ]); -do_div (max_tx_rate,I40E_BW_MBPS_DIVISOR ); ret =i40e_set_bw_limit (vsi, vsi->seid, max_tx_rate);if (!ret) {u64 credits = max_tx_rate;
@@ -10247,10 +10267,10 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) }if (vsi->mqprio_qopt.max_rate[0 ]) { -u64 max_tx_rate = vsi->mqprio_qopt.max_rate[0 ]; +u64 max_tx_rate =i40e_bw_bytes_to_mbits (vsi, + vsi->mqprio_qopt.max_rate[0 ]);u64 credits =0 ; -do_div (max_tx_rate,I40E_BW_MBPS_DIVISOR ); ret =i40e_set_bw_limit (vsi, vsi->seid, max_tx_rate);if (ret) goto end_unlock;
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +20 -0
@@ -1873,6 +1873,25 @@ static void i40e_del_qch(struct i40e_vf *vf) } } +/** +* i40e_vc_get_max_frame_size +* @vf: pointer to the VF +* +* Max frame size is determined based on the current port's max frame size and +* whether a port VLAN is configured on this VF. The VF is not aware whether +* it's in a port VLAN so the PF needs to account for this in max frame size +* checks and sending the max frame size to the VF. +**/ +static u16 i40e_vc_get_max_frame_size (struct i40e_vf *vf) +{ +u16 max_frame_size = vf->pf->hw.phy.link_info.max_frame_size; + +if (vf->port_vlan_id) + max_frame_size -=VLAN_HLEN ; + +return max_frame_size; +} +/** * i40e_vc_get_vf_resources_msg * @vf: pointer to the VF info
@@ -1973,6 +1992,7 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg) vfres->max_vectors = pf->hw.func_caps.num_msix_vectors_vf; vfres->rss_key_size =I40E_HKEY_ARRAY_SIZE ; vfres->rss_lut_size =I40E_VF_HLUT_ARRAY_SIZE ; + vfres->max_mtu =i40e_vc_get_max_frame_size (vf);if (vf->lan_vsi_idx) { vfres->vsi_res[0 ].vsi_id = vf->lan_vsi_id;
drivers/net/ethernet/intel/iavf/iavf_txrx.c +6 -3
@@ -114,8 +114,11 @@ u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw) {u32 head, tail; +/* underlying hardware might not allow access and/or always return +* 0 for the head/tail registers so just use the cached values +*/ head = ring->next_to_clean; - tail =readl (ring->tail); + tail = ring->next_to_use;if (head != tail) return (head < tail) ?
@@ -1371,7 +1374,7 @@ static struct sk_buff *iavf_build_skb(struct iavf_ring *rx_ring,#endif struct sk_buff *skb; -if (!rx_buffer) +if (!rx_buffer || !size)return NULL ;/* prefetch first cache line of first page */ va =page_address (rx_buffer->page) + rx_buffer->page_offset;
@@ -1531,7 +1534,7 @@ static int iavf_clean_rx_irq(struct iavf_ring *rx_ring, int budget)/* exit if we failed to retrieve a buffer */ if (!skb) { rx_ring->rx_stats.alloc_buff_failed++; -if (rx_buffer) +if (rx_buffer && size) rx_buffer->pagecnt_bias++;break ; }
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +5 -2
@@ -241,11 +241,14 @@ int iavf_get_vf_config(struct iavf_adapter *adapter)void iavf_configure_queues (struct iavf_adapter *adapter) {struct virtchnl_vsi_queue_config_info *vqci; -struct virtchnl_queue_pair_info *vqpi; +int i, max_frame = adapter->vf_res->max_mtu;int pairs = adapter->num_active_queues; -int i, max_frame =IAVF_MAX_RXBUFFER ; +struct virtchnl_queue_pair_info *vqpi;size_t len; +if (max_frame >IAVF_MAX_RXBUFFER || !max_frame) + max_frame =IAVF_MAX_RXBUFFER ; +if (adapter->current_op !=VIRTCHNL_OP_UNKNOWN ) {/* bail because we already have a command pending */ dev_err(&adapter->pdev->dev, "Cannot configure queues, command %d pending\n",
drivers/net/ethernet/sun/sunhme.c +2 -2
@@ -2064,9 +2064,9 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)skb_reserve (copy_skb,2 );skb_put (copy_skb, len); -dma_sync_single_for_cpu (hp->dma_dev, dma_addr, len,DMA_FROM_DEVICE ); +dma_sync_single_for_cpu (hp->dma_dev, dma_addr, len +2 ,DMA_FROM_DEVICE );skb_copy_from_linear_data (skb, copy_skb->data, len); -dma_sync_single_for_device (hp->dma_dev, dma_addr, len,DMA_FROM_DEVICE ); +dma_sync_single_for_device (hp->dma_dev, dma_addr, len +2 ,DMA_FROM_DEVICE );/* Reuse original ring buffer. */ hme_write_rxd(hp, this, (RXFLAG_OWN|((RX_BUF_ALLOC_SIZE-RX_OFFSET)<<16)),
drivers/net/ipvlan/ipvlan_core.c +4 -2
@@ -496,7 +496,6 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)static int ipvlan_process_outbound (struct sk_buff *skb) { -struct ethhdr *ethh =eth_hdr (skb);int ret =NET_XMIT_DROP ;/* The ipvlan is a pseudo-L2 device, so the packets that we receive
@@ -506,6 +505,8 @@ static int ipvlan_process_outbound(struct sk_buff *skb)if (skb_mac_header_was_set (skb)) {/* In this mode we dont care about * multicast and broadcast traffic */ +struct ethhdr *ethh =eth_hdr (skb); +if (is_multicast_ether_addr (ethh->h_dest)) { pr_debug_ratelimited( "Dropped {multi|broad}cast of type=[%x]\n",
@@ -590,7 +591,7 @@ static int ipvlan_xmit_mode_l3(struct sk_buff *skb, struct net_device *dev)static int ipvlan_xmit_mode_l2 (struct sk_buff *skb,struct net_device *dev) {const struct ipvl_dev *ipvlan =netdev_priv (dev); -struct ethhdr *eth =eth_hdr (skb); +struct ethhdr *eth =skb_eth_hdr (skb);struct ipvl_addr *addr;void *lyr3h;int addr_type;
@@ -620,6 +621,7 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)return dev_forward_skb (ipvlan->phy_dev, skb); }else if (is_multicast_ether_addr (eth->h_dest)) { +skb_reset_mac_header (skb);ipvlan_skb_crossing_ns (skb,NULL );ipvlan_multicast_enqueue (ipvlan->port, skb, true);return NET_XMIT_SUCCESS ;
drivers/net/team/team.c +18 -6
@@ -1270,10 +1270,12 @@ static int team_port_add(struct team *team, struct net_device *port_dev, } } -netif_addr_lock_bh (dev); -dev_uc_sync_multiple (port_dev, dev); -dev_mc_sync_multiple (port_dev, dev); -netif_addr_unlock_bh (dev); +if (dev->flags &IFF_UP ) { +netif_addr_lock_bh (dev); +dev_uc_sync_multiple (port_dev, dev); +dev_mc_sync_multiple (port_dev, dev); +netif_addr_unlock_bh (dev); + } port->index =-1 ;list_add_tail_rcu (&port->list, &team->port_list);
@@ -1344,8 +1346,10 @@ static int team_port_del(struct team *team, struct net_device *port_dev)netdev_rx_handler_unregister (port_dev);team_port_disable_netpoll (port);vlan_vids_del_by_dev (port_dev, dev); -dev_uc_unsync (port_dev, dev); -dev_mc_unsync (port_dev, dev); +if (dev->flags &IFF_UP ) { +dev_uc_unsync (port_dev, dev); +dev_mc_unsync (port_dev, dev); + }dev_close (port_dev);team_port_leave (team, port);
@@ -1694,6 +1698,14 @@ static int team_open(struct net_device *dev)static int team_close (struct net_device *dev) { +struct team *team =netdev_priv (dev); +struct team_port *port; + +list_for_each_entry (port, &team->port_list, list) { +dev_uc_unsync (port->dev, dev); +dev_mc_unsync (port->dev, dev); + } +return 0 ; }
drivers/net/usb/qmi_wwan.c +1 -0
@@ -1046,6 +1046,7 @@ static const struct usb_device_id products[] = { {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */ + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0801)}, /* Quectel RM520N *//* 3. Combined interface devices matching on interface number */ {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */
drivers/of/fdt.c +1 -1
@@ -315,7 +315,7 @@ static int unflatten_dt_nodes(const void *blob,for (offset =0 ; offset >=0 && depth >= initial_depth; offset =fdt_next_node (blob, offset, &depth)) { -if (WARN_ON_ONCE (depth >=FDT_MAX_DEPTH )) +if (WARN_ON_ONCE (depth >=FDT_MAX_DEPTH -1 ))continue ; if (!IS_ENABLED(CONFIG_OF_KOBJ) &&
drivers/of/of_mdio.c +1 -0
@@ -281,6 +281,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)return 0 ; unregister: +of_node_put (child);mdiobus_unregister (mdio);return rc; }
drivers/parisc/ccio-dma.c +1 -0
@@ -1544,6 +1544,7 @@ static int __init ccio_probe(struct parisc_device *dev) }ccio_ioc_init (ioc);if (ccio_init_resources (ioc)) { +iounmap (ioc->ioc_regs);kfree (ioc);return -ENOMEM ; }
drivers/regulator/pfuze100-regulator.c +1 -1
@@ -788,7 +788,7 @@ static int pfuze100_regulator_probe(struct i2c_client *client, ((pfuze_chip->chip_id == PFUZE3000) ? "3000" : "3001"))));memcpy (pfuze_chip->regulator_descs, pfuze_chip->pfuze_regulators, -sizeof (pfuze_chip->regulator_descs)); + regulator_num *sizeof (struct pfuze_regulator )); ret =pfuze_parse_regulators_dt (pfuze_chip);if (ret)
drivers/s390/block/dasd_alias.c +7 -2
@@ -675,12 +675,12 @@ int dasd_alias_remove_device(struct dasd_device *device)struct dasd_device *dasd_alias_get_start_dev (struct dasd_device *base_device) {struct dasd_eckd_private *alias_priv, *private = base_device->private; -struct alias_pav_group *group = private->pavgroup;struct alias_lcu *lcu = private->lcu;struct dasd_device *alias_device; +struct alias_pav_group *group;unsigned long flags; -if (!group || !lcu) +if (!lcu)return NULL ;if (lcu->pav ==NO_PAV || lcu->flags & (NEED_UAC_UPDATE |UPDATE_PENDING ))
@@ -697,6 +697,11 @@ struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *base_device) }spin_lock_irqsave (&lcu->lock, flags); + group = private->pavgroup; +if (!group) { +spin_unlock_irqrestore (&lcu->lock, flags); +return NULL ; + } alias_device = group->next;if (!alias_device) {if (list_empty (&group->aliaslist)) {
drivers/tty/serial/atmel_serial.c +20 -12
@@ -306,16 +306,16 @@ static int atmel_config_rs485(struct uart_port *port, mode =atmel_uart_readl (port,ATMEL_US_MR ); -/* Resetting serial mode to RS232 (0x0) */ - mode &= ~ATMEL_US_USMODE ; - - port->rs485 = *rs485conf; -if (rs485conf->flags &SER_RS485_ENABLED ) {dev_dbg (port->dev,"Setting UART to RS485\n" ); - atmel_port->tx_done_mask =ATMEL_US_TXEMPTY ; +if (rs485conf->flags &SER_RS485_RX_DURING_TX ) + atmel_port->tx_done_mask =ATMEL_US_TXRDY ; +else + atmel_port->tx_done_mask =ATMEL_US_TXEMPTY ; +atmel_uart_writel (port,ATMEL_US_TTGR , rs485conf->delay_rts_after_send); + mode &= ~ATMEL_US_USMODE ; mode |=ATMEL_US_USMODE_RS485 ; }else {dev_dbg (port->dev,"Setting UART to RS232\n" );
@@ -832,7 +832,7 @@ static void atmel_tx_chars(struct uart_port *port)struct atmel_uart_port *atmel_port =to_atmel_uart_port (port);if (port->x_char && - (atmel_uart_readl (port,ATMEL_US_CSR ) & atmel_port->tx_done_mask)) { + (atmel_uart_readl (port,ATMEL_US_CSR ) &ATMEL_US_TXRDY )) {atmel_uart_write_char (port, port->x_char); port->icount.tx++; port->x_char =0 ;
@@ -840,8 +840,7 @@ static void atmel_tx_chars(struct uart_port *port)if (uart_circ_empty (xmit) ||uart_tx_stopped (port))return ; -while (atmel_uart_readl (port,ATMEL_US_CSR ) & - atmel_port->tx_done_mask) { +while (atmel_uart_readl (port,ATMEL_US_CSR ) &ATMEL_US_TXRDY ) {atmel_uart_write_char (port, xmit->buf[xmit->tail]); xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); port->icount.tx++;
@@ -852,10 +851,20 @@ static void atmel_tx_chars(struct uart_port *port)if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (port); -if (!uart_circ_empty (xmit)) +if (!uart_circ_empty (xmit)) { +/* we still have characters to transmit, so we should continue +* transmitting them when TX is ready, regardless of +* mode or duplexity +*/ + atmel_port->tx_done_mask |=ATMEL_US_TXRDY ; +/* Enable interrupts */ atmel_uart_writel (port,ATMEL_US_IER , atmel_port->tx_done_mask); + }else { +if (atmel_uart_is_half_duplex (port)) + atmel_port->tx_done_mask &= ~ATMEL_US_TXRDY ; + } }static void atmel_complete_tx_dma (void *arg)
@@ -2541,8 +2550,7 @@ static int atmel_init_port(struct atmel_uart_port *atmel_port,* Use TXEMPTY for interrupt when rs485 or ISO7816 else TXRDY or * ENDTX|TXBUFE */ -if (port->rs485.flags &SER_RS485_ENABLED || - port->iso7816.flags &SER_ISO7816_ENABLED ) +if (atmel_uart_is_half_duplex (port)) atmel_port->tx_done_mask =ATMEL_US_TXEMPTY ;else if (atmel_use_pdc_tx (port)) { port->fifosize =PDC_BUFFER_SIZE ;
drivers/tty/serial/serial-tegra.c +2 -3
@@ -519,7 +519,7 @@ static void tegra_uart_tx_dma_complete(void *args) count = tup->tx_bytes_requested - state.residue;async_tx_ack (tup->tx_dma_desc);spin_lock_irqsave (&tup->uport.lock, flags); - xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE -1 ); +uart_xmit_advance (&tup->uport, count); tup->tx_in_progress =0 ;if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (&tup->uport);
@@ -606,7 +606,6 @@ static unsigned int tegra_uart_tx_empty(struct uart_port *u)static void tegra_uart_stop_tx (struct uart_port *u) {struct tegra_uart_port *tup =to_tegra_uport (u); -struct circ_buf *xmit = &tup->uport.state->xmit;struct dma_tx_state state;unsigned int count;
@@ -617,7 +616,7 @@ static void tegra_uart_stop_tx(struct uart_port *u)dmaengine_tx_status (tup->tx_dma_chan, tup->tx_cookie, &state); count = tup->tx_bytes_requested - state.residue;async_tx_ack (tup->tx_dma_desc); - xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE -1 ); +uart_xmit_advance (&tup->uport, count); tup->tx_in_progress =0 ; }
drivers/tty/serial/tegra-tcu.c +1 -1
@@ -101,7 +101,7 @@ static void tegra_tcu_uart_start_tx(struct uart_port *port)break ;tegra_tcu_write (tcu, &xmit->buf[xmit->tail], count); - xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE -1 ); +uart_xmit_advance (port, count); }uart_write_wakeup (port);
drivers/usb/cdns3/gadget.c +1 -0
@@ -1259,6 +1259,7 @@ static int cdns3_check_ep_interrupt_proceed(struct cdns3_endpoint *priv_ep) ep_cfg &= ~EP_CFG_ENABLE ;writel (ep_cfg, &priv_dev->regs->ep_cfg); priv_ep->flags &= ~EP_QUIRK_ISO_OUT_EN ; + priv_ep->flags |=EP_UPDATE_EP_TRBADDR ; }cdns3_transfer_completed (priv_dev, priv_ep); } else if (!(priv_ep->flags & EP_STALLED) &&
drivers/usb/core/hub.c +1 -1
@@ -5924,7 +5924,7 @@ static int usb_reset_and_verify_device(struct usb_device *udev)* * Return: The same as for usb_reset_and_verify_device(). * However, if a reset is already in progress (for instance, if a -* driver doesn't have pre_ or post_reset() callbacks, and while +* driver doesn't have pre_reset() or post_reset() callbacks, and while * being unbound or re-bound during the ongoing reset its disconnect() * or probe() routine tries to perform a second, nested reset), the * routine returns -EINPROGRESS.
drivers/usb/dwc3/core.c +1 -1
@@ -227,7 +227,7 @@ u32 dwc3_core_fifo_space(struct dwc3_ep *dep, u8 type)* dwc3_core_soft_reset - Issues core soft reset and PHY reset * @dwc: pointer to our context structure */ -static int dwc3_core_soft_reset (struct dwc3 *dwc) +int dwc3_core_soft_reset (struct dwc3 *dwc) {u32 reg;int retries =1000 ;
drivers/usb/dwc3/core.h +4 -0
@@ -994,6 +994,7 @@ struct dwc3_scratchpad_array {* @tx_max_burst_prd: max periodic ESS transmit burst size * @hsphy_interface: "utmi" or "ulpi" * @connected: true when we're connected to a host, false otherwise +* @softconnect: true when gadget connect is called, false when disconnect runs * @delayed_status: true when gadget driver asks for delayed status * @ep0_bounced: true when we used bounce buffer * @ep0_expect_in: true when we expect a DATA IN transfer
@@ -1196,6 +1197,7 @@ struct dwc3 {const char *hsphy_interface; unsigned connected:1; + unsigned softconnect:1; unsigned delayed_status:1; unsigned ep0_bounced:1; unsigned ep0_expect_in:1;
@@ -1420,6 +1422,8 @@ bool dwc3_has_imod(struct dwc3 *dwc);int dwc3_event_buffers_setup (struct dwc3 *dwc);void dwc3_event_buffers_cleanup (struct dwc3 *dwc); +int dwc3_core_soft_reset (struct dwc3 *dwc); +#if IS_ENABLED (CONFIG_USB_DWC3_HOST ) ||IS_ENABLED (CONFIG_USB_DWC3_DUAL_ROLE )int dwc3_host_init (struct dwc3 *dwc);void dwc3_host_exit (struct dwc3 *dwc);
drivers/usb/dwc3/gadget.c +43 -38
114 lines not on this page · raw message
drivers/usb/host/xhci-mtk-sch.c +85 -64
285 lines not on this page · raw message
drivers/usb/host/xhci-mtk.h +0 -2
@@ -20,14 +20,12 @@#define XHCI_MTK_MAX_ESIT 64/** -* @ss_bit_map: used to avoid start split microframes overlay * @fs_bus_bw: array to keep track of bandwidth already used for FS * @ep_list: Endpoints using this TT * @usb_tt: usb TT related * @tt_port: TT port number */ struct mu3h_sch_tt { - DECLARE_BITMAP(ss_bit_map, XHCI_MTK_MAX_ESIT);u32 fs_bus_bw[XHCI_MTK_MAX_ESIT ];struct list_head ep_list;struct usb_tt *usb_tt;
drivers/usb/serial/option.c +6 -0
@@ -256,6 +256,7 @@ static void option_instat_callback(struct urb *urb);#define QUECTEL_PRODUCT_EM060K 0x030b#define QUECTEL_PRODUCT_EM12 0x0512#define QUECTEL_PRODUCT_RM500Q 0x0800 +#define QUECTEL_PRODUCT_RM520N 0x0801#define QUECTEL_PRODUCT_EC200S_CN 0x6002#define QUECTEL_PRODUCT_EC200T 0x6026#define QUECTEL_PRODUCT_RM500K 0x7001
@@ -1138,6 +1139,8 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0xff, 0xff), .driver_info = NUMEP2 }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) }, + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, 0x0203, 0xff), /* BG95-M3 */ + .driver_info = ZLP }, { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), .driver_info = RSVD(4) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff),
@@ -1159,6 +1162,9 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10), .driver_info = ZLP }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0xff, 0x30) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0x40) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K, 0xff, 0x00, 0x00) },
drivers/video/fbdev/pxa3xx-gcu.c +1 -1
@@ -382,7 +382,7 @@ pxa3xx_gcu_write(struct file *file, const char *buff,struct pxa3xx_gcu_batch *buffer;struct pxa3xx_gcu_priv *priv =to_pxa3xx_gcu_priv (file); -int words = count /4 ; +size_t words = count /4 ;/* Does not need to be atomic. There's a lock in user space, * but anyhow, this is just for statistics. */
fs/afs/misc.c +1 -0
@@ -69,6 +69,7 @@ int afs_abort_to_error(u32 abort_code)/* Unified AFS error table */ case UAEPERM :return -EPERM ;case UAENOENT :return -ENOENT ; +case UAEAGAIN :return -EAGAIN ;case UAEACCES :return -EACCES ;case UAEBUSY :return -EBUSY ;case UAEEXIST :return -EEXIST ;
fs/cifs/connect.c +2 -5
@@ -791,9 +791,6 @@ cifs_readv_from_socket(struct TCP_Server_Info *server, struct msghdr *smb_msg)int length =0 ;int total_read; - smb_msg->msg_control =NULL ; - smb_msg->msg_controllen =0 ; -for (total_read =0 ;msg_data_left (smb_msg); total_read += length) {try_to_freeze ();
@@ -844,7 +841,7 @@ int cifs_read_from_socket(struct TCP_Server_Info *server, char *buf, unsigned int to_read) { - struct msghdr smb_msg; + struct msghdr smb_msg = {};struct kvec iov = {.iov_base = buf, .iov_len = to_read};iov_iter_kvec (&smb_msg.msg_iter,READ , &iov,1 , to_read);
@@ -855,7 +852,7 @@ int cifs_read_page_from_socket(struct TCP_Server_Info *server, struct page *page, unsigned int page_offset, unsigned int to_read) { - struct msghdr smb_msg; + struct msghdr smb_msg = {};struct bio_vec bv = { .bv_page = page, .bv_len = to_read, .bv_offset = page_offset};iov_iter_bvec (&smb_msg.msg_iter,READ , &bv,1 , to_read);
fs/cifs/file.c +3 -0
@@ -3194,6 +3194,9 @@ static ssize_t __cifs_writev(ssize_t cifs_direct_writev (struct kiocb *iocb,struct iov_iter *from) { +struct file *file = iocb->ki_filp; + +cifs_revalidate_mapping (file->f_inode);return __cifs_writev (iocb, from, true); }
fs/cifs/transport.c +1 -5
@@ -209,10 +209,6 @@ smb_send_kvec(struct TCP_Server_Info *server, struct msghdr *smb_msg, *sent =0 ; - smb_msg->msg_name = (struct sockaddr *) &server->dstaddr; - smb_msg->msg_namelen =sizeof (struct sockaddr ); - smb_msg->msg_control =NULL ; - smb_msg->msg_controllen =0 ;if (server->noblocksnd) smb_msg->msg_flags =MSG_DONTWAIT +MSG_NOSIGNAL ;else
@@ -324,7 +320,7 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,sigset_t mask, oldmask;size_t total_len =0 , sent, size;struct socket *ssocket = server->ssocket; -struct msghdr smb_msg; +struct msghdr smb_msg = {};int val =1 ;__be32 rfc1002_marker;
fs/ext4/extents.c +4 -0
@@ -500,6 +500,10 @@ static int __ext4_ext_check(const char *function, unsigned int line, error_msg ="invalid eh_entries" ; goto corrupted; } +if (unlikely ((eh->eh_entries ==0 ) && (depth >0 ))) { + error_msg ="eh_entries is 0 but eh_depth is > 0" ; + goto corrupted; + }if (!ext4_valid_extent_entries (inode, eh, lblk, &pblk, depth)) { error_msg ="invalid extent entries" ; goto corrupted;
fs/ext4/ialloc.c +1 -1
@@ -500,7 +500,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent, goto fallback; } - max_dirs = ndirs / ngroups + inodes_per_group /16 ; + max_dirs = ndirs / ngroups + inodes_per_group*flex_size /16 ; min_inodes = avefreei - inodes_per_group*flex_size /4 ;if (min_inodes <1 ) min_inodes =1 ;
fs/nfs/super.c +18 -9
@@ -2375,22 +2375,31 @@ void nfs_fill_super(struct super_block *sb, struct nfs_mount_info *mount_info)if (data && data->bsize) sb->s_blocksize =nfs_block_size (data->bsize, &sb->s_blocksize_bits); -if (server->nfs_client->rpc_ops->version !=2 ) { -/* The VFS shouldn't apply the umask to mode bits. We will do -* so ourselves when necessary. +switch (server->nfs_client->rpc_ops->version) { +case 2 : + sb->s_time_gran =1000 ; + sb->s_time_min =0 ; + sb->s_time_max =U32_MAX ; +break ; +case 3 : +/* +* The VFS shouldn't apply the umask to mode bits. +* We will do so ourselves when necessary. */ sb->s_flags |=SB_POSIXACL ; sb->s_time_gran =1 ; - sb->s_export_op = &nfs_export_ops; - }else - sb->s_time_gran =1000 ; - -if (server->nfs_client->rpc_ops->version !=4 ) { sb->s_time_min =0 ; sb->s_time_max =U32_MAX ; - }else { + sb->s_export_op = &nfs_export_ops; +break ; +case 4 : + sb->s_flags |=SB_POSIXACL ; + sb->s_time_gran =1 ; sb->s_time_min =S64_MIN ; sb->s_time_max =S64_MAX ; +if (server->caps &NFS_CAP_ATOMIC_OPEN_V1 ) + sb->s_export_op = &nfs_export_ops; +break ; }nfs_initialise_sb (sb);
fs/xfs/libxfs/xfs_alloc.c +20 -7
@@ -684,8 +684,10 @@ xfs_alloc_update_counters(xfs_trans_agblocks_delta (tp, len);if (unlikely (be32_to_cpu (agf->agf_freeblks) > -be32_to_cpu (agf->agf_length))) +be32_to_cpu (agf->agf_length))) { +xfs_buf_corruption_error (agbp);return -EFSCORRUPTED ; + }xfs_alloc_log_agf (tp, agbp,XFS_AGF_FREEBLKS );return 0 ;
@@ -751,6 +753,7 @@ xfs_alloc_ag_vextent_small( bp =xfs_btree_get_bufs (args->mp, args->tp, args->agno, fbno);if (!bp) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , args->mp); error = -EFSCORRUPTED ; goto error; }
@@ -1995,24 +1998,32 @@ xfs_alloc_longest_free_extent(return pag->pagf_flcount >0 || pag->pagf_longest >0 ; } +/* +* Compute the minimum length of the AGFL in the given AG. If @pag is NULL, +* return the largest possible minimum length. +*/ unsigned int xfs_alloc_min_freelist (struct xfs_mount *mp,struct xfs_perag *pag) { +/* AG btrees have at least 1 level. */ +static const uint8_t fake_levels[XFS_BTNUM_AGF ] = {1 ,1 ,1 }; +const uint8_t *levels = pag ? pag->pagf_levels : fake_levels;unsigned int min_free; +ASSERT (mp->m_ag_maxlevels >0 ); +/* space needed by-bno freespace btree */ - min_free = min_t(unsigned int, pag->pagf_levels[XFS_BTNUM_BNOi] + 1, + min_free = min_t(unsigned int, levels[XFS_BTNUM_BNOi] + 1, mp->m_ag_maxlevels);/* space needed by-size freespace btree */ - min_free += min_t(unsigned int, pag->pagf_levels[XFS_BTNUM_CNTi] + 1, + min_free += min_t(unsigned int, levels[XFS_BTNUM_CNTi] + 1, mp->m_ag_maxlevels);/* space needed reverse mapping used space btree */ if (xfs_sb_version_hasrmapbt (&mp->m_sb)) - min_free += min_t(unsigned int, - pag->pagf_levels[XFS_BTNUM_RMAPi] +1 , - mp->m_rmap_maxlevels); + min_free += min_t(unsigned int, levels[XFS_BTNUM_RMAPi] + 1, + mp->m_rmap_maxlevels);return min_free; }
@@ -2087,8 +2098,10 @@ xfs_free_agfl_block(return error; bp =xfs_btree_get_bufs (tp->t_mountp, tp, agno, agbno); -if (!bp) +if (!bp) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , tp->t_mountp);return -EFSCORRUPTED ; + }xfs_trans_binval (tp, bp);return 0 ;
fs/xfs/libxfs/xfs_attr_leaf.c +9 -3
@@ -2287,8 +2287,10 @@ xfs_attr3_leaf_lookup_int( leaf = bp->b_addr;xfs_attr3_leaf_hdr_from_disk (args->geo, &ichdr, leaf); entries =xfs_attr3_leaf_entryp (leaf); -if (ichdr.count >= args->geo->blksize /8 ) +if (ichdr.count >= args->geo->blksize /8 ) { +xfs_buf_corruption_error (bp);return -EFSCORRUPTED ; + }/* * Binary search. (note: small blocks will skip this loop)
@@ -2304,10 +2306,14 @@ xfs_attr3_leaf_lookup_int(else break ; } -if (!(probe >=0 && (!ichdr.count || probe < ichdr.count))) +if (!(probe >=0 && (!ichdr.count || probe < ichdr.count))) { +xfs_buf_corruption_error (bp);return -EFSCORRUPTED ; -if (!(span <=4 ||be32_to_cpu (entry->hashval) == hashval)) + } +if (!(span <=4 ||be32_to_cpu (entry->hashval) == hashval)) { +xfs_buf_corruption_error (bp);return -EFSCORRUPTED ; + }/* * Since we may have duplicate hashval's, find the first matching
fs/xfs/libxfs/xfs_bmap.c +11 -5
@@ -729,6 +729,7 @@ xfs_bmap_extents_to_btree(xfs_trans_mod_dquot_byino (tp, ip,XFS_TRANS_DQ_BCOUNT ,1L ); abp =xfs_btree_get_bufl (mp, tp, args.fsbno);if (!abp) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , mp); error = -EFSCORRUPTED ; goto out_unreserve_dquot; }
@@ -1084,6 +1085,7 @@ xfs_bmap_add_attrfork(if (XFS_IFORK_Q (ip)) goto trans_cancel;if (ip->i_d.di_anextents !=0 ) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , mp); error = -EFSCORRUPTED ; goto trans_cancel; }
@@ -1374,7 +1376,8 @@ xfs_bmap_last_before(case XFS_DINODE_FMT_EXTENTS :break ;default : -return -EIO ; +ASSERT (0 ); +return -EFSCORRUPTED ; }if (!(ifp->if_flags &XFS_IFEXTENTS )) {
@@ -1474,8 +1477,10 @@ xfs_bmap_last_offset(return 0 ;if (XFS_IFORK_FORMAT (ip, whichfork) !=XFS_DINODE_FMT_BTREE && -XFS_IFORK_FORMAT (ip, whichfork) !=XFS_DINODE_FMT_EXTENTS ) -return -EIO ; +XFS_IFORK_FORMAT (ip, whichfork) !=XFS_DINODE_FMT_EXTENTS ) { +ASSERT (0 ); +return -EFSCORRUPTED ; + } error =xfs_bmap_last_extent (NULL , ip, whichfork, &rec, &is_empty);if (error || is_empty)
@@ -5871,8 +5876,9 @@ xfs_bmap_insert_extents(XFS_WANT_CORRUPTED_GOTO (mp, !isnullstartblock (got.br_startblock), del_cursor); -if (stop_fsb >= got.br_startoff + got.br_blockcount) { - error = -EIO ; +if (stop_fsb > got.br_startoff) { +ASSERT (0 ); + error = -EFSCORRUPTED ; goto del_cursor; }
fs/xfs/libxfs/xfs_btree.c +4 -1
@@ -1820,6 +1820,7 @@ xfs_btree_lookup_get_block( out_bad: *blkp =NULL ; +xfs_buf_corruption_error (bp);xfs_trans_brelse (cur->bc_tp, bp);return -EFSCORRUPTED ; }
@@ -1867,8 +1868,10 @@ xfs_btree_lookup(XFS_BTREE_STATS_INC (cur, lookup);/* No such thing as a zero-level tree. */ -if (cur->bc_nlevels ==0 ) +if (cur->bc_nlevels ==0 ) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , cur->bc_mp);return -EFSCORRUPTED ; + } block =NULL ; keyno =0 ;
fs/xfs/libxfs/xfs_da_btree.c +18 -6
@@ -504,6 +504,7 @@ xfs_da3_split( node = oldblk->bp->b_addr;if (node->hdr.info.forw) {if (be32_to_cpu (node->hdr.info.forw) != addblk->blkno) { +xfs_buf_corruption_error (oldblk->bp); error = -EFSCORRUPTED ; goto out; }
@@ -516,6 +517,7 @@ xfs_da3_split( node = oldblk->bp->b_addr;if (node->hdr.info.back) {if (be32_to_cpu (node->hdr.info.back) != addblk->blkno) { +xfs_buf_corruption_error (oldblk->bp); error = -EFSCORRUPTED ; goto out; }
@@ -1541,8 +1543,10 @@ xfs_da3_node_lookup_int(break ; } -if (magic !=XFS_DA_NODE_MAGIC && magic !=XFS_DA3_NODE_MAGIC ) +if (magic !=XFS_DA_NODE_MAGIC && magic !=XFS_DA3_NODE_MAGIC ) { +xfs_buf_corruption_error (blk->bp);return -EFSCORRUPTED ; + } blk->magic =XFS_DA_NODE_MAGIC ;
@@ -1554,15 +1558,18 @@ xfs_da3_node_lookup_int( btree = dp->d_ops->node_tree_p (node);/* Tree taller than we can handle; bail out! */ -if (nodehdr.level >=XFS_DA_NODE_MAXDEPTH ) +if (nodehdr.level >=XFS_DA_NODE_MAXDEPTH ) { +xfs_buf_corruption_error (blk->bp);return -EFSCORRUPTED ; + }/* Check the level from the root. */ if (blkno == args->geo->leafblk) expected_level = nodehdr.level -1 ; -else if (expected_level != nodehdr.level) +else if (expected_level != nodehdr.level) { +xfs_buf_corruption_error (blk->bp);return -EFSCORRUPTED ; -else + }else expected_level--; max = nodehdr.count;
@@ -1612,12 +1619,17 @@ xfs_da3_node_lookup_int( }/* We can't point back to the root. */ -if (blkno == args->geo->leafblk) +if (blkno == args->geo->leafblk) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , + dp->i_mount);return -EFSCORRUPTED ; + } } -if (expected_level !=0 ) +if (expected_level !=0 ) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , dp->i_mount);return -EFSCORRUPTED ; + }/* * A leaf block that ends in the hashval that we are interested in
fs/xfs/libxfs/xfs_dir2.c +3 -1
@@ -600,8 +600,10 @@ xfs_dir2_isblock(if ((rval =xfs_bmap_last_offset (args->dp, &last,XFS_DATA_FORK )))return rval; rval =XFS_FSB_TO_B (args->dp->i_mount, last) == args->geo->blksize; -if (rval !=0 && args->dp->i_d.di_size != args->geo->blksize) +if (rval !=0 && args->dp->i_d.di_size != args->geo->blksize) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , args->dp->i_mount);return -EFSCORRUPTED ; + } *vp = rval;return 0 ; }
fs/xfs/libxfs/xfs_dir2_leaf.c +3 -1
@@ -1343,8 +1343,10 @@ xfs_dir2_leaf_removename( oldbest =be16_to_cpu (bf[0 ].length); ltp =xfs_dir2_leaf_tail_p (args->geo, leaf); bestsp =xfs_dir2_leaf_bests_p (ltp); -if (be16_to_cpu (bestsp[db]) != oldbest) +if (be16_to_cpu (bestsp[db]) != oldbest) { +xfs_buf_corruption_error (lbp);return -EFSCORRUPTED ; + }/* * Mark the former data entry unused. */
fs/xfs/libxfs/xfs_dir2_node.c +9 -3
@@ -374,8 +374,10 @@ xfs_dir2_leaf_to_node( leaf = lbp->b_addr; ltp =xfs_dir2_leaf_tail_p (args->geo, leaf);if (be32_to_cpu (ltp->bestcount) > - (uint )dp->i_d.di_size / args->geo->blksize) + (uint )dp->i_d.di_size / args->geo->blksize) { +xfs_buf_corruption_error (lbp);return -EFSCORRUPTED ; + }/* * Copy freespace entries from the leaf block to the new block.
@@ -446,8 +448,10 @@ xfs_dir2_leafn_add(* Quick check just to make sure we are not going to index * into other peoples memory */ -if (index <0 ) +if (index <0 ) { +xfs_buf_corruption_error (bp);return -EFSCORRUPTED ; + }/* * If there are already the maximum number of leaf entries in
@@ -740,8 +744,10 @@ xfs_dir2_leafn_lookup_for_entry( ents = dp->d_ops->leaf_ents_p (leaf);xfs_dir3_leaf_check (dp, bp); -if (leafhdr.count <=0 ) +if (leafhdr.count <=0 ) { +xfs_buf_corruption_error (bp);return -EFSCORRUPTED ; + }/* * Look up the hash value in the leaf entries.
fs/xfs/libxfs/xfs_dir2_sf.c +23 -5
@@ -944,6 +944,27 @@ xfs_dir2_sf_removename(return 0 ; } +/* +* Check whether the sf dir replace operation need more blocks. +*/ +static bool +xfs_dir2_sf_replace_needblock ( +struct xfs_inode *dp, +xfs_ino_t inum) +{ +int newsize; +struct xfs_dir2_sf_hdr *sfp; + +if (dp->i_d.di_format !=XFS_DINODE_FMT_LOCAL ) +return false; + + sfp = (struct xfs_dir2_sf_hdr *)dp->i_df.if_u1.if_data; + newsize = dp->i_df.if_bytes + (sfp->count +1 ) *XFS_INO64_DIFF ; + +return inum >XFS_DIR2_MAX_SHORT_INUM && + sfp->i8count ==0 && newsize >XFS_IFORK_DSIZE (dp); +} +/* * Replace the inode number of an entry in a shortform directory. */
@@ -980,17 +1001,14 @@ xfs_dir2_sf_replace(*/ if (args->inumber >XFS_DIR2_MAX_SHORT_INUM && sfp->i8count ==0 ) {int error;/* error return value */ -int newsize;/* new inode size */ - newsize = dp->i_df.if_bytes + (sfp->count +1 ) *XFS_INO64_DIFF ;/* * Won't fit as shortform, convert to block then do replace. */ -if (newsize >XFS_IFORK_DSIZE (dp)) { +if (xfs_dir2_sf_replace_needblock (dp, args->inumber)) { error =xfs_dir2_sf_to_block (args); -if (error) { +if (error)return error; - }return xfs_dir2_block_replace (args); }/*
fs/xfs/libxfs/xfs_ialloc.c +64 -0
67 lines not on this page · raw message
fs/xfs/libxfs/xfs_ialloc.h +1 -0
@@ -152,5 +152,6 @@ int xfs_inobt_insert_rec(struct xfs_btree_cur *cur, uint16_t holemask,int xfs_ialloc_cluster_alignment (struct xfs_mount *mp);void xfs_ialloc_setup_geometry (struct xfs_mount *mp); +xfs_ino_t xfs_ialloc_calc_rootino (struct xfs_mount *mp,int sunit);#endif /* __XFS_IALLOC_H__ */
fs/xfs/libxfs/xfs_inode_fork.c +6 -0
@@ -75,11 +75,15 @@ xfs_iformat_fork( error =xfs_iformat_btree (ip, dip,XFS_DATA_FORK );break ;default : +xfs_inode_verifier_error (ip, -EFSCORRUPTED , __func__, + dip,sizeof (*dip), __this_address);return -EFSCORRUPTED ; }break ;default : +xfs_inode_verifier_error (ip, -EFSCORRUPTED , __func__, dip, +sizeof (*dip), __this_address);return -EFSCORRUPTED ; }if (error)
@@ -110,6 +114,8 @@ xfs_iformat_fork( error =xfs_iformat_btree (ip, dip,XFS_ATTR_FORK );break ;default : +xfs_inode_verifier_error (ip, error, __func__, dip, +sizeof (*dip), __this_address); error = -EFSCORRUPTED ;break ; }
fs/xfs/libxfs/xfs_refcount.c +3 -1
@@ -1591,8 +1591,10 @@ xfs_refcount_recover_extent(struct list_head *debris = priv;struct xfs_refcount_recovery *rr; -if (be32_to_cpu (rec->refc.rc_refcount) !=1 ) +if (be32_to_cpu (rec->refc.rc_refcount) !=1 ) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , cur->bc_mp);return -EFSCORRUPTED ; + } rr =kmem_alloc (sizeof (struct xfs_refcount_recovery ),0 );xfs_refcount_btrec_to_irec (rec, &rr->rr_rrec);
fs/xfs/libxfs/xfs_rtbitmap.c +4 -2
@@ -15,7 +15,7 @@#include "xfs_bmap.h" #include "xfs_trans.h" #include "xfs_rtalloc.h" - +#include "xfs_error.h" /* * Realtime allocator bitmap functions shared with userspace.
@@ -70,8 +70,10 @@ xfs_rtbuf_get(if (error)return error; -if (nmap ==0 || !xfs_bmap_is_real_extent (&map)) +if (nmap ==0 || !xfs_bmap_is_real_extent (&map)) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , mp);return -EFSCORRUPTED ; + }ASSERT (map.br_startblock !=NULLFSBLOCK ); error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp,
fs/xfs/xfs_acl.c +12 -3
@@ -12,6 +12,7 @@#include "xfs_inode.h" #include "xfs_attr.h" #include "xfs_trace.h" +#include "xfs_error.h" #include <linux/posix_acl_xattr.h>
@@ -23,6 +24,7 @@ STATIC struct posix_acl *xfs_acl_from_disk ( +struct xfs_mount *mp,const struct xfs_acl *aclp,int len,int max_entries)
@@ -32,11 +34,18 @@ xfs_acl_from_disk(const struct xfs_acl_entry *ace;unsigned int count, i; -if (len <sizeof (*aclp)) +if (len <sizeof (*aclp)) { +XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, aclp, + len);return ERR_PTR (-EFSCORRUPTED ); + } + count =be32_to_cpu (aclp->acl_cnt); -if (count > max_entries ||XFS_ACL_SIZE (count) != len) +if (count > max_entries ||XFS_ACL_SIZE (count) != len) { +XFS_CORRUPTION_ERROR (__func__,XFS_ERRLEVEL_LOW , mp, aclp, + len);return ERR_PTR (-EFSCORRUPTED ); + } acl =posix_acl_alloc (count,GFP_KERNEL );if (!acl)
@@ -145,7 +154,7 @@ xfs_get_acl(struct inode *inode, int type)if (error != -ENOATTR ) acl =ERR_PTR (error); }else { - acl =xfs_acl_from_disk (xfs_acl, len, + acl =xfs_acl_from_disk (ip->i_mount, xfs_acl, len,XFS_ACL_MAX_ENTRIES (ip->i_mount));kmem_free (xfs_acl); }
fs/xfs/xfs_attr_inactive.c +7 -3
@@ -22,6 +22,7 @@#include "xfs_attr_leaf.h" #include "xfs_quota.h" #include "xfs_dir2.h" +#include "xfs_error.h" /* * Look at all the extents for this logical region,
@@ -208,8 +209,9 @@ xfs_attr3_node_inactive(* Since this code is recursive (gasp!) we must protect ourselves. */ if (level >XFS_DA_NODE_MAXDEPTH ) { +xfs_buf_corruption_error (bp);xfs_trans_brelse (*trans, bp);/* no locks for later trans */ -return -EIO ; +return -EFSCORRUPTED ; } node = bp->b_addr;
@@ -258,8 +260,9 @@ xfs_attr3_node_inactive( error =xfs_attr3_leaf_inactive (trans, dp, child_bp);break ;default : - error = -EIO ; +xfs_buf_corruption_error (child_bp);xfs_trans_brelse (*trans, child_bp); + error = -EFSCORRUPTED ;break ; }if (error)
@@ -341,7 +344,8 @@ xfs_attr3_root_inactive( error =xfs_attr3_leaf_inactive (trans, dp, bp);break ;default : - error = -EIO ; + error = -EFSCORRUPTED ; +xfs_buf_corruption_error (bp);xfs_trans_brelse (*trans, bp);break ; }
fs/xfs/xfs_attr_list.c +4 -1
@@ -258,8 +258,10 @@ xfs_attr_node_list_lookup(return 0 ;/* We can't point back to the root. */ -if (cursor->blkno ==0 ) +if (cursor->blkno ==0 ) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , mp);return -EFSCORRUPTED ; + } }if (expected_level !=0 )
@@ -269,6 +271,7 @@ xfs_attr_node_list_lookup(return 0 ; out_corruptbuf: +xfs_buf_corruption_error (bp);xfs_trans_brelse (tp, bp);return -EFSCORRUPTED ; }
fs/xfs/xfs_bmap_item.c +4 -3
@@ -21,7 +21,7 @@#include "xfs_icache.h" #include "xfs_bmap_btree.h" #include "xfs_trans_space.h" - +#include "xfs_error.h" kmem_zone_t *xfs_bui_zone;kmem_zone_t *xfs_bud_zone;
@@ -456,7 +456,7 @@ xfs_bui_recover(if (buip->bui_format.bui_nextents !=XFS_BUI_MAX_FAST_EXTENTS ) {set_bit (XFS_BUI_RECOVERED , &buip->bui_flags);xfs_bui_release (buip); -return -EIO ; +return -EFSCORRUPTED ; }/*
@@ -490,7 +490,7 @@ xfs_bui_recover(*/ set_bit (XFS_BUI_RECOVERED , &buip->bui_flags);xfs_bui_release (buip); -return -EIO ; +return -EFSCORRUPTED ; } error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate,
@@ -525,6 +525,7 @@ xfs_bui_recover( type = bui_type;break ;default : +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , mp); error = -EFSCORRUPTED ; goto err_inode; }
fs/xfs/xfs_bmap_util.c +12 -0
@@ -1167,6 +1167,7 @@ xfs_prepare_shift( struct xfs_inode *ip, loff_t offset) { +struct xfs_mount *mp = ip->i_mount;int error;/*
@@ -1179,6 +1180,17 @@ xfs_prepare_shift(return error; } +/* +* Shift operations must stabilize the start block offset boundary along +* with the full range of the operation. If we don't, a COW writeback +* completion could race with an insert, front merge with the start +* extent (after split) during the shift and corrupt the file. Start +* with the block just prior to the start to stabilize the boundary. +*/ + offset =round_down (offset,1 << mp->m_sb.sb_blocklog); +if (offset) + offset -= (1 << mp->m_sb.sb_blocklog); +/* * Writeback and invalidate cache for the remainder of the file as we're * about to shift down every extent from offset to EOF.
fs/xfs/xfs_buf_item.c +1 -1
@@ -956,7 +956,7 @@ xfs_buf_item_relse(struct xfs_buf_log_item *bip = bp->b_log_item;trace_xfs_buf_item_relse (bp, _RET_IP_); -ASSERT (!(bip->bli_item.li_flags &XFS_LI_IN_AIL )); +ASSERT (!test_bit (XFS_LI_IN_AIL , &bip->bli_item.li_flags)); bp->b_log_item =NULL ;if (list_empty (&bp->b_li_list))
fs/xfs/xfs_dquot.c +1 -1
@@ -1125,7 +1125,7 @@ xfs_qm_dqflush(xfs_buf_relse (bp);xfs_dqfunlock (dqp);xfs_force_shutdown (mp,SHUTDOWN_CORRUPT_INCORE ); -return -EIO ; +return -EFSCORRUPTED ; }/* This is the only portion of data that needs to persist */
fs/xfs/xfs_error.c +24 -3
@@ -329,7 +329,7 @@ xfs_corruption_error(const char *tag, int level, struct xfs_mount *mp, - void *buf, + const void *buf, size_t bufsize, const char *filename, int linenum,
@@ -341,6 +341,27 @@ xfs_corruption_error(xfs_alert (mp,"Corruption detected. Unmount and run xfs_repair" ); } +/* +* Complain about the kinds of metadata corruption that we can't detect from a +* verifier, such as incorrect inter-block relationship data. Does not set +* bp->b_error. +*/ +void +xfs_buf_corruption_error ( +struct xfs_buf *bp) +{ +struct xfs_mount *mp = bp->b_mount; + +xfs_alert_tag (mp,XFS_PTAG_VERIFIER_ERROR , +"Metadata corruption detected at %pS, %s block 0x%llx" , + __return_address, bp->b_ops->name, bp->b_bn); + +xfs_alert (mp,"Unmount and run xfs_repair" ); + +if (xfs_error_level >=XFS_ERRLEVEL_HIGH ) +xfs_stack_trace (); +} +/* * Warnings specifically for verifier errors. Differentiate CRC vs. invalid * values, and omit the stack trace unless the error level is tuned high.
@@ -350,7 +371,7 @@ xfs_buf_verifier_error(struct xfs_buf *bp, int error, const char *name, - void *buf, + const void *buf, size_t bufsz, xfs_failaddr_t failaddr) {
@@ -402,7 +423,7 @@ xfs_inode_verifier_error(struct xfs_inode *ip, int error, const char *name, - void *buf, + const void *buf, size_t bufsz, xfs_failaddr_t failaddr) {
fs/xfs/xfs_error.h +4 -3
@@ -12,16 +12,17 @@ extern void xfs_error_report(const char *tag, int level, struct xfs_mount *mp, const char *filename, int linenum, xfs_failaddr_t failaddr);extern void xfs_corruption_error (const char *tag,int level, -struct xfs_mount *mp,void *buf,size_t bufsize, +struct xfs_mount *mp,const void *buf,size_t bufsize,const char *filename,int linenum,xfs_failaddr_t failaddr); +void xfs_buf_corruption_error (struct xfs_buf *bp);extern void xfs_buf_verifier_error (struct xfs_buf *bp,int error, -const char *name,void *buf,size_t bufsz, +const char *name,const void *buf,size_t bufsz,xfs_failaddr_t failaddr);extern void xfs_verifier_error (struct xfs_buf *bp,int error,xfs_failaddr_t failaddr);extern void xfs_inode_verifier_error (struct xfs_inode *ip,int error, -const char *name,void *buf,size_t bufsz, +const char *name,const void *buf,size_t bufsz,xfs_failaddr_t failaddr);#define XFS_ERROR_REPORT (e, lvl, mp) \
fs/xfs/xfs_extfree_item.c +3 -2
@@ -21,7 +21,7 @@#include "xfs_alloc.h" #include "xfs_bmap.h" #include "xfs_trace.h" - +#include "xfs_error.h" kmem_zone_t *xfs_efi_zone;kmem_zone_t *xfs_efd_zone;
@@ -228,6 +228,7 @@ xfs_efi_copy_format(xfs_log_iovec_t *buf, xfs_efi_log_format_t *dst_efi_fmt) }return 0 ; } +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW ,NULL );return -EFSCORRUPTED ; }
@@ -624,7 +625,7 @@ xfs_efi_recover(*/ set_bit (XFS_EFI_RECOVERED , &efip->efi_flags);xfs_efi_release (efip); -return -EIO ; +return -EFSCORRUPTED ; } }
fs/xfs/xfs_fsmap.c +1 -0
@@ -146,6 +146,7 @@ xfs_fsmap_owner_from_rmap( dest->fmr_owner =XFS_FMR_OWN_FREE ;break ;default : +ASSERT (0 );return -EFSCORRUPTED ; }return 0 ;
fs/xfs/xfs_inode.c +37 -3
@@ -2149,8 +2149,10 @@ xfs_iunlink_update_bucket(* passed in because either we're adding or removing ourselves from the * head of the list. */ -if (old_value == new_agino) +if (old_value == new_agino) { +xfs_buf_corruption_error (agibp);return -EFSCORRUPTED ; + } agi->agi_unlinked[bucket_index] =cpu_to_be32 (new_agino); offset = offsetof(struct xfs_agi, agi_unlinked) +
@@ -2213,6 +2215,8 @@ xfs_iunlink_update_inode(/* Make sure the old pointer isn't garbage. */ old_value =be32_to_cpu (dip->di_next_unlinked);if (!xfs_verify_agino_or_null (mp, agno, old_value)) { +xfs_inode_verifier_error (ip, -EFSCORRUPTED , __func__, dip, +sizeof (*dip), __this_address); error = -EFSCORRUPTED ; goto out; }
@@ -2224,8 +2228,11 @@ xfs_iunlink_update_inode(*/ *old_next_agino = old_value;if (old_value == next_agino) { -if (next_agino !=NULLAGINO ) +if (next_agino !=NULLAGINO ) { +xfs_inode_verifier_error (ip, -EFSCORRUPTED , __func__, + dip,sizeof (*dip), __this_address); error = -EFSCORRUPTED ; + } goto out; }
@@ -2276,8 +2283,10 @@ xfs_iunlink(*/ next_agino =be32_to_cpu (agi->agi_unlinked[bucket_index]);if (next_agino == agino || - !xfs_verify_agino_or_null (mp, agno, next_agino)) + !xfs_verify_agino_or_null (mp, agno, next_agino)) { +xfs_buf_corruption_error (agibp);return -EFSCORRUPTED ; + }if (next_agino !=NULLAGINO ) {struct xfs_perag *pag;
@@ -3215,6 +3224,7 @@ xfs_rename(struct xfs_trans *tp;struct xfs_inode *wip =NULL ;/* whiteout inode */ struct xfs_inode *inodes[__XFS_SORT_INODES]; +int i;int num_inodes = __XFS_SORT_INODES;bool new_parent = (src_dp != target_dp);bool src_is_directory =S_ISDIR (VFS_I (src_ip)->i_mode);
@@ -3326,6 +3336,30 @@ xfs_rename( } } +/* +* Lock the AGI buffers we need to handle bumping the nlink of the +* whiteout inode off the unlinked list and to handle dropping the +* nlink of the target inode. Per locking order rules, do this in +* increasing AG order and before directory block allocation tries to +* grab AGFs because we grab AGIs before AGFs. +* +* The (vfs) caller must ensure that if src is a directory then +* target_ip is either null or an empty directory. +*/ +for (i =0 ; i < num_inodes && inodes[i] !=NULL ; i++) { +if (inodes[i] == wip || + (inodes[i] == target_ip && + (VFS_I (target_ip)->i_nlink ==1 || src_is_directory))) { +struct xfs_buf *bp; +xfs_agnumber_t agno; + + agno =XFS_INO_TO_AGNO (mp, inodes[i]->i_ino); + error =xfs_read_agi (mp, tp, agno, &bp); +if (error) + goto out_trans_cancel; + } + } +/* * Directory entry creation below may acquire the AGF. Remove * the whiteout from the unlinked list first to preserve correct
fs/xfs/xfs_inode_item.c +4 -1
@@ -17,6 +17,7 @@#include "xfs_trans_priv.h" #include "xfs_buf_item.h" #include "xfs_log.h" +#include "xfs_error.h" #include <linux/iversion.h>
@@ -828,8 +829,10 @@ xfs_inode_item_format_convert( {struct xfs_inode_log_format_32 *in_f32 = buf->i_addr; -if (buf->i_len !=sizeof (*in_f32)) +if (buf->i_len !=sizeof (*in_f32)) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW ,NULL );return -EFSCORRUPTED ; + } in_f->ilf_type = in_f32->ilf_type; in_f->ilf_size = in_f32->ilf_size;
fs/xfs/xfs_iomap.c +17 -0
@@ -765,6 +765,11 @@ xfs_iomap_write_unwritten(*/ resblks =XFS_DIOSTRAT_SPACE_RES (mp,0 ) <<1 ; +/* Attach dquots so that bmbt splits are accounted correctly. */ + error =xfs_qm_dqattach (ip); +if (error) +return error; + do { /* * Set up a transaction to convert the range of extents
@@ -783,6 +788,11 @@ xfs_iomap_write_unwritten(xfs_ilock (ip,XFS_ILOCK_EXCL );xfs_trans_ijoin (tp, ip,0 ); + error =xfs_trans_reserve_quota_nblks (tp, ip, resblks,0 , +XFS_QMOPT_RES_REGBLKS ); +if (error) + goto error_on_bmapi_transaction; +/* * Modify the unwritten extent state of the buffer. */
@@ -1055,6 +1065,13 @@ xfs_file_iomap_begin(trace_xfs_iomap_alloc (ip, offset, length,XFS_DATA_FORK , &imap); out_finish: +/* +* Writes that span EOF might trigger an IO size update on completion, +* so consider them to be dirty for the purposes of O_DSYNC even if +* there is no other metadata changes pending or have been made here. +*/ +if ((flags &IOMAP_WRITE ) && offset + length >i_size_read (inode)) + iomap->flags |=IOMAP_F_DIRTY ;return xfs_bmbt_to_iomap (ip, iomap, &imap, shared); out_found:
fs/xfs/xfs_iops.c +7 -3
@@ -20,6 +20,7 @@#include "xfs_symlink.h" #include "xfs_dir2.h" #include "xfs_iomap.h" +#include "xfs_error.h" #include <linux/xattr.h> #include <linux/posix_acl.h>
@@ -470,17 +471,20 @@ xfs_vn_get_link_inline(struct inode *inode, struct delayed_call *done) { + struct xfs_inode *ip = XFS_I(inode);char *link; -ASSERT (XFS_I (inode)->i_df.if_flags &XFS_IFINLINE ); +ASSERT (ip->i_df.if_flags &XFS_IFINLINE );/* * The VFS crashes on a NULL pointer, so return -EFSCORRUPTED if * if_data is junk. */ - link =XFS_I (inode)->i_df.if_u1.if_data; -if (!link) + link = ip->i_df.if_u1.if_data; +if (!link) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , ip->i_mount);return ERR_PTR (-EFSCORRUPTED ); + }return link; }
fs/xfs/xfs_log_recover.c +48 -24
219 lines not on this page · raw message
fs/xfs/xfs_message.c +1 -1
@@ -105,7 +105,7 @@ assfail(char *expr, char *file, int line) }void -xfs_hex_dump (void *p,int length) +xfs_hex_dump (const void *p,int length) {print_hex_dump (KERN_ALERT ,"" ,DUMP_PREFIX_OFFSET ,16 ,1 , p, length,1 ); }
fs/xfs/xfs_message.h +1 -1
@@ -60,6 +60,6 @@ do { \extern void assfail (char *expr,char *f,int l);extern void asswarn (char *expr,char *f,int l); -extern void xfs_hex_dump (void *p,int length); +extern void xfs_hex_dump (const void *p,int length);#endif /* __XFS_MESSAGE_H */
fs/xfs/xfs_mount.c +116 -52
207 lines not on this page · raw message
fs/xfs/xfs_pnfs.c +2 -2
@@ -147,11 +147,11 @@ xfs_fs_map_blocks(if (error) goto out_unlock; +ASSERT (!nimaps || imap.br_startblock !=DELAYSTARTBLOCK ); +if (write) {enum xfs_prealloc_flags flags =0 ; -ASSERT (imap.br_startblock !=DELAYSTARTBLOCK ); -if (!nimaps || imap.br_startblock ==HOLESTARTBLOCK ) {/* * xfs_iomap_write_direct() expects to take ownership of
fs/xfs/xfs_qm.c +11 -2
@@ -22,6 +22,7 @@#include "xfs_qm.h" #include "xfs_trace.h" #include "xfs_icache.h" +#include "xfs_error.h" /* * The global quota manager. There is only one of these for the entire
@@ -754,11 +755,19 @@ xfs_qm_qino_alloc(if ((flags &XFS_QMOPT_PQUOTA ) && (mp->m_sb.sb_gquotino !=NULLFSINO )) { ino = mp->m_sb.sb_gquotino; -ASSERT (mp->m_sb.sb_pquotino ==NULLFSINO ); +if (mp->m_sb.sb_pquotino !=NULLFSINO ) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , + mp); +return -EFSCORRUPTED ; + } }else if ((flags &XFS_QMOPT_GQUOTA ) && (mp->m_sb.sb_pquotino !=NULLFSINO )) { ino = mp->m_sb.sb_pquotino; -ASSERT (mp->m_sb.sb_gquotino ==NULLFSINO ); +if (mp->m_sb.sb_gquotino !=NULLFSINO ) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , + mp); +return -EFSCORRUPTED ; + } }if (ino !=NULLFSINO ) { error =xfs_iget (mp,NULL , ino,0 ,0 , ip);
fs/xfs/xfs_refcount_item.c +3 -2
@@ -17,7 +17,7 @@#include "xfs_refcount_item.h" #include "xfs_log.h" #include "xfs_refcount.h" - +#include "xfs_error.h" kmem_zone_t *xfs_cui_zone;kmem_zone_t *xfs_cud_zone;
@@ -497,7 +497,7 @@ xfs_cui_recover(*/ set_bit (XFS_CUI_RECOVERED , &cuip->cui_flags);xfs_cui_release (cuip); -return -EIO ; +return -EFSCORRUPTED ; } }
@@ -536,6 +536,7 @@ xfs_cui_recover( type = refc_type;break ;default : +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW , mp); error = -EFSCORRUPTED ; goto abort_error; }
fs/xfs/xfs_rmap_item.c +6 -3
@@ -17,7 +17,7 @@#include "xfs_rmap_item.h" #include "xfs_log.h" #include "xfs_rmap.h" - +#include "xfs_error.h" kmem_zone_t *xfs_rui_zone;kmem_zone_t *xfs_rud_zone;
@@ -171,8 +171,10 @@ xfs_rui_copy_format( src_rui_fmt = buf->i_addr; len =xfs_rui_log_format_sizeof (src_rui_fmt->rui_nextents); -if (buf->i_len != len) +if (buf->i_len != len) { +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW ,NULL );return -EFSCORRUPTED ; + }memcpy (dst_rui_fmt, src_rui_fmt, len);return 0 ;
@@ -539,7 +541,7 @@ xfs_rui_recover(*/ set_bit (XFS_RUI_RECOVERED , &ruip->rui_flags);xfs_rui_release (ruip); -return -EIO ; +return -EFSCORRUPTED ; } }
@@ -581,6 +583,7 @@ xfs_rui_recover( type =XFS_RMAP_FREE ;break ;default : +XFS_ERROR_REPORT (__func__,XFS_ERRLEVEL_LOW ,NULL ); error = -EFSCORRUPTED ; goto abort_error; }
fs/xfs/xfs_trace.h +21 -0
@@ -3609,6 +3609,27 @@ DEFINE_KMEM_EVENT(kmem_alloc_large);DEFINE_KMEM_EVENT (kmem_realloc);DEFINE_KMEM_EVENT (kmem_zone_alloc); +TRACE_EVENT (xfs_check_new_dalign, + TP_PROTO(struct xfs_mount *mp, int new_dalign, xfs_ino_t calc_rootino), +TP_ARGS (mp, new_dalign, calc_rootino), +TP_STRUCT__entry ( + __field(dev_t, dev) + __field(int, new_dalign) + __field(xfs_ino_t, sb_rootino) +__field (xfs_ino_t, calc_rootino) + ), +TP_fast_assign ( + __entry->dev = mp->m_super->s_dev; + __entry->new_dalign = new_dalign; + __entry->sb_rootino = mp->m_sb.sb_rootino; + __entry->calc_rootino = calc_rootino; + ), +TP_printk ("dev %d:%d new_dalign %d sb_rootino %llu calc_rootino %llu" , +MAJOR (__entry->dev),MINOR (__entry->dev), + __entry->new_dalign, __entry->sb_rootino, + __entry->calc_rootino) +) +#endif /* _TRACE_XFS_H */ #undef TRACE_INCLUDE_PATH
include/linux/iomap.h +2 -0
@@ -32,6 +32,8 @@ struct vm_fault;* * IOMAP_F_DIRTY indicates the inode has uncommitted metadata needed to access * written data and requires fdatasync to commit them to persistent storage. +* This needs to take into account metadata changes that *may* be made at IO +* completion, such as file size updates from direct IO. */ #define IOMAP_F_NEW 0x01/* blocks have been newly allocated */ #define IOMAP_F_DIRTY 0x02/* uncommitted metadata */
include/linux/sched/task_stack.h +1 -1
@@ -16,7 +16,7 @@* try_get_task_stack() instead. task_stack_page will return a pointer * that could get freed out from under you. */ -static inline void *task_stack_page (const struct task_struct *task) +static __always_inline void *task_stack_page(const struct task_struct *task) {return task->stack; }
include/linux/serial_core.h +17 -0
@@ -297,6 +297,23 @@ struct uart_state {/* number of characters left in xmit buffer before we ask for more */ #define WAKEUP_CHARS 256 +/** +* uart_xmit_advance - Advance xmit buffer and account Tx'ed chars +* @up: uart_port structure describing the port +* @chars: number of characters sent +* +* This function advances the tail of circular xmit buffer by the number of +* @chars transmitted and handles accounting of transmitted bytes (into +* @up's icount.tx). +*/ +static inline void uart_xmit_advance (struct uart_port *up,unsigned int chars) +{ +struct circ_buf *xmit = &up->state->xmit; + + xmit->tail = (xmit->tail + chars) & (UART_XMIT_SIZE -1 ); + up->icount.tx += chars; +} +struct module ;struct tty_driver ;
kernel/cgroup/cgroup-v1.c +3 -0
@@ -15,6 +15,7 @@#include <linux/pid_namespace.h> #include <linux/cgroupstats.h> #include <linux/fs_parser.h> +#include <linux/cpu.h> #include <trace/events/cgroup.h>
@@ -62,6 +63,7 @@ int cgroup_attach_task_all(struct task_struct *from, struct task_struct *tsk)int retval =0 ;mutex_lock (&cgroup_mutex); +cpus_read_lock ();percpu_down_write (&cgroup_threadgroup_rwsem);for_each_root (root) {struct cgroup *from_cgrp;
@@ -78,6 +80,7 @@ int cgroup_attach_task_all(struct task_struct *from, struct task_struct *tsk)break ; }percpu_up_write (&cgroup_threadgroup_rwsem); +cpus_read_unlock ();mutex_unlock (&cgroup_mutex);return retval;
kernel/trace/trace_preemptirq.c +2 -2
@@ -56,14 +56,14 @@ __visible void trace_hardirqs_on_caller(unsigned long caller_addr)this_cpu_write (tracing_irq_cpu,0 ); } -lockdep_hardirqs_on (CALLER_ADDR0 ); +lockdep_hardirqs_on (caller_addr); }EXPORT_SYMBOL (trace_hardirqs_on_caller);NOKPROBE_SYMBOL (trace_hardirqs_on_caller); __visible void trace_hardirqs_off_caller(unsigned long caller_addr) { -lockdep_hardirqs_off (CALLER_ADDR0 ); +lockdep_hardirqs_off (caller_addr);if (!this_cpu_read (tracing_irq_cpu)) {this_cpu_write (tracing_irq_cpu,1 );
kernel/workqueue.c +2 -4
@@ -3049,10 +3049,8 @@ static bool __flush_work(struct work_struct *work, bool from_cancel)if (WARN_ON (!work->func))return false; -if (!from_cancel) { -lock_map_acquire (&work->lockdep_map); -lock_map_release (&work->lockdep_map); - } +lock_map_acquire (&work->lockdep_map); +lock_map_release (&work->lockdep_map);if (start_flush_work (work, &barr, from_cancel)) {wait_for_completion (&barr.done);
mm/slub.c +4 -1
@@ -5743,7 +5743,8 @@ static char *create_unique_id(struct kmem_cache *s)char *name =kmalloc (ID_STR_LENGTH ,GFP_KERNEL );char *p = name; -BUG_ON (!name); +if (!name) +return ERR_PTR (-ENOMEM ); *p++ =':' ;/*
@@ -5825,6 +5826,8 @@ static int sysfs_slab_add(struct kmem_cache *s)* for the symlinks. */ name =create_unique_id (s); +if (IS_ERR (name)) +return PTR_ERR (name); } s->kobj.kset = kset;
net/bridge/netfilter/ebtables.c +3 -1
@@ -999,8 +999,10 @@ static int do_replace_finish(struct net *net, struct ebt_replace *repl, goto free_iterate; } -if (repl->valid_hooks != t->valid_hooks) +if (repl->valid_hooks != t->valid_hooks) { + ret = -EINVAL ; goto free_unlock; + }if (repl->num_counters && repl->num_counters != t->private->nentries) { ret = -EINVAL ;
net/mac80211/scan.c +7 -4
@@ -431,10 +431,6 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) scan_req =rcu_dereference_protected (local->scan_req,lockdep_is_held (&local->mtx)); -if (scan_req != local->int_scan_req) { - local->scan_info.aborted = aborted; -cfg80211_scan_done (scan_req, &local->scan_info); - }RCU_INIT_POINTER (local->scan_req,NULL ); scan_sdata = rcu_dereference_protected(local->scan_sdata,
@@ -444,6 +440,13 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) local->scanning =0 ; local->scan_chandef.chan =NULL ; +synchronize_rcu (); + +if (scan_req != local->int_scan_req) { + local->scan_info.aborted = aborted; +cfg80211_scan_done (scan_req, &local->scan_info); + } +/* Set power back to normal operating levels. */ ieee80211_hw_config (local,0 );
net/netfilter/nf_conntrack_irc.c +28 -6
@@ -148,15 +148,37 @@ static int help(struct sk_buff *skb, unsigned int protoff, data = ib_ptr; data_limit = ib_ptr + skb->len - dataoff; -/* strlen("\1DCC SENT t AAAAAAAA P\1\n")=24 -* 5+MINMATCHLEN+strlen("t AAAAAAAA P\1\n")=14 */ -while (data < data_limit - (19 +MINMATCHLEN )) { -if (memcmp (data,"\1DCC " ,5 )) { +/* Skip any whitespace */ +while (data < data_limit -10 ) { +if (*data ==' ' || *data =='\r' || *data =='\n' ) + data++; +else +break ; + } + +/* strlen("PRIVMSG x ")=10 */ +if (data < data_limit -10 ) { +if (strncasecmp ("PRIVMSG " , data,8 )) + goto out; + data +=8 ; + } + +/* strlen(" :\1DCC SENT t AAAAAAAA P\1\n")=26 +* 7+MINMATCHLEN+strlen("t AAAAAAAA P\1\n")=26 +*/ +while (data < data_limit - (21 +MINMATCHLEN )) { +/* Find first " :", the start of message */ +if (memcmp (data," :" ,2 )) { data++;continue ; } + data +=2 ; + +/* then check that place only for the DCC command */ +if (memcmp (data,"\1DCC " ,5 )) + goto out; data +=5 ; -/* we have at least (19+MINMATCHLEN)-5 bytes valid data left */ +/* we have at least (21+MINMATCHLEN)-(2+5) bytes valid data left */ iph =ip_hdr (skb); pr_debug("DCC found in master %pI4:%u %pI4:%u\n",
@@ -172,7 +194,7 @@ static int help(struct sk_buff *skb, unsigned int protoff,pr_debug ("DCC %s detected\n" , dccprotos[i]);/* we have at least -* (19+MINMATCHLEN)-5-dccprotos[i].matchlen bytes valid +* (21+MINMATCHLEN)-7-dccprotos[i].matchlen bytes valid * data left (== 14/13 bytes) */ if (parse_dcc (data, data_limit, &dcc_ip, &dcc_port, &addr_beg_p, &addr_end_p)) {
net/netfilter/nf_conntrack_sip.c +2 -2
@@ -477,7 +477,7 @@ static int ct_sip_walk_headers(const struct nf_conn *ct, const char *dptr,return ret;if (ret ==0 )break ; - dataoff += *matchoff; + dataoff = *matchoff; } *in_header =0 ; }
@@ -489,7 +489,7 @@ static int ct_sip_walk_headers(const struct nf_conn *ct, const char *dptr,break ;if (ret ==0 )return ret; - dataoff += *matchoff; + dataoff = *matchoff; }if (in_header)
net/netfilter/nfnetlink_osf.c +3 -1
@@ -269,6 +269,7 @@ bool nf_osf_find(const struct sk_buff *skb,struct nf_osf_hdr_ctx ctx;const struct tcphdr *tcp;struct tcphdr _tcph; +bool found = false;memset (&ctx,0 ,sizeof (ctx));
@@ -283,10 +284,11 @@ bool nf_osf_find(const struct sk_buff *skb, data->genre = f->genre; data->version = f->version; + found = true;break ; } -return true; +return found; }EXPORT_SYMBOL_GPL (nf_osf_find);
net/rxrpc/call_event.c +1 -1
@@ -166,7 +166,7 @@ static void rxrpc_resend(struct rxrpc_call *call, unsigned long now_j)_enter ("{%d,%d}" , call->tx_hard_ack, call->tx_top); now =ktime_get_real (); - max_age =ktime_sub (now,jiffies_to_usecs (call->peer->rto_j)); + max_age =ktime_sub_us (now,jiffies_to_usecs (call->peer->rto_j));spin_lock_bh (&call->lock);
net/rxrpc/local_object.c +3 -0
@@ -448,6 +448,9 @@ static void rxrpc_local_processor(struct work_struct *work) container_of(work, struct rxrpc_local, processor);bool again; +if (local->dead) +return ; +trace_rxrpc_local (local->debug_id, rxrpc_local_processing,atomic_read (&local->usage),NULL );
net/sched/cls_api.c +1 -0
@@ -2098,6 +2098,7 @@ static int tc_new_tfilter(struct sk_buff *skb, struct nlmsghdr *n, }if (chain->tmplt_ops && chain->tmplt_ops != tp->ops) { +tfilter_put (tp, fh);NL_SET_ERR_MSG (extack,"Chain template is set to a different filter kind" ); err = -EINVAL ; goto errout;
net/sched/sch_taprio.c +11 -7
@@ -65,6 +65,7 @@ struct taprio_sched {u32 flags;enum tk_offsets tk_offset;int clockid; +bool offloaded;atomic64_t picos_per_byte;/* Using picoseconds because for 10Gbps+ * speeds it's sub-nanoseconds per byte */
@@ -1268,6 +1269,8 @@ static int taprio_enable_offload(struct net_device *dev, goto done; } + q->offloaded = true; + done:taprio_offload_free (offload);
@@ -1282,12 +1285,9 @@ static int taprio_disable_offload(struct net_device *dev,struct tc_taprio_qopt_offload *offload;int err; -if (!FULL_OFFLOAD_IS_ENABLED (q->flags)) +if (!q->offloaded)return 0 ; -if (!ops->ndo_setup_tc) -return -EOPNOTSUPP ; - offload =taprio_offload_alloc (0 );if (!offload) { NL_SET_ERR_MSG(extack,
@@ -1303,6 +1303,8 @@ static int taprio_disable_offload(struct net_device *dev, goto out; } + q->offloaded = false; + out:taprio_offload_free (offload);
@@ -1904,12 +1906,14 @@ static int taprio_dump(struct Qdisc *sch, struct sk_buff *skb)static struct Qdisc *taprio_leaf (struct Qdisc *sch,unsigned long cl) { -struct netdev_queue *dev_queue =taprio_queue_get (sch, cl); +struct taprio_sched *q =qdisc_priv (sch); +struct net_device *dev =qdisc_dev (sch); +unsigned int ntx = cl -1 ;
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.