1. 09 3月, 2021 2 次提交
    • A
      fs: dlm: set connected bit after accept · b30a624f
      Alexander Aring 提交于
      This patch sets the CF_CONNECTED bit when dlm accepts a connection from
      another node. If we don't set this bit, next time if the connection
      socket gets writable it will assume an event that the connection is
      successfully connected. However that is only the case when the
      connection did a connect.
      Signed-off-by: NAlexander Aring <aahringo@redhat.com>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      b30a624f
    • A
      fs: dlm: fix mark setting deadlock · e125fbeb
      Alexander Aring 提交于
      This patch fixes an deadlock issue when dlm_lowcomms_close() is called.
      When dlm_lowcomms_close() is called the clusters_root.subsys.su_mutex is
      held to remove configfs items. At this time we flushing (e.g.
      cancel_work_sync()) the workers of send and recv workqueue. Due the fact
      that we accessing configfs items (mark values), these workers will lock
      clusters_root.subsys.su_mutex as well which are already hold by
      dlm_lowcomms_close() and ends in a deadlock situation.
      
      [67170.703046] ======================================================
      [67170.703965] WARNING: possible circular locking dependency detected
      [67170.704758] 5.11.0-rc4+ #22 Tainted: G        W
      [67170.705433] ------------------------------------------------------
      [67170.706228] dlm_controld/280 is trying to acquire lock:
      [67170.706915] ffff9f2f475a6948 ((wq_completion)dlm_recv){+.+.}-{0:0}, at: __flush_work+0x203/0x4c0
      [67170.708026]
                     but task is already holding lock:
      [67170.708758] ffffffffa132f878 (&clusters_root.subsys.su_mutex){+.+.}-{3:3}, at: configfs_rmdir+0x29b/0x310
      [67170.710016]
                     which lock already depends on the new lock.
      
      The new behaviour adds the mark value to the node address configuration
      which doesn't require to held the clusters_root.subsys.su_mutex by
      accessing mark values in a separate datastructure. However the mark
      values can be set now only after a node address was set which is the
      case when the user is using dlm_controld.
      Signed-off-by: NAlexander Aring <aahringo@redhat.com>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      e125fbeb
  2. 11 11月, 2020 12 次提交
  3. 01 10月, 2020 1 次提交
  4. 30 9月, 2020 3 次提交
    • A
      fs: dlm: rework receive handling · 4798cbbf
      Alexander Aring 提交于
      This patch reworks the current receive handling of dlm. As I tried to
      change the send handling to fix reorder issues I took a look into the
      receive handling and simplified it, it works as the following:
      
      Each connection has a preallocated receive buffer with a minimum length of
      4096. On receive, the upper layer protocol will process all dlm message
      until there is not enough data anymore. If there exists "leftover" data at
      the end of the receive buffer because the dlm message wasn't fully received
      it will be copied to the begin of the preallocated receive buffer. Next
      receive more data will be appended to the previous "leftover" data and
      processing will begin again.
      
      This will remove a lot of code of the current mechanism. Inside the
      processing functionality we will ensure with a memmove() that the dlm
      message should be memory aligned. To have a dlm message always started
      at the beginning of the buffer will reduce some amount of memmove()
      calls because src and dest pointers are the same.
      
      The cluster attribute "buffer_size" becomes a new meaning, it's now the
      size of application layer receive buffer size. If this is changed during
      runtime the receive buffer will be reallocated. It's important that the
      receive buffer size has at minimum the size of the maximum possible dlm
      message size otherwise the received message cannot be placed inside
      the receive buffer size.
      Signed-off-by: NAlexander Aring <aahringo@redhat.com>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      4798cbbf
    • A
      fs: dlm: fix mark per nodeid setting · 3f78cd7d
      Alexander Aring 提交于
      This patch fixes to set per nodeid mark configuration for accepted
      sockets as well. Before this patch only the listen socket mark value was
      used for all accepted connections. This patch will ensure that the
      cluster mark attribute value will be always used for all sockets, if a
      per nodeid mark value is specified dlm will use this value for the
      specific node.
      Signed-off-by: NAlexander Aring <aahringo@redhat.com>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      3f78cd7d
    • A
      fs: dlm: remove lock dependency warning · 0461e0db
      Alexander Aring 提交于
      During my experiments to make dlm robust against tcpkill application I
      was able to run sometimes in a circular lock dependency warning between
      clusters_root.subsys.su_mutex and con->sock_mutex. We don't need to
      held the sock_mutex when getting the mark value which held the
      clusters_root.subsys.su_mutex. This patch moves the specific handling
      just before the sock_mutex will be held.
      Signed-off-by: NAlexander Aring <aahringo@redhat.com>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      0461e0db
  5. 28 8月, 2020 6 次提交
    • A
      fs: dlm: use free_con to free connection · 7ae0451e
      Alexander Aring 提交于
      This patch use free_con() functionality to free the listen connection if
      listen fails. It also fixes an issue that a freed resource is still part
      of the connection_hash as hlist_del() is not called in this case. The
      only difference is that free_con() handles othercon as well, but this is
      never been set for the listen connection.
      Signed-off-by: NAlexander Aring <aahringo@redhat.com>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      7ae0451e
    • A
      fs: dlm: handle possible othercon writequeues · 948c47e9
      Alexander Aring 提交于
      This patch adds free of possible other writequeue entries in othercon
      member of struct connection.
      Signed-off-by: NAlexander Aring <aahringo@redhat.com>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      948c47e9
    • A
      fs: dlm: move free writequeue into con free · 0de98432
      Alexander Aring 提交于
      This patch just move the free of struct connection member writequeue
      into the functionality when struct connection will be freed instead of
      doing two iterations.
      Signed-off-by: NAlexander Aring <aahringo@redhat.com>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      0de98432
    • A
      fs: dlm: fix dlm_local_addr memory leak · 043697f0
      Alexander Aring 提交于
      This patch fixes the following memory detected by kmemleak and umount
      gfs2 filesystem which removed the last lockspace:
      
      unreferenced object 0xffff9264f4f48f00 (size 128):
        comm "mount", pid 425, jiffies 4294690253 (age 48.159s)
        hex dump (first 32 bytes):
          02 00 52 48 c0 a8 7a fb 00 00 00 00 00 00 00 00  ..RH..z.........
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<0000000067a34940>] kmemdup+0x18/0x40
          [<00000000c935f9ab>] init_local+0x4c/0xa0
          [<00000000bbd286ef>] dlm_lowcomms_start+0x28/0x160
          [<00000000a86625cb>] dlm_new_lockspace+0x7e/0xb80
          [<000000008df6cd63>] gdlm_mount+0x1cc/0x5de
          [<00000000b67df8c7>] gfs2_lm_mount.constprop.0+0x1a3/0x1d3
          [<000000006642ac5e>] gfs2_fill_super+0x717/0xba9
          [<00000000d3ab7118>] get_tree_bdev+0x17f/0x280
          [<000000001975926e>] gfs2_get_tree+0x21/0x90
          [<00000000561ce1c4>] vfs_get_tree+0x28/0xc0
          [<000000007fecaf63>] path_mount+0x434/0xc00
          [<00000000636b9594>] __x64_sys_mount+0xe3/0x120
          [<00000000cc478a33>] do_syscall_64+0x33/0x40
          [<00000000ce9ccf01>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
      Signed-off-by: NAlexander Aring <aahringo@redhat.com>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      043697f0
    • A
      fs: dlm: make connection hash lockless · a47666eb
      Alexander Aring 提交于
      There are some problems with the connections_lock. During my
      experiements I saw sometimes circular dependencies with sock_lock.
      The reason here might be code parts which runs nodeid2con() before
      or after sock_lock is acquired.
      
      Another issue are missing locks in for_conn() iteration. Maybe this
      works fine because for_conn() is running in a context where
      connection_hash cannot be manipulated by others anymore.
      
      However this patch changes the connection_hash to be protected by
      sleepable rcu. The hotpath function __find_con() is implemented
      lockless as it is only a reader of connection_hash and this hopefully
      fixes the circular locking dependencies. The iteration for_conn() will
      still call some sleepable functionality, that's why we use sleepable rcu
      in this case.
      
      This patch removes the kmemcache functionality as I think I need to
      make some free() functionality via call_rcu(). However allocation time
      isn't here an issue. The dlm_allow_con will not be protected by a lock
      anymore as I think it's enough to just set and flush workqueues
      afterwards.
      Signed-off-by: NAlexander Aring <aahringo@redhat.com>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      a47666eb
    • A
      fs: dlm: synchronize dlm before shutdown · aa7ab1e2
      Alexander Aring 提交于
      This patch moves the dlm workqueue dlm synchronization before shutdown
      handling. The patch just flushes all pending work before starting to
      shutdown the connection. At least for the send_workqeue we should flush
      the workqueue to make sure there is no new connection handling going on
      as dlm_allow_conn switch is turned to false before.
      Signed-off-by: NAlexander Aring <aahringo@redhat.com>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      aa7ab1e2
  6. 06 8月, 2020 5 次提交
  7. 30 5月, 2020 2 次提交
  8. 29 5月, 2020 5 次提交
  9. 28 5月, 2020 1 次提交
  10. 19 12月, 2019 1 次提交
  11. 12 7月, 2019 1 次提交
  12. 31 5月, 2019 1 次提交