1. 11 Jun, 2020 40 commits
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.8-2020-06-11' of git://git.kernel.dk/linux-block · b961f8dc
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "A few late stragglers in here. In particular:
      
         - Validate full range for provided buffers (Bijan)
      
         - Fix bad use of kfree() in buffer registration failure (Denis)
      
         - Don't allow close of ring itself, it's not fully safe. Making it
           fully safe would require making the system call more expensive,
           which isn't worth it.
      
         - Buffer selection fix
      
         - Regression fix for O_NONBLOCK retry
      
         - Make IORING_OP_ACCEPT honor O_NONBLOCK (Jiufei)
      
         - Restrict opcode handling for SQ/IOPOLL (Pavel)
      
         - io-wq work handling cleanups and improvements (Pavel, Xiaoguang)
      
         - IOPOLL race fix (Xiaoguang)"
      
      * tag 'io_uring-5.8-2020-06-11' of git://git.kernel.dk/linux-block:
        io_uring: fix io_kiocb.flags modification race in IOPOLL mode
        io_uring: check file O_NONBLOCK state for accept
        io_uring: avoid unnecessary io_wq_work copy for fast poll feature
        io_uring: avoid whole io_wq_work copy for requests completed inline
        io_uring: allow O_NONBLOCK async retry
        io_wq: add per-wq work handler instead of per work
        io_uring: don't arm a timeout through work.func
        io_uring: remove custom ->func handlers
        io_uring: don't derive close state from ->func
        io_uring: use kvfree() in io_sqe_buffer_register()
        io_uring: validate the full range of provided buffers for access
        io_uring: re-set iov base/len for buffer select retry
        io_uring: move send/recv IOPOLL check into prep
        io_uring: deduplicate io_openat{,2}_prep()
        io_uring: do build_open_how() only once
        io_uring: fix {SQ,IO}POLL with unsupported opcodes
        io_uring: disallow close of ring itself
      b961f8dc
    • Linus Torvalds's avatar
      Merge tag 'block-5.8-2020-06-11' of git://git.kernel.dk/linux-block · a58dfea2
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "Some followup fixes for this merge window. In particular:
      
         - Seqcount write missing preemption disable for stats (Ahmed)
      
         - blktrace fixes (Chaitanya)
      
         - Redundant initializations (Colin)
      
         - Various small NVMe fixes (Chaitanya, Christoph, Daniel, Max,
           Niklas, Rikard)
      
         - loop flag bug regression fix (Martijn)
      
         - blk-mq tagging fixes (Christoph, Ming)"
      
      * tag 'block-5.8-2020-06-11' of git://git.kernel.dk/linux-block:
        umem: remove redundant initialization of variable ret
        pktcdvd: remove redundant initialization of variable ret
        nvmet: fail outstanding host posted AEN req
        nvme-pci: use simple suspend when a HMB is enabled
        nvme-fc: don't call nvme_cleanup_cmd() for AENs
        nvmet-tcp: constify nvmet_tcp_ops
        nvme-tcp: constify nvme_tcp_mq_ops and nvme_tcp_admin_mq_ops
        nvme: do not call del_gendisk() on a disk that was never added
        blk-mq: fix blk_mq_all_tag_iter
        blk-mq: split out a __blk_mq_get_driver_tag helper
        blktrace: fix endianness for blk_log_remap()
        blktrace: fix endianness in get_pdu_int()
        blktrace: use errno instead of bi_status
        block: nr_sects_write(): Disable preemption on seqcount write
        block: remove the error argument to the block_bio_complete tracepoint
        loop: Fix wrong masking of status flags
        block/bio-integrity: don't free 'buf' if bio_integrity_add_page() failed
      a58dfea2
    • David Howells's avatar
      afs: Fix afs_store_data() to set mtime in new operation descriptor · b3597945
      David Howells authored
      Fix afs_store_data() so that it sets the mtime in the new operation
      descriptor otherwise the mtime on the server gets set to 0 when a write is
      stored to the server.
      
      Fixes: e49c7b2f ("afs: Build an abstraction around an "operation" concept")
      Reported-by: default avatarDave Botsch <botsch@cnf.cornell.edu>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b3597945
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 6a45a658
      Linus Torvalds authored
      Pull more x86 updates from Thomas Gleixner:
       "A set of fixes and updates for x86:
      
         - Unbreak paravirt VDSO clocks.
      
           While the VDSO code was moved into lib for sharing a subtle check
           for the validity of paravirt clocks got replaced. While the
           replacement works perfectly fine for bare metal as the update of
           the VDSO clock mode is synchronous, it fails for paravirt clocks
           because the hypervisor can invalidate them asynchronously.
      
           Bring it back as an optional function so it does not inflict this
           on architectures which are free of PV damage.
      
         - Fix the jiffies to jiffies64 mapping on 64bit so it does not
           trigger an ODR violation on newer compilers
      
         - Three fixes for the SSBD and *IB* speculation mitigation maze to
           ensure consistency, not disabling of some *IB* variants wrongly and
           to prevent a rogue cross process shutdown of SSBD. All marked for
           stable.
      
         - Add yet more CPU models to the splitlock detection capable list
           !@#%$!
      
         - Bring the pr_info() back which tells that TSC deadline timer is
           enabled.
      
         - Reboot quirk for MacBook6,1"
      
      * tag 'x86-urgent-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/vdso: Unbreak paravirt VDSO clocks
        lib/vdso: Provide sanity check for cycles (again)
        clocksource: Remove obsolete ifdef
        x86_64: Fix jiffies ODR violation
        x86/speculation: PR_SPEC_FORCE_DISABLE enforcement for indirect branches.
        x86/speculation: Prevent rogue cross-process SSBD shutdown
        x86/speculation: Avoid force-disabling IBPB based on STIBP and enhanced IBRS.
        x86/cpu: Add Sapphire Rapids CPU model number
        x86/split_lock: Add Icelake microserver and Tigerlake CPU models
        x86/apic: Make TSC deadline timer detection message visible
        x86/reboot/quirks: Add MacBook6,1 reboot quirk
      6a45a658
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 92ac9712
      Linus Torvalds authored
      Pull timer fix from Thomas Gleixner:
       "A small fix for the VDSO code to force inline
        __cvdso_clock_gettime_common() so the compiler
        can't generate horrible code"
      
      * tag 'timers-urgent-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        lib/vdso: Force inlining of __cvdso_clock_gettime_common()
      92ac9712
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 623f6dc5
      Linus Torvalds authored
      Merge some more updates from Andrew Morton:
      
       - various hotfixes and minor things
      
       - hch's use_mm/unuse_mm clearnups
      
      Subsystems affected by this patch series: mm/hugetlb, scripts, kcov,
      lib, nilfs, checkpatch, lib, mm/debug, ocfs2, lib, misc.
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        kernel: set USER_DS in kthread_use_mm
        kernel: better document the use_mm/unuse_mm API contract
        kernel: move use_mm/unuse_mm to kthread.c
        kernel: move use_mm/unuse_mm to kthread.c
        stacktrace: cleanup inconsistent variable type
        lib: test get_count_order/long in test_bitops.c
        mm: add comments on pglist_data zones
        ocfs2: fix spelling mistake and grammar
        mm/debug_vm_pgtable: fix kernel crash by checking for THP support
        lib: fix bitmap_parse() on 64-bit big endian archs
        checkpatch: correct check for kernel parameters doc
        nilfs2: fix null pointer dereference at nilfs_segctor_do_construct()
        lib/lz4/lz4_decompress.c: document deliberate use of `&'
        kcov: check kcov_softirq in kcov_remote_stop()
        scripts/spelling: add a few more typos
        khugepaged: selftests: fix timeout condition in wait_for_scan()
      623f6dc5
    • Joerg Roedel's avatar
      alpha: Fix build around srm_sysrq_reboot_op · 5cd221e8
      Joerg Roedel authored
      The patch introducing the struct was probably never compile tested,
      because it sets a handler with a wrong function signature. Wrap the
      handler into a functions with the correct signature to fix the build.
      
      Fixes: 0f1c9688 ("tty/sysrq: alpha: export and use __sysrq_get_key_op()")
      Cc: Emil Velikov <emil.l.velikov@gmail.com>
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5cd221e8
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.8-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · cd16ed33
      Linus Torvalds authored
      Pull more RISC-V updates from Palmer Dabbelt:
      
       - Kconfig select statements are now sorted alphanumerically
      
       - first-level interrupts are now handled via a full irqchip driver
      
       - CPU hotplug is fixed
      
       - vDSO calls now use the common vDSO infrastructure
      
      * tag 'riscv-for-linus-5.8-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: set the permission of vdso_data to read-only
        riscv: use vDSO common flow to reduce the latency of the time-related functions
        riscv: fix build warning of missing prototypes
        RISC-V: Don't mark init section as non-executable
        RISC-V: Force select RISCV_INTC for CONFIG_RISCV
        RISC-V: Remove do_IRQ() function
        clocksource/drivers/timer-riscv: Use per-CPU timer interrupt
        irqchip: RISC-V per-HART local interrupt controller driver
        RISC-V: Rename and move plic_find_hart_id() to arch directory
        RISC-V: self-contained IPI handling routine
        RISC-V: Sort select statements alphanumerically
      cd16ed33
    • Linus Torvalds's avatar
      Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 55d728b2
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "arm64 fixes that came in during the merge window.
      
        There will probably be more to come, but it doesn't seem like it's
        worth me sitting on these in the meantime.
      
         - Fix SCS debug check to report max stack usage in bytes as advertised
      
         - Fix typo: CONFIG_FTRACE_WITH_REGS => CONFIG_DYNAMIC_FTRACE_WITH_REGS
      
         - Fix incorrect mask in HiSilicon L3C perf PMU driver
      
         - Fix compat vDSO compilation under some toolchain configurations
      
         - Fix false UBSAN warning from ACPI IORT parsing code
      
         - Fix booting under bootloaders that ignore TEXT_OFFSET
      
         - Annotate debug initcall function with '__init'"
      
      * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: warn on incorrect placement of the kernel by the bootloader
        arm64: acpi: fix UBSAN warning
        arm64: vdso32: add CONFIG_THUMB2_COMPAT_VDSO
        drivers/perf: hisi: Fix wrong value for all counters enable
        arm64: ftrace: Change CONFIG_FTRACE_WITH_REGS to CONFIG_DYNAMIC_FTRACE_WITH_REGS
        arm64: debug: mark a function as __init to save some memory
        scs: Report SCS usage in bytes rather than number of entries
      55d728b2
    • Linus Torvalds's avatar
      Merge tag 'm68knommu-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu · d3ea6934
      Linus Torvalds authored
      Pull m68knommu updates from Greg Ungerer:
      
       - casting clean up in the user access macros
      
       - memory leak on error case fix for PCI probing
      
       - update of a defconfig
      
      * tag 'm68knommu-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
        m68k,nommu: fix implicit cast from __user in __{get,put}_user_asm()
        m68k,nommu: add missing __user in uaccess' __ptr() macro
        m68k: Drop CONFIG_MTD_M25P80 in stmark2_defconfig
        m68k/PCI: Fix a memory leak in an error handling path
      d3ea6934
    • Linus Torvalds's avatar
      Merge tag 'mailbox-v5.8' of git://git.linaro.org/landing-teams/working/fujitsu/integration · 2dca74a4
      Linus Torvalds authored
      Pull mailbox updates from Jassi Brar:
       "qcom:
         - new controller driver for IPCC
         - reorg the of_device data
         - add support for ipq6018 platform
      
        spreadtrum:
         - new sprd controller driver
      
        imx:
         - implement suspend/resume PM support
      
        misc:
         - make pcc driver struct static
         - fix return value in imx_mu_scu
         - disable clock before bailout in imx probe
         - remove duplicate error mssg in zynqmp probe
         - fix header size in imx.scu
         - check for null instead of is-err in zynqmp"
      
      * tag 'mailbox-v5.8' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
        mailbox: qcom: Add ipq6018 apcs compatible
        mailbox: qcom: Add clock driver name in apcs mailbox driver data
        dt-bindings: mailbox: Add YAML schemas for QCOM APCS global block
        mailbox: imx: ONLY IPC MU needs IRQF_NO_SUSPEND flag
        mailbox: imx: Add runtime PM callback to handle MU clocks
        mailbox: imx: Add context save/restore for suspend/resume
        MAINTAINERS: Add entry for Qualcomm IPCC driver
        mailbox: Add support for Qualcomm IPCC
        dt-bindings: mailbox: Add devicetree binding for Qcom IPCC
        mailbox: zynqmp-ipi: Fix NULL vs IS_ERR() check in zynqmp_ipi_mbox_probe()
        mailbox: imx-mailbox: fix scu msg header size check
        mailbox: sprd: Add Spreadtrum mailbox driver
        dt-bindings: mailbox: Add the Spreadtrum mailbox documentation
        mailbox: ZynqMP IPI: Delete an error message in zynqmp_ipi_probe()
        mailbox: imx: Disable the clock on devm_mbox_controller_register() failure
        mailbox: imx: Fix return in imx_mu_scu_xlate()
        mailbox: imx: Support runtime PM
        mailbox: pcc: make pcc_mbox_driver static
      2dca74a4
    • Linus Torvalds's avatar
      Merge tag 'sound-fix-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · e0154bd4
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "Here are last-minute fixes gathered before merge window close; a few
        fixes are for the core while the rest majority are driver fixes.
      
         - PCM locking annotation fixes and the possible self-lock fix
      
         - ASoC DPCM regression fixes with multi-CPU DAI
      
         - A fix for inconsistent resume from system-PM on USB-audio
      
         - Improved runtime-PM handling with multiple USB interfaces
      
         - Quirks for HD-audio and USB-audio
      
         - Hardened firmware handling in max98390 codec
      
         - A couple of fixes for meson"
      
      * tag 'sound-fix-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (21 commits)
        ASoC: rt5645: Add platform-data for Asus T101HA
        ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT10-A tablet
        ASoC: SOF: nocodec: conditionally set dpcm_capture/dpcm_playback flags
        ASoC: Intel: boards: replace capture_only by dpcm_capture
        ASoC: core: only convert non DPCM link to DPCM link
        ASoC: soc-pcm: dpcm: fix playback/capture checks
        ASoC: meson: add missing free_irq() in error path
        ALSA: pcm: disallow linking stream to itself
        ALSA: usb-audio: Manage auto-pm of all bundled interfaces
        ALSA: hda/realtek - add a pintbl quirk for several Lenovo machines
        ALSA: pcm: fix snd_pcm_link() lockdep splat
        ALSA: usb-audio: Use the new macro for HP Dock rename quirks
        ALSA: usb-audio: Add vendor, product and profile name for HP Thunderbolt Dock
        ALSA: emu10k1: delete an unnecessary condition
        dt-bindings: ASoc: Fix tdm-slot documentation spelling error
        ASoC: meson: fix memory leak of links if allocation of ldata fails
        ALSA: usb-audio: Fix inconsistent card PM state after resume
        ASoC: max98390: Fix potential crash during param fw loading
        ASoC: max98390: Fix incorrect printf qualifier
        ASoC: fsl-asoc-card: Defer probe when fail to find codec device
        ...
      e0154bd4
    • Linus Torvalds's avatar
      Merge tag 'drm-next-2020-06-11-1' of git://anongit.freedesktop.org/drm/drm · d4e181f2
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "One sun4i fix and a connector hotplug race The ast fix is for a
        regression in 5.6, and one of the i915 ones fixes an oops reported by
        dhowells.
      
        core:
         - fix race in connectors sending hotplug
      
        i915:
         - Avoid use after free in cmdparser
         - Avoid NULL dereference when probing all display encoders
         - Fixup to module parameter type
      
        sun4i:
         - clock divider fix
      
        ast:
         - 24/32 bpp mode setting fix"
      
      * tag 'drm-next-2020-06-11-1' of git://anongit.freedesktop.org/drm/drm:
        drm/ast: fix missing break in switch statement for format->cpp[0] case 4
        drm/sun4i: hdmi ddc clk: Fix size of m divider
        drm/i915/display: Only query DP state of a DDI encoder
        drm/i915/params: fix i915.reset module param type
        drm/i915/gem: Mark the buffer pool as active for the cmdparser
        drm/connector: notify userspace on hotplug after register complete
      d4e181f2
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.8-1' of git://git.linux-nfs.org/projects/anna/linux-nfs · a5395682
      Linus Torvalds authored
      Pull NFS client updates from Anna Schumaker:
       "New features and improvements:
         - Sunrpc receive buffer sizes only change when establishing a GSS credentials
         - Add more sunrpc tracepoints
         - Improve on tracepoints to capture internal NFS I/O errors
      
        Other bugfixes and cleanups:
         - Move a dprintk() to after a call to nfs_alloc_fattr()
         - Fix off-by-one issues in rpc_ntop6
         - Fix a few coccicheck warnings
         - Use the correct SPDX license identifiers
         - Fix rpc_call_done assignment for BIND_CONN_TO_SESSION
         - Replace zero-length array with flexible array
         - Remove duplicate headers
         - Set invalid blocks after NFSv4 writes to update space_used attribute
         - Fix direct WRITE throughput regression"
      
      * tag 'nfs-for-5.8-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (27 commits)
        NFS: Fix direct WRITE throughput regression
        SUNRPC: rpc_xprt lifetime events should record xprt->state
        xprtrdma: Make xprt_rdma_slot_table_entries static
        nfs: set invalid blocks after NFSv4 writes
        NFS: remove redundant initialization of variable result
        sunrpc: add missing newline when printing parameter 'auth_hashtable_size' by sysfs
        NFS: Add a tracepoint in nfs_set_pgio_error()
        NFS: Trace short NFS READs
        NFS: nfs_xdr_status should record the procedure name
        SUNRPC: Set SOFTCONN when destroying GSS contexts
        SUNRPC: rpc_call_null_helper() should set RPC_TASK_SOFT
        SUNRPC: rpc_call_null_helper() already sets RPC_TASK_NULLCREDS
        SUNRPC: trace RPC client lifetime events
        SUNRPC: Trace transport lifetime events
        SUNRPC: Split the xdr_buf event class
        SUNRPC: Add tracepoint to rpc_call_rpcerror()
        SUNRPC: Update the RPC_SHOW_SOCKET() macro
        SUNRPC: Update the rpc_show_task_flags() macro
        SUNRPC: Trace GSS context lifetimes
        SUNRPC: receive buffer size estimation values almost never change
        ...
      a5395682
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · e8de4575
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
       "A number of fixes to the omap and nitrox drivers"
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: cavium/nitrox - Fix 'nitrox_get_first_device()' when ndevlist is fully iterated
        crypto: omap-sham - add proper load balancing support for multicore
        crypto: omap-aes - prevent unregistering algorithms twice
        crypto: omap-sham - fix very small data size handling
        crypto: omap-sham - huge buffer access fixes
        crypto: omap-crypto - fix userspace copied buffer access
        crypto: omap-sham - force kernel driver usage for sha algos
        crypto: omap-aes - avoid spamming console with self tests
      e8de4575
    • Linus Torvalds's avatar
      Merge tag 'vfs-5.8-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 7cf035cc
      Linus Torvalds authored
      Pull DAX updates part three from Darrick Wong:
       "Now that the xfs changes have landed, this third piece changes the
        FS_XFLAG_DAX ioctl code in xfs to request that the inode be reloaded
        after the last program closes the file, if doing so would make a S_DAX
        change happen. The goal here is to make dax access mode switching
        quicker when possible.
      
        Summary:
      
         - Teach XFS to ask the VFS to drop an inode if the administrator
           changes the FS_XFLAG_DAX inode flag such that the S_DAX state would
           change. This can result in files changing access modes without
           requiring an unmount cycle"
      
      * tag 'vfs-5.8-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        fs/xfs: Update xfs_ioctl_setattr_dax_invalidate()
        fs/xfs: Combine xfs_diflags_to_linux() and xfs_diflags_to_iflags()
        fs/xfs: Create function xfs_inode_should_enable_dax()
        fs/xfs: Make DAX mount option a tri-state
        fs/xfs: Change XFS_MOUNT_DAX to XFS_MOUNT_DAX_ALWAYS
        fs/xfs: Remove unnecessary initialization of i_rwsem
      7cf035cc
    • Chuck Lever's avatar
      NFS: Fix direct WRITE throughput regression · ba838a75
      Chuck Lever authored
      I measured a 50% throughput regression for large direct writes.
      
      The observed on-the-wire behavior is that the client sends every
      NFS WRITE twice: once as an UNSTABLE WRITE plus a COMMIT, and once
      as a FILE_SYNC WRITE.
      
      This is because the nfs_write_match_verf() check in
      nfs_direct_commit_complete() fails for every WRITE.
      
      Buffered writes use nfs_write_completion(), which sets req->wb_verf
      correctly. Direct writes use nfs_direct_write_completion(), which
      does not set req->wb_verf at all. This leaves req->wb_verf set to
      all zeroes for every direct WRITE, and thus
      nfs_direct_commit_completion() always sets NFS_ODIRECT_RESCHED_WRITES.
      
      This fix appears to restore nearly all of the lost performance.
      
      Fixes: 1f28476d ("NFS: Fix O_DIRECT commit verifier handling")
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      ba838a75
    • Chuck Lever's avatar
      SUNRPC: rpc_xprt lifetime events should record xprt->state · 94afd9c4
      Chuck Lever authored
      Help troubleshoot the logic that uses these flags.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      94afd9c4
    • Zou Wei's avatar
      xprtrdma: Make xprt_rdma_slot_table_entries static · 5bffb006
      Zou Wei authored
      Fix the following sparse warning:
      
      net/sunrpc/xprtrdma/transport.c:71:14: warning: symbol 'xprt_rdma_slot_table_entries'
      was not declared. Should it be static?
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarZou Wei <zou_wei@huawei.com>
      Reviewed-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      5bffb006
    • Zheng Bin's avatar
      nfs: set invalid blocks after NFSv4 writes · 3a39e778
      Zheng Bin authored
      Use the following command to test nfsv4(size of file1M is 1MB):
      mount -t nfs -o vers=4.0,actimeo=60 127.0.0.1/dir1 /mnt
      cp file1M /mnt
      du -h /mnt/file1M  -->0 within 60s, then 1M
      
      When write is done(cp file1M /mnt), will call this:
      nfs_writeback_done
        nfs4_write_done
          nfs4_write_done_cb
            nfs_writeback_update_inode
              nfs_post_op_update_inode_force_wcc_locked(change, ctime, mtime
      nfs_post_op_update_inode_force_wcc_locked
         nfs_set_cache_invalid
         nfs_refresh_inode_locked
           nfs_update_inode
      
      nfsd write response contains change, ctime, mtime, the flag will be
      clear after nfs_update_inode. Howerver, write response does not contain
      space_used, previous open response contains space_used whose value is 0,
      so inode->i_blocks is still 0.
      
      nfs_getattr  -->called by "du -h"
        do_update |= force_sync || nfs_attribute_cache_expired -->false in 60s
        cache_validity = READ_ONCE(NFS_I(inode)->cache_validity)
        do_update |= cache_validity & (NFS_INO_INVALID_ATTR    -->false
        if (do_update) {
              __nfs_revalidate_inode
        }
      
      Within 60s, does not send getattr request to nfsd, thus "du -h /mnt/file1M"
      is 0.
      
      Add a NFS_INO_INVALID_BLOCKS flag, set it when nfsv4 write is done.
      
      Fixes: 16e14375 ("NFS: More fine grained attribute tracking")
      Signed-off-by: default avatarZheng Bin <zhengbin13@huawei.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      3a39e778
    • Colin Ian King's avatar
      NFS: remove redundant initialization of variable result · 86b93667
      Colin Ian King authored
      The variable result is being initialized with a value that is never read
      and it is being updated later with a new value.  The initialization is
      redundant and can be removed.
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      86b93667
    • Xiongfeng Wang's avatar
      sunrpc: add missing newline when printing parameter 'auth_hashtable_size' by sysfs · 2ac3ddc7
      Xiongfeng Wang authored
      When I cat parameter
      '/sys/module/sunrpc/parameters/auth_hashtable_size', it displays as
      follows. It is better to add a newline for easy reading.
      
      [root@hulk-202 ~]# cat /sys/module/sunrpc/parameters/auth_hashtable_size
      16[root@hulk-202 ~]#
      Signed-off-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      2ac3ddc7
    • Chuck Lever's avatar
    • Chuck Lever's avatar
      NFS: Trace short NFS READs · fd2b6121
      Chuck Lever authored
      A short read can generate an -EIO error without there being an error
      on the wire. This tracepoint acts as an eyecatcher when there is no
      obvious I/O error.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      fd2b6121
    • Chuck Lever's avatar
      NFS: nfs_xdr_status should record the procedure name · 5be59458
      Chuck Lever authored
      When sunrpc trace points are not enabled, the recorded task ID
      information alone is not helpful.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      5be59458
    • Chuck Lever's avatar
      SUNRPC: Set SOFTCONN when destroying GSS contexts · 841a2ed9
      Chuck Lever authored
      Move the RPC_TASK_SOFTCONN flag into rpc_call_null_helper(). The
      only minor behavior change is that it is now also set when
      destroying GSS contexts.
      
      This gives a better guarantee that gss_send_destroy_context() will
      not hang for long if a connection cannot be established.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      841a2ed9
    • Chuck Lever's avatar
      SUNRPC: rpc_call_null_helper() should set RPC_TASK_SOFT · 6fc3737a
      Chuck Lever authored
      Clean up.
      
      All of rpc_call_null_helper() call sites assert RPC_TASK_SOFT, so
      move that setting into rpc_call_null_helper() itself.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      6fc3737a
    • Chuck Lever's avatar
      SUNRPC: rpc_call_null_helper() already sets RPC_TASK_NULLCREDS · eefc536d
      Chuck Lever authored
      Clean up.
      
      Commit a52458b4 ("NFS/NFSD/SUNRPC: replace generic creds with
      'struct cred'.") made rpc_call_null_helper() set RPC_TASK_NULLCREDS
      unconditionally. Therefore there's no need for
      rpc_call_null_helper()'s call sites to set RPC_TASK_NULLCREDS.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      eefc536d
    • Chuck Lever's avatar
      SUNRPC: trace RPC client lifetime events · 42aad0d7
      Chuck Lever authored
      The "create" tracepoint records parts of the rpc_create arguments,
      and the shutdown tracepoint records when the rpc_clnt is about to
      signal pending tasks and destroy auths.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      42aad0d7
    • Chuck Lever's avatar
      SUNRPC: Trace transport lifetime events · 911813d7
      Chuck Lever authored
      Refactor: Hoist create/destroy/disconnect tracepoints out of
      xprtrdma and into the generic RPC client. Some benefits include:
      
      - Enable tracing of xprt lifetime events for the socket transport
        types
      
      - Expose the different types of disconnect to help run down
        issues with lingering connections
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      911813d7
    • Chuck Lever's avatar
      SUNRPC: Split the xdr_buf event class · c509f15a
      Chuck Lever authored
      To help tie the recorded xdr_buf to a particular RPC transaction,
      the client side version of this class should display task ID
      information and the server side one should show the request's XID.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      c509f15a
    • Chuck Lever's avatar
      SUNRPC: Add tracepoint to rpc_call_rpcerror() · 0125ecbb
      Chuck Lever authored
      Add a tracepoint in another common exit point for failing RPCs.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      0125ecbb
    • Chuck Lever's avatar
      SUNRPC: Update the RPC_SHOW_SOCKET() macro · 82909dc5
      Chuck Lever authored
      Clean up: remove unnecessary commas, and fix a white-space nit.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      82909dc5
    • Chuck Lever's avatar
      SUNRPC: Update the rpc_show_task_flags() macro · 7a34c8e0
      Chuck Lever authored
      Recent additions to the RPC_TASK flags neglected to update
      the tracepoint ENUM definitions.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      7a34c8e0
    • Chuck Lever's avatar
      74fb8fec
    • Chuck Lever's avatar
      SUNRPC: receive buffer size estimation values almost never change · 53bc19f1
      Chuck Lever authored
      Avoid unnecessary cache sloshing by placing the buffer size
      estimation update logic behind an atomic bit flag.
      
      The size of GSS information included in each wrapped Reply does
      not change during the lifetime of a GSS context. Therefore, the
      au_rslack and au_ralign fields need to be updated only once after
      establishing a fresh GSS credential.
      
      Thus a slack size update must occur after a cred is created,
      duplicated, renewed, or expires. I'm not sure I have this exactly
      right. A trace point is introduced to track updates to these
      variables to enable troubleshooting the problem if I missed a spot.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      53bc19f1
    • Linus Torvalds's avatar
      Merge tag 'nfsd-5.8' of git://linux-nfs.org/~bfields/linux · c742b634
      Linus Torvalds authored
      Pull nfsd updates from Bruce Fields:
       "Highlights:
      
         - Keep nfsd clients from unnecessarily breaking their own
           delegations.
      
           Note this requires a small kthreadd addition. The result is Tejun
           Heo's suggestion (see link), and he was OK with this going through
           my tree.
      
         - Patch nfsd/clients/ to display filenames, and to fix byte-order
           when displaying stateid's.
      
         - fix a module loading/unloading bug, from Neil Brown.
      
         - A big series from Chuck Lever with RPC/RDMA and tracing
           improvements, and lay some groundwork for RPC-over-TLS"
      
      Link: https://lore.kernel.org/r/1588348912-24781-1-git-send-email-bfields@redhat.com
      
      * tag 'nfsd-5.8' of git://linux-nfs.org/~bfields/linux: (49 commits)
        sunrpc: use kmemdup_nul() in gssp_stringify()
        nfsd: safer handling of corrupted c_type
        nfsd4: make drc_slab global, not per-net
        SUNRPC: Remove unreachable error condition in rpcb_getport_async()
        nfsd: Fix svc_xprt refcnt leak when setup callback client failed
        sunrpc: clean up properly in gss_mech_unregister()
        sunrpc: svcauth_gss_register_pseudoflavor must reject duplicate registrations.
        sunrpc: check that domain table is empty at module unload.
        NFSD: Fix improperly-formatted Doxygen comments
        NFSD: Squash an annoying compiler warning
        SUNRPC: Clean up request deferral tracepoints
        NFSD: Add tracepoints for monitoring NFSD callbacks
        NFSD: Add tracepoints to the NFSD state management code
        NFSD: Add tracepoints to NFSD's duplicate reply cache
        SUNRPC: svc_show_status() macro should have enum definitions
        SUNRPC: Restructure svc_udp_recvfrom()
        SUNRPC: Refactor svc_recvfrom()
        SUNRPC: Clean up svc_release_skb() functions
        SUNRPC: Refactor recvfrom path dealing with incomplete TCP receives
        SUNRPC: Replace dprintk() call sites in TCP receive path
        ...
      c742b634
    • Xiaoguang Wang's avatar
      io_uring: fix io_kiocb.flags modification race in IOPOLL mode · 65a6543d
      Xiaoguang Wang authored
      While testing io_uring in arm, we found sometimes io_sq_thread() keeps
      polling io requests even though there are not inflight io requests in
      block layer. After some investigations, found a possible race about
      io_kiocb.flags, see below race codes:
        1) in the end of io_write() or io_read()
          req->flags &= ~REQ_F_NEED_CLEANUP;
          kfree(iovec);
          return ret;
      
        2) in io_complete_rw_iopoll()
          if (res != -EAGAIN)
              req->flags |= REQ_F_IOPOLL_COMPLETED;
      
      In IOPOLL mode, io requests still maybe completed by interrupt, then
      above codes are not safe, concurrent modifications to req->flags, which
      is not protected by lock or is not atomic modifications. I also had
      disassemble io_complete_rw_iopoll() in arm:
         req->flags |= REQ_F_IOPOLL_COMPLETED;
         0xffff000008387b18 <+76>:    ldr     w0, [x19,#104]
         0xffff000008387b1c <+80>:    orr     w0, w0, #0x1000
         0xffff000008387b20 <+84>:    str     w0, [x19,#104]
      
      Seems that the "req->flags |= REQ_F_IOPOLL_COMPLETED;" is  load and
      modification, two instructions, which obviously is not atomic.
      
      To fix this issue, add a new iopoll_completed in io_kiocb to indicate
      whether io request is completed.
      Signed-off-by: default avatarXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      65a6543d
    • Colin Ian King's avatar
      umem: remove redundant initialization of variable ret · 9a6a5738
      Colin Ian King authored
      The variable ret is being initialized with a value that is never read
      and it is being updated later with a new value.  The initialization is
      redundant and can be removed.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Addresses-Coverity: ("Unused value")
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      9a6a5738
    • Colin Ian King's avatar
      pktcdvd: remove redundant initialization of variable ret · 8d20319e
      Colin Ian King authored
      The variable ret is being initialized with a value that is never read
      and it is being updated later with a new value.  The initialization is
      redundant and can be removed.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Addresses-Coverity: ("Unused value")
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      8d20319e