1. 12 Oct, 2023 7 commits
    • Alexander Aring's avatar
      dlm: fix no ack after final message · 6212e452
      Alexander Aring authored
      In case of an final DLM message we can't should not send an ack out
      after the final message. This patch moves the ack message before the
      messages will be transmitted. If it's the final message and the
      receiving node turns into DLM_CLOSED state another ack messages will
      being received and turning the receiving node into DLM_ESTABLISHED
      again.
      
      Fixes: 1696c75f ("fs: dlm: add send ack threshold and append acks to msgs")
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      6212e452
    • Alexander Aring's avatar
      dlm: be sure we reset all nodes at forced shutdown · e759eb3e
      Alexander Aring authored
      In case we running in a force shutdown in either midcomms or lowcomms
      implementation we will make sure we reset all per midcomms node
      information.
      
      Fixes: 63e711b0 ("fs: dlm: create midcomms nodes when configure")
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      e759eb3e
    • Alexander Aring's avatar
      dlm: fix remove member after close call · 2776635e
      Alexander Aring authored
      The idea of commit 63e711b0 ("fs: dlm: create midcomms nodes when
      configure") is to set the midcomms node lifetime when a node joins or
      leaves the cluster. Currently we can hit the following warning:
      
      [10844.611495] ------------[ cut here ]------------
      [10844.615913] WARNING: CPU: 4 PID: 84304 at fs/dlm/midcomms.c:1263
      dlm_midcomms_remove_member+0x13f/0x180 [dlm]
      
      or running in a state where we hit a midcomms node usage count in a
      negative value:
      
      [  260.830782] node 2 users dec count -1
      
      The first warning happens when the a specific node does not exists and
      it was probably removed but dlm_midcomms_close() which is called when a
      node leaves the cluster. The second kernel log message is probably in a
      case when dlm_midcomms_addr() is called when a joined the cluster but
      due fencing a node leaved the cluster without getting removed from the
      lockspace. If the node joins the cluster and it was removed from the
      cluster due fencing the first call is to remove the node from lockspaces
      triggered by the user space. In both cases if the node wasn't found or
      the user count is zero, we should ignore any additional midcomms handling
      of dlm_midcomms_remove_member().
      
      Fixes: 63e711b0 ("fs: dlm: create midcomms nodes when configure")
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      2776635e
    • Alexander Aring's avatar
      dlm: fix creating multiple node structures · fe9b619e
      Alexander Aring authored
      This patch will lookup existing nodes instead of always creating them
      when dlm_midcomms_addr() is called. The idea is here to create midcomms
      nodes when user space getting informed that nodes joins the cluster. This
      is the case when dlm_midcomms_addr() is called, however it can be called
      multiple times by user space to add several address configurations to one
      node e.g. when using SCTP. Those multiple times need to be filtered out
      and we doing that by looking up if the node exists before. Due configfs
      entry it is safe that this function gets only called once at a time.
      
      Fixes: 63e711b0 ("fs: dlm: create midcomms nodes when configure")
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      fe9b619e
    • Christophe JAILLET's avatar
      fs: dlm: Remove some useless memset() · bc15bec1
      Christophe JAILLET authored
      There is no need to clear the buffer used to build the file name.
      
      snprintf() already guarantees that it is NULL terminated and such a
      (useless) precaution was not done for the first string (i.e
      ls_debug_rsb_dentry)
      
      So, save a few LoC.
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      bc15bec1
    • Christophe JAILLET's avatar
      fs: dlm: Fix the size of a buffer in dlm_create_debug_file() · b859e010
      Christophe JAILLET authored
      8 is not the maximum size of the suffix used when creating debugfs files.
      
      Let the compiler compute the correct size, and only give a hint about the
      longest possible string that is used.
      
      When building with W=1, this fixes the following warnings:
      
        fs/dlm/debug_fs.c: In function ‘dlm_create_debug_file’:
        fs/dlm/debug_fs.c:1020:58: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
         1020 |         snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_waiters", ls->ls_name);
              |                                                          ^
        fs/dlm/debug_fs.c:1020:9: note: ‘snprintf’ output between 9 and 73 bytes into a destination of size 72
         1020 |         snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_waiters", ls->ls_name);
              |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        fs/dlm/debug_fs.c:1031:50: error: ‘_queued_asts’ directive output may be truncated writing 12 bytes into a region of size between 8 and 72 [-Werror=format-truncation=]
         1031 |         snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_queued_asts", ls->ls_name);
              |                                                  ^~~~~~~~~~~~
        fs/dlm/debug_fs.c:1031:9: note: ‘snprintf’ output between 13 and 77 bytes into a destination of size 72
         1031 |         snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_queued_asts", ls->ls_name);
              |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Fixes: 541adb0d ("fs: dlm: debugfs for queued callbacks")
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      b859e010
    • Christophe JAILLET's avatar
      fs: dlm: Simplify buffer size computation in dlm_create_debug_file() · 19b3102c
      Christophe JAILLET authored
      Use sizeof(name) instead of the equivalent, but hard coded,
      DLM_LOCKSPACE_LEN + 8.
      
      This is less verbose and more future proof.
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      19b3102c
  2. 08 Oct, 2023 4 commits
  3. 07 Oct, 2023 10 commits
  4. 06 Oct, 2023 19 commits