1. 21 Nov, 2022 13 commits
    • Alexander Aring's avatar
      fs: dlm: don't put dlm_local_addrs on heap · c51c9cd8
      Alexander Aring authored
      This patch removes to allocate the dlm_local_addr[] pointers on the
      heap. Instead we directly store the type of "struct sockaddr_storage".
      This removes function deinit_local() because it was freeing memory only.
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      c51c9cd8
    • Alexander Aring's avatar
      fs: dlm: cleanup listen sock handling · c3d88dfd
      Alexander Aring authored
      This patch removes save_listen_callbacks() and add_listen_sock() as they
      are only used once in lowcomms functionality. For shutdown lowcomms it's
      not necessary to whole flush the workqueues to synchronize with
      restoring the old sk_data_ready() callback. Only the listen con receive
      work need to be cancelled. For each individual node shutdown we should be
      sure that last ack was been transmitted which is done by flushing per
      connection swork worker.
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      c3d88dfd
    • Alexander Aring's avatar
      fs: dlm: remove socket shutdown handling · 4f567acb
      Alexander Aring authored
      Since commit 489d8e55 ("fs: dlm: add reliable connection if
      reconnect") we have functionality like TCP offers for half-closed
      sockets on dlm application protocol layer. This feature is required
      because the cluster manager events about leaving resource memberships
      can be locally already occurred but other cluster nodes having a pending
      leaving membership over the cluster manager protocol happening. In this
      time the local dlm node already shutdown it's connection and don't
      transmit anymore any new dlm messages, but however it still needs to be
      able to accept dlm messages because the pending leave membership request
      of the cluster manager protocol which the dlm kernel implementation has
      no control about it.
      
      We have this functionality on the application for two reasons, the main
      reason is that SCTP does not support such functionality on socket
      layer. But we can do it inside application layer.
      
      Another small issue is that this feature is broken in the TCP world
      because some NAT devices does not implement such functionality
      correctly. This is the same reason why the reliable connection session
      layer in DLM exists. We give up on middle devices in the networking
      which sends e.g. TCP resets out. In DLM we cannot have any message
      dropping and we ensure it over a session layer that it can't happen.
      
      Back to the half-closed grace shutdown handling. It's not necessary
      anymore to do it on socket layer (which is only support for TCP sockets)
      because we do it on application layer. This patch removes this handling,
      if there are still issues then we have a problem on the application
      layer for such handling.
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      4f567acb
    • Alexander Aring's avatar
      fs: dlm: use listen sock as dlm running indicator · 1037c2a9
      Alexander Aring authored
      This patch will switch from dlm_allow_conn to check if dlm lowcomms is
      running or not to if we actually have a listen socket set or not. The
      list socket will be set and unset in lowcomms start and shutdown
      functionality. To synchronize with data_ready() callback we will set the
      socket callback to NULL while socket lock is held.
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      1037c2a9
    • Alexander Aring's avatar
      fs: dlm: use list_first_entry_or_null · dd070a56
      Alexander Aring authored
      Instead of check on list_empty() we can do the same with
      list_first_entry_or_null() and return NULL if the returned value is NULL.
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      dd070a56
    • Alexander Aring's avatar
      fs: dlm: remove twice INIT_WORK · 01ea3d77
      Alexander Aring authored
      This patch removed a twice INIT_WORK() functionality. We already doing
      this inside of dlm_lowcomms_init() functionality which is called only
      once dlm is loaded.
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      01ea3d77
    • Alexander Aring's avatar
      fs: dlm: add midcomms init/start functions · 8b0188b0
      Alexander Aring authored
      This patch introduces leftovers of init, start, stop and exit
      functionality. The dlm application layer should always call the midcomms
      layer which getting aware of such event and redirect it to the lowcomms
      layer. Some functionality which is currently handled inside the start
      functionality of midcomms and lowcomms should be handled in the init
      functionality as it only need to be initialized once when dlm is loaded.
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      8b0188b0
    • Alexander Aring's avatar
      fs: dlm: add dst nodeid for msg tracing · 17827754
      Alexander Aring authored
      In DLM when we send a dlm message it is easy to add the lock resource
      name, but additional lookup is required when to trace the receive
      message side. The idea here is to move the lookup work to the user by
      using a lookup to find the right send message with recv message. As note
      DLM can't drop any message which is guaranteed by a special session
      layer.
      
      For doing the lookup a 3 tupel is required as an unique identification
      which is dst nodeid, src nodeid and sequence number. This patch adds the
      destination nodeid to the dlm message trace points. The source nodeid is
      given by the h_nodeid field inside the header.
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      17827754
    • Alexander Aring's avatar
      fs: dlm: rename seq to h_seq for msg tracing · 81889255
      Alexander Aring authored
      This patch renames seq to h_seq as it is named in the dlm header
      structure.
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      81889255
    • Alexander Aring's avatar
      fs: dlm: rename DLM_IFL_NEED_SCHED to DLM_IFL_CB_PENDING · 554d8496
      Alexander Aring authored
      This patch renames DLM_IFL_NEED_SCHED to DLM_IFL_CB_PENDING because
      CB_PENDING is a proper name to describe this flag. This flag is set when
      callback enqueue will return DLM_ENQUEUE_CALLBACK_NEED_SCHED because the
      callback worker need to be queued. The flag tells that callbacks are
      currently pending to be called and will be unset if the callback work
      for the specific lkb is done. The term need schedule is part of this
      time but a proper name is to say that there are some callbacks pending
      to being called.
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      554d8496
    • Alexander Aring's avatar
      fs: dlm: ast do WARN_ON_ONCE() on hotpath · 740bb8fc
      Alexander Aring authored
      This patch changes the ast hotpath functionality in very unlikely cases
      that we do WARN_ON_ONCE() instead of WARN_ON() to not spamming the
      console output if we run into states that it would occur over and over
      again.
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      740bb8fc
    • Alexander Aring's avatar
      fs: dlm: drop lkb ref in bug case · 9267c857
      Alexander Aring authored
      This patch will drop the lkb reference in an very unlikely case which
      should in practice not happened. However if it happens we cleanup the
      reference just in case.
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      9267c857
    • Alexander Aring's avatar
      fs: dlm: avoid false-positive checker warning · f217d7cc
      Alexander Aring authored
      This patch avoid the false-positive checker warning about writing 112
      bytes into a 88 bytes field "e->request", see:
      
      [   54.891560] dlm: csmb1: dlm_recover_directory 23 out 2 messages
      [   54.990542] ------------[ cut here ]------------
      [   54.991012] memcpy: detected field-spanning write (size 112) of single field "&e->request" at fs/dlm/requestqueue.c:47 (size 88)
      [   54.992150] WARNING: CPU: 0 PID: 297 at fs/dlm/requestqueue.c:47 dlm_add_requestqueue+0x177/0x180
      [   54.993002] CPU: 0 PID: 297 Comm: kworker/u4:3 Not tainted 6.1.0-rc5-00008-ge01d50cb #248
      [   54.993878] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.0-1.fc36 04/01/2014
      [   54.994718] Workqueue: dlm_recv process_recv_sockets
      [   54.995230] RIP: 0010:dlm_add_requestqueue+0x177/0x180
      [   54.995731] Code: e7 01 0f 85 3b ff ff ff b9 58 00 00 00 48 c7 c2 c0 41 74 82 4c 89 ee 48 c7 c7 20 42 74 82 c6 05 8b 8d 30 02 01 e8 51 07 be 00 <0f> 0b e9 12 ff ff ff 66 90 0f 1f 44 00 00 41 57 48 8d 87 10 08 00
      [   54.997483] RSP: 0018:ffffc90000b1fbe8 EFLAGS: 00010282
      [   54.997990] RAX: 0000000000000000 RBX: ffff888024fc3d00 RCX: 0000000000000000
      [   54.998667] RDX: 0000000000000001 RSI: ffffffff81155014 RDI: fffff52000163f73
      [   54.999342] RBP: ffff88800dbac000 R08: 0000000000000001 R09: ffffc90000b1fa5f
      [   54.999997] R10: fffff52000163f4b R11: 203a7970636d656d R12: ffff88800cfb0018
      [   55.000673] R13: 0000000000000070 R14: ffff888024fc3d18 R15: 0000000000000000
      [   55.001344] FS:  0000000000000000(0000) GS:ffff88806d600000(0000) knlGS:0000000000000000
      [   55.002078] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   55.002603] CR2: 00007f35d4f0b9a0 CR3: 0000000025495002 CR4: 0000000000770ef0
      [   55.003258] PKRU: 55555554
      [   55.003514] Call Trace:
      [   55.003756]  <TASK>
      [   55.003953]  dlm_receive_buffer+0x1c0/0x200
      [   55.004348]  dlm_process_incoming_buffer+0x46d/0x780
      [   55.004786]  ? kernel_recvmsg+0x8b/0xc0
      [   55.005150]  receive_from_sock.isra.0+0x168/0x420
      [   55.005582]  ? process_listen_recv_socket+0x10/0x10
      [   55.006018]  ? finish_task_switch.isra.0+0xe0/0x400
      [   55.006469]  ? __switch_to+0x2fe/0x6a0
      [   55.006808]  ? read_word_at_a_time+0xe/0x20
      [   55.007197]  ? strscpy+0x146/0x190
      [   55.007505]  process_one_work+0x3d0/0x6b0
      [   55.007863]  worker_thread+0x8d/0x620
      [   55.008209]  ? __kthread_parkme+0xd8/0xf0
      [   55.008565]  ? process_one_work+0x6b0/0x6b0
      [   55.008937]  kthread+0x171/0x1a0
      [   55.009251]  ? kthread_exit+0x60/0x60
      [   55.009582]  ret_from_fork+0x1f/0x30
      [   55.009903]  </TASK>
      [   55.010120] ---[ end trace 0000000000000000 ]---
      [   55.025783] dlm: csmb1: dlm_recover 5 generation 3 done: 201 ms
      [   55.026466] gfs2: fsid=smbcluster:csmb1.0: recover generation 3 done
      
      It seems the checker is unable to detect the additional length bytes
      which was allocated additionally for the flexible array in struct
      dlm_message. To solve it we split the memcpy() into copy for the 88 bytes
      struct and another memcpy() for the flexible array m_extra field.
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      f217d7cc
  2. 08 Nov, 2022 18 commits
  3. 06 Nov, 2022 9 commits
    • Linus Torvalds's avatar
      Linux 6.1-rc4 · f0c4d9fc
      Linus Torvalds authored
      f0c4d9fc
    • Linus Torvalds's avatar
      Merge tag 'cxl-fixes-for-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl · 16c7a368
      Linus Torvalds authored
      Pull cxl fixes from Dan Williams:
       "Several fixes for CXL region creation crashes, leaks and failures.
      
        This is mainly fallout from the original implementation of dynamic CXL
        region creation (instantiate new physical memory pools) that arrived
        in v6.0-rc1.
      
        Given the theme of "failures in the presence of pass-through decoders"
        this also includes new regression test infrastructure for that case.
      
        Summary:
      
         - Fix region creation crash with pass-through decoders
      
         - Fix region creation crash when no decoder allocation fails
      
         - Fix region creation crash when scanning regions to enforce the
           increasing physical address order constraint that CXL mandates
      
         - Fix a memory leak for cxl_pmem_region objects, track 1:N instead of
           1:1 memory-device-to-region associations.
      
         - Fix a memory leak for cxl_region objects when regions with active
           targets are deleted
      
         - Fix assignment of NUMA nodes to CXL regions by CFMWS (CXL Window)
           emulated proximity domains.
      
         - Fix region creation failure for switch attached devices downstream
           of a single-port host-bridge
      
         - Fix false positive memory leak of cxl_region objects by recycling
           recently used region ids rather than freeing them
      
         - Add regression test infrastructure for a pass-through decoder
           configuration
      
         - Fix some mailbox payload handling corner cases"
      
      * tag 'cxl-fixes-for-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl:
        cxl/region: Recycle region ids
        cxl/region: Fix 'distance' calculation with passthrough ports
        tools/testing/cxl: Add a single-port host-bridge regression config
        tools/testing/cxl: Fix some error exits
        cxl/pmem: Fix cxl_pmem_region and cxl_memdev leak
        cxl/region: Fix cxl_region leak, cleanup targets at region delete
        cxl/region: Fix region HPA ordering validation
        cxl/pmem: Use size_add() against integer overflow
        cxl/region: Fix decoder allocation crash
        ACPI: NUMA: Add CXL CFMWS 'nodes' to the possible nodes set
        cxl/pmem: Fix failure to account for 8 byte header for writes to the device LSA.
        cxl/region: Fix null pointer dereference due to pass through decoder commit
        cxl/mbox: Add a check on input payload size
      16c7a368
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v6.1-rc4' of... · aa529949
      Linus Torvalds authored
      Merge tag 'hwmon-for-v6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
       "Fix two regressions:
      
         - Commit 54cc3dbf ("hwmon: (pmbus) Add regulator supply into
           macro") resulted in regulator undercount when disabling regulators.
           Revert it.
      
         - The thermal subsystem rework caused the scmi driver to no longer
           register with the thermal subsystem because index values no longer
           match. To fix the problem, the scmi driver now directly registers
           with the thermal subsystem, no longer through the hwmon core"
      
      * tag 'hwmon-for-v6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        Revert "hwmon: (pmbus) Add regulator supply into macro"
        hwmon: (scmi) Register explicitly with Thermal Framework
      aa529949
    • Linus Torvalds's avatar
      Merge tag 'perf_urgent_for_v6.1_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 727ea09e
      Linus Torvalds authored
      Pull perf fixes from Borislav Petkov:
      
       - Add Cooper Lake's stepping to the PEBS guest/host events isolation
         fixed microcode revisions checking quirk
      
       - Update Icelake and Sapphire Rapids events constraints
      
       - Use the standard energy unit for Sapphire Rapids in RAPL
      
       - Fix the hw_breakpoint test to fail more graciously on !SMP configs
      
      * tag 'perf_urgent_for_v6.1_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/intel: Add Cooper Lake stepping to isolation_ucodes[]
        perf/x86/intel: Fix pebs event constraints for SPR
        perf/x86/intel: Fix pebs event constraints for ICL
        perf/x86/rapl: Use standard Energy Unit for SPR Dram RAPL domain
        perf/hw_breakpoint: test: Skip the test if dependencies unmet
      727ea09e
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v6.1_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f6f52047
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
      
       - Add new Intel CPU models
      
       - Enforce that TDX guests are successfully loaded only on TDX hardware
         where virtualization exception (#VE) delivery on kernel memory is
         disabled because handling those in all possible cases is "essentially
         impossible"
      
       - Add the proper include to the syscall wrappers so that BTF can see
         the real pt_regs definition and not only the forward declaration
      
      * tag 'x86_urgent_for_v6.1_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/cpu: Add several Intel server CPU model numbers
        x86/tdx: Panic on bad configs that #VE on "private" memory access
        x86/tdx: Prepare for using "INFO" call for a second purpose
        x86/syscall: Include asm/ptrace.h in syscall_wrapper header
      f6f52047
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.1-2' of... · 35697d81
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Use POSIX-compatible grep options
      
       - Document git-related tips for reproducible builds
      
       - Fix a typo in the modpost rule
      
       - Suppress SIGPIPE error message from gcc-ar and llvm-ar
      
       - Fix segmentation fault in the menuconfig search
      
      * tag 'kbuild-fixes-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kconfig: fix segmentation fault in menuconfig search
        kbuild: fix SIGPIPE error message for AR=gcc-ar and AR=llvm-ar
        kbuild: fix typo in modpost
        Documentation: kbuild: Add description of git for reproducible builds
        kbuild: use POSIX-compatible grep option
      35697d81
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 089d1c31
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
      "ARM:
      
         - Fix the pKVM stage-1 walker erronously using the stage-2 accessor
      
         - Correctly convert vcpu->kvm to a hyp pointer when generating an
           exception in a nVHE+MTE configuration
      
         - Check that KVM_CAP_DIRTY_LOG_* are valid before enabling them
      
         - Fix SMPRI_EL1/TPIDR2_EL0 trapping on VHE
      
         - Document the boot requirements for FGT when entering the kernel at
           EL1
      
        x86:
      
         - Use SRCU to protect zap in __kvm_set_or_clear_apicv_inhibit()
      
         - Make argument order consistent for kvcalloc()
      
         - Userspace API fixes for DEBUGCTL and LBRs"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: x86: Fix a typo about the usage of kvcalloc()
        KVM: x86: Use SRCU to protect zap in __kvm_set_or_clear_apicv_inhibit()
        KVM: VMX: Ignore guest CPUID for host userspace writes to DEBUGCTL
        KVM: VMX: Fold vmx_supported_debugctl() into vcpu_supported_debugctl()
        KVM: VMX: Advertise PMU LBRs if and only if perf supports LBRs
        arm64: booting: Document our requirements for fine grained traps with SME
        KVM: arm64: Fix SMPRI_EL1/TPIDR2_EL0 trapping on VHE
        KVM: Check KVM_CAP_DIRTY_LOG_{RING, RING_ACQ_REL} prior to enabling them
        KVM: arm64: Fix bad dereference on MTE-enabled systems
        KVM: arm64: Use correct accessor to parse stage-1 PTEs
      089d1c31
    • Linus Torvalds's avatar
      Merge tag 'for-linus-6.1-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 6e8c78d3
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
       "One fix for silencing a smatch warning, and a small cleanup patch"
      
      * tag 'for-linus-6.1-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        x86/xen: simplify sysenter and syscall setup
        x86/xen: silence smatch warning in pmu_msr_chk_emulated()
      6e8c78d3
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 9761070d
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "Fix a number of bugs, including some regressions, the most serious of
        which was one which would cause online resizes to fail with file
        systems with metadata checksums enabled.
      
        Also fix a warning caused by the newly added fortify string checker,
        plus some bugs that were found using fuzzed file systems"
      
      * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: fix fortify warning in fs/ext4/fast_commit.c:1551
        ext4: fix wrong return err in ext4_load_and_init_journal()
        ext4: fix warning in 'ext4_da_release_space'
        ext4: fix BUG_ON() when directory entry has invalid rec_len
        ext4: update the backup superblock's at the end of the online resize
      9761070d