1. 11 11月, 2020 11 次提交
  2. 01 10月, 2020 1 次提交
  3. 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
  4. 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
  5. 06 8月, 2020 5 次提交
  6. 30 5月, 2020 2 次提交
  7. 29 5月, 2020 5 次提交
  8. 28 5月, 2020 1 次提交
  9. 19 12月, 2019 1 次提交
  10. 12 7月, 2019 1 次提交
  11. 31 5月, 2019 1 次提交
  12. 04 2月, 2019 1 次提交
    • D
      socket: Rename SO_RCVTIMEO/ SO_SNDTIMEO with _OLD suffixes · 45bdc661
      Deepa Dinamani 提交于
      SO_RCVTIMEO and SO_SNDTIMEO socket options use struct timeval
      as the time format. struct timeval is not y2038 safe.
      The subsequent patches in the series add support for new socket
      timeout options with _NEW suffix that will use y2038 safe
      data structures. Although the existing struct timeval layout
      is sufficiently wide to represent timeouts, because of the way
      libc will interpret time_t based on user defined flag, these
      new flags provide a way of having a structure that is the same
      for all architectures consistently.
      Rename the existing options with _OLD suffix forms so that the
      right option is enabled for userspace applications according
      to the architecture and time_t definition of libc.
      Signed-off-by: NDeepa Dinamani <deepa.kernel@gmail.com>
      Acked-by: NWillem de Bruijn <willemb@google.com>
      Cc: ccaulfie@redhat.com
      Cc: deller@gmx.de
      Cc: paulus@samba.org
      Cc: ralf@linux-mips.org
      Cc: rth@twiddle.net
      Cc: cluster-devel@redhat.com
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-alpha@vger.kernel.org
      Cc: linux-arch@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Cc: sparclinux@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      45bdc661
  13. 24 10月, 2018 1 次提交
    • D
      iov_iter: Separate type from direction and use accessor functions · aa563d7b
      David Howells 提交于
      In the iov_iter struct, separate the iterator type from the iterator
      direction and use accessor functions to access them in most places.
      
      Convert a bunch of places to use switch-statements to access them rather
      then chains of bitwise-AND statements.  This makes it easier to add further
      iterator types.  Also, this can be more efficient as to implement a switch
      of small contiguous integers, the compiler can use ~50% fewer compare
      instructions than it has to use bitwise-and instructions.
      
      Further, cease passing the iterator type into the iterator setup function.
      The iterator function can set that itself.  Only the direction is required.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      aa563d7b
  14. 29 5月, 2018 1 次提交
    • G
      dlm: remove O_NONBLOCK flag in sctp_connect_to_sock · da3627c3
      Gang He 提交于
      We should remove O_NONBLOCK flag when calling sock->ops->connect()
      in sctp_connect_to_sock() function.
      Why?
      1. up to now, sctp socket connect() function ignores the flag argument,
      that means O_NONBLOCK flag does not take effect, then we should remove
      it to avoid the confusion (but is not urgent).
      2. for the future, there will be a patch to fix this problem, then the flag
      argument will take effect, the patch has been queued at https://git.kernel.o
      rg/pub/scm/linux/kernel/git/davem/net.git/commit/net/sctp?id=644fbdea
      d366e44b8ba214de9d1dd66a9.
      But, the O_NONBLOCK flag will make sock->ops->connect() directly return
      without any wait time, then the connection will not be established, DLM kernel
      module will call sock->ops->connect() again and again, the bad results are,
      CPU usage is almost 100%, even trigger soft_lockup problem if the related
      configurations are enabled,
      DLM kernel module also prints lots of messages like,
      [Fri Apr 27 11:23:43 2018] dlm: connecting to 172167592
      [Fri Apr 27 11:23:43 2018] dlm: connecting to 172167592
      [Fri Apr 27 11:23:43 2018] dlm: connecting to 172167592
      [Fri Apr 27 11:23:43 2018] dlm: connecting to 172167592
      The upper application (e.g. ocfs2 mount command) is hanged at new_lockspace(),
      the whole backtrace is as below,
      tb0307-nd2:~ # cat /proc/2935/stack
      [<0>] new_lockspace+0x957/0xac0 [dlm]
      [<0>] dlm_new_lockspace+0xae/0x140 [dlm]
      [<0>] user_cluster_connect+0xc3/0x3a0 [ocfs2_stack_user]
      [<0>] ocfs2_cluster_connect+0x144/0x220 [ocfs2_stackglue]
      [<0>] ocfs2_dlm_init+0x215/0x440 [ocfs2]
      [<0>] ocfs2_fill_super+0xcb0/0x1290 [ocfs2]
      [<0>] mount_bdev+0x173/0x1b0
      [<0>] mount_fs+0x35/0x150
      [<0>] vfs_kern_mount.part.23+0x54/0x100
      [<0>] do_mount+0x59a/0xc40
      [<0>] SyS_mount+0x80/0xd0
      [<0>] do_syscall_64+0x76/0x140
      [<0>] entry_SYSCALL_64_after_hwframe+0x42/0xb7
      [<0>] 0xffffffffffffffff
      
      So, I think we should remove O_NONBLOCK flag here, since DLM kernel module can
      not handle non-block sockect in connect() properly.
      Signed-off-by: NGang He <ghe@suse.com>
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      da3627c3