16 Oct, 2020

1 commit

  • Pull networking updates from Jakub Kicinski:

    - Add redirect_neigh() BPF packet redirect helper, allowing to limit
    stack traversal in common container configs and improving TCP
    back-pressure.

    Daniel reports ~10Gbps => ~15Gbps single stream TCP performance gain.

    - Expand netlink policy support and improve policy export to user
    space. (Ge)netlink core performs request validation according to
    declared policies. Expand the expressiveness of those policies
    (min/max length and bitmasks). Allow dumping policies for particular
    commands. This is used for feature discovery by user space (instead
    of kernel version parsing or trial and error).

    - Support IGMPv3/MLDv2 multicast listener discovery protocols in
    bridge.

    - Allow more than 255 IPv4 multicast interfaces.

    - Add support for Type of Service (ToS) reflection in SYN/SYN-ACK
    packets of TCPv6.

    - In Multi-patch TCP (MPTCP) support concurrent transmission of data on
    multiple subflows in a load balancing scenario. Enhance advertising
    addresses via the RM_ADDR/ADD_ADDR options.

    - Support SMC-Dv2 version of SMC, which enables multi-subnet
    deployments.

    - Allow more calls to same peer in RxRPC.

    - Support two new Controller Area Network (CAN) protocols - CAN-FD and
    ISO 15765-2:2016.

    - Add xfrm/IPsec compat layer, solving the 32bit user space on 64bit
    kernel problem.

    - Add TC actions for implementing MPLS L2 VPNs.

    - Improve nexthop code - e.g. handle various corner cases when nexthop
    objects are removed from groups better, skip unnecessary
    notifications and make it easier to offload nexthops into HW by
    converting to a blocking notifier.

    - Support adding and consuming TCP header options by BPF programs,
    opening the doors for easy experimental and deployment-specific TCP
    option use.

    - Reorganize TCP congestion control (CC) initialization to simplify
    life of TCP CC implemented in BPF.

    - Add support for shipping BPF programs with the kernel and loading
    them early on boot via the User Mode Driver mechanism, hence reusing
    all the user space infra we have.

    - Support sleepable BPF programs, initially targeting LSM and tracing.

    - Add bpf_d_path() helper for returning full path for given 'struct
    path'.

    - Make bpf_tail_call compatible with bpf-to-bpf calls.

    - Allow BPF programs to call map_update_elem on sockmaps.

    - Add BPF Type Format (BTF) support for type and enum discovery, as
    well as support for using BTF within the kernel itself (current use
    is for pretty printing structures).

    - Support listing and getting information about bpf_links via the bpf
    syscall.

    - Enhance kernel interfaces around NIC firmware update. Allow
    specifying overwrite mask to control if settings etc. are reset
    during update; report expected max time operation may take to users;
    support firmware activation without machine reboot incl. limits of
    how much impact reset may have (e.g. dropping link or not).

    - Extend ethtool configuration interface to report IEEE-standard
    counters, to limit the need for per-vendor logic in user space.

    - Adopt or extend devlink use for debug, monitoring, fw update in many
    drivers (dsa loop, ice, ionic, sja1105, qed, mlxsw, mv88e6xxx,
    dpaa2-eth).

    - In mlxsw expose critical and emergency SFP module temperature alarms.
    Refactor port buffer handling to make the defaults more suitable and
    support setting these values explicitly via the DCBNL interface.

    - Add XDP support for Intel's igb driver.

    - Support offloading TC flower classification and filtering rules to
    mscc_ocelot switches.

    - Add PTP support for Marvell Octeontx2 and PP2.2 hardware, as well as
    fixed interval period pulse generator and one-step timestamping in
    dpaa-eth.

    - Add support for various auth offloads in WiFi APs, e.g. SAE (WPA3)
    offload.

    - Add Lynx PHY/PCS MDIO module, and convert various drivers which have
    this HW to use it. Convert mvpp2 to split PCS.

    - Support Marvell Prestera 98DX3255 24-port switch ASICs, as well as
    7-port Mediatek MT7531 IP.

    - Add initial support for QCA6390 and IPQ6018 in ath11k WiFi driver,
    and wcn3680 support in wcn36xx.

    - Improve performance for packets which don't require much offloads on
    recent Mellanox NICs by 20% by making multiple packets share a
    descriptor entry.

    - Move chelsio inline crypto drivers (for TLS and IPsec) from the
    crypto subtree to drivers/net. Move MDIO drivers out of the phy
    directory.

    - Clean up a lot of W=1 warnings, reportedly the actively developed
    subsections of networking drivers should now build W=1 warning free.

    - Make sure drivers don't use in_interrupt() to dynamically adapt their
    code. Convert tasklets to use new tasklet_setup API (sadly this
    conversion is not yet complete).

    * tag 'net-next-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (2583 commits)
    Revert "bpfilter: Fix build error with CONFIG_BPFILTER_UMH"
    net, sockmap: Don't call bpf_prog_put() on NULL pointer
    bpf, selftest: Fix flaky tcp_hdr_options test when adding addr to lo
    bpf, sockmap: Add locking annotations to iterator
    netfilter: nftables: allow re-computing sctp CRC-32C in 'payload' statements
    net: fix pos incrementment in ipv6_route_seq_next
    net/smc: fix invalid return code in smcd_new_buf_create()
    net/smc: fix valid DMBE buffer sizes
    net/smc: fix use-after-free of delayed events
    bpfilter: Fix build error with CONFIG_BPFILTER_UMH
    cxgb4/ch_ipsec: Replace the module name to ch_ipsec from chcr
    net: sched: Fix suspicious RCU usage while accessing tcf_tunnel_info
    bpf: Fix register equivalence tracking.
    rxrpc: Fix loss of final ack on shutdown
    rxrpc: Fix bundle counting for exclusive connections
    netfilter: restore NF_INET_NUMHOOKS
    ibmveth: Identify ingress large send packets.
    ibmveth: Switch order of ibmveth_helper calls.
    cxgb4: handle 4-tuple PEDIT to NAT mode translation
    selftests: Add VRF route leaking tests
    ...

    Linus Torvalds
     

13 Oct, 2020

1 commit

  • Pull dlm updates from David Teigland:
    "This set continues the ongoing rework of the low level communication
    layer in the dlm.

    The focus here is on improvements to connection handling, and
    reworking the receiving of messages"

    * tag 'dlm-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
    fs: dlm: fix race in nodeid2con
    fs: dlm: rework receive handling
    fs: dlm: disallow buffer size below default
    fs: dlm: handle range check as callback
    fs: dlm: fix mark per nodeid setting
    fs: dlm: remove lock dependency warning
    fs: dlm: use free_con to free connection
    fs: dlm: handle possible othercon writequeues
    fs: dlm: move free writequeue into con free
    fs: dlm: fix configfs memory leak
    fs: dlm: fix dlm_local_addr memory leak
    fs: dlm: make connection hash lockless
    fs: dlm: synchronize dlm before shutdown

    Linus Torvalds
     

03 Oct, 2020

1 commit


01 Oct, 2020

1 commit

  • This patch fixes a race in nodeid2con in cases that we parallel running
    a lookup and both will create a connection structure for the same nodeid.
    It's a rare case to create a new connection structure to keep reader
    lockless we just do a lookup inside the protection area again and drop
    previous work if this race happens.

    Fixes: a47666eb763cc ("fs: dlm: make connection hash lockless")
    Signed-off-by: Alexander Aring
    Signed-off-by: David Teigland

    Alexander Aring
     

30 Sep, 2020

5 commits

  • 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: Alexander Aring
    Signed-off-by: David Teigland

    Alexander Aring
     
  • I observed that the upper layer will not send messages above this value.
    As conclusion the application receive buffer should not below that
    value, otherwise we are not capable to deliver the dlm message to the
    upper layer. This patch forbids to set the receive buffer below the
    maximum possible dlm message size.

    Signed-off-by: Alexander Aring
    Signed-off-by: David Teigland

    Alexander Aring
     
  • This patch adds a callback to CLUSTER_ATTR macro to allow individual
    callbacks for attributes which might have a more complex attribute range
    checking just than non zero.

    Signed-off-by: Alexander Aring
    Signed-off-by: David Teigland

    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: Alexander Aring
    Signed-off-by: David Teigland

    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: Alexander Aring
    Signed-off-by: David Teigland

    Alexander Aring
     

28 Aug, 2020

7 commits

  • 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: Alexander Aring
    Signed-off-by: David Teigland

    Alexander Aring
     
  • This patch adds free of possible other writequeue entries in othercon
    member of struct connection.

    Signed-off-by: Alexander Aring
    Signed-off-by: David Teigland

    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: Alexander Aring
    Signed-off-by: David Teigland

    Alexander Aring
     
  • This patch fixes the following memory detected by kmemleak and umount
    gfs2 filesystem which removed the last lockspace:

    unreferenced object 0xffff9264f482f600 (size 192):
    comm "dlm_controld", pid 325, jiffies 4294690276 (age 48.136s)
    hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 6e 6f 64 65 73 00 00 00 ........nodes...
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    backtrace:
    [] make_space+0x41/0x130
    [] configfs_mkdir+0x1a2/0x5f0
    [] vfs_mkdir+0x155/0x210
    [] do_mkdirat+0x6d/0x110
    [] do_syscall_64+0x33/0x40
    [] entry_SYSCALL_64_after_hwframe+0x44/0xa9

    The patch just remembers the "nodes" entry pointer in space as I think
    it's created as subdirectory when parent "spaces" is created. In
    function drop_space() we will lost the pointer reference to nds because
    configfs_remove_default_groups(). However as this subdirectory is always
    available when "spaces" exists it will just be freed when "spaces" will be
    freed.

    Signed-off-by: Alexander Aring
    Signed-off-by: David Teigland

    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:
    [] kmemdup+0x18/0x40
    [] init_local+0x4c/0xa0
    [] dlm_lowcomms_start+0x28/0x160
    [] dlm_new_lockspace+0x7e/0xb80
    [] gdlm_mount+0x1cc/0x5de
    [] gfs2_lm_mount.constprop.0+0x1a3/0x1d3
    [] gfs2_fill_super+0x717/0xba9
    [] get_tree_bdev+0x17f/0x280
    [] gfs2_get_tree+0x21/0x90
    [] vfs_get_tree+0x28/0xc0
    [] path_mount+0x434/0xc00
    [] __x64_sys_mount+0xe3/0x120
    [] do_syscall_64+0x33/0x40
    [] entry_SYSCALL_64_after_hwframe+0x44/0xa9

    Signed-off-by: Alexander Aring
    Signed-off-by: David Teigland

    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: Alexander Aring
    Signed-off-by: David Teigland

    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: Alexander Aring
    Signed-off-by: David Teigland

    Alexander Aring
     

24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

07 Aug, 2020

1 commit

  • Pull dlm updates from David Teigland:
    "This set includes a some improvements to the dlm networking layer:
    improving the ability to trace dlm messages for debugging, and
    improved handling of bad messages or disrupted connections"

    * tag 'dlm-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
    fs: dlm: implement tcp graceful shutdown
    fs: dlm: change handling of reconnects
    fs: dlm: don't close socket on invalid message
    fs: dlm: set skb mark per peer socket
    fs: dlm: set skb mark for listen socket
    net: sock: add sock_set_mark
    dlm: Fix kobject memleak

    Linus Torvalds
     

06 Aug, 2020

6 commits

  • During my code inspection I saw there is no implementation of a graceful
    shutdown for tcp. This patch will introduce a graceful shutdown for tcp
    connections. The shutdown is implemented synchronized as
    dlm_lowcomms_stop() is called to end all dlm communication. After shutdown
    is done, a lot of flush and closing functionality will be called. However
    I don't see a problem with that.

    The waitqueue for synchronize the shutdown has a timeout of 10 seconds, if
    timeout a force close will be exectued.

    Signed-off-by: Alexander Aring
    Signed-off-by: David Teigland

    Alexander Aring
     
  • This patch changes the handling of reconnects. At first we only close
    the connection related to the communication failure. If we get a new
    connection for an already existing connection we close the existing
    connection and take the new one.

    This patch improves significantly the stability of tcp connections while
    running "tcpkill -9 -i $IFACE port 21064" while generating a lot of dlm
    messages e.g. on a gfs2 mount with many files. My test setup shows that a
    deadlock is "more" unlikely. Before this patch I wasn't able to get
    not a deadlock after 5 seconds. After this patch my observation is
    that it's more likely to survive after 5 seconds and more, but still a
    deadlock occurs after certain time. My guess is that there are still
    "segments" inside the tcp writequeue or retransmit queue which get dropped
    when receiving a tcp reset [1]. Hard to reproduce because the right message
    need to be inside these queues, which might even be in the 5 first seconds
    with this patch.

    [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/ipv4/tcp_input.c?h=v5.8-rc6#n4122

    Signed-off-by: Alexander Aring
    Signed-off-by: David Teigland

    Alexander Aring
     
  • This patch doesn't close sockets when there is an invalid dlm message
    received. The connection will probably reconnect anyway so. To not
    close the connection will reduce the number of possible failtures.
    As we don't have a different strategy to react on such scenario
    just keep going the connection and ignore the message.

    Signed-off-by: Alexander Aring
    Signed-off-by: David Teigland

    Alexander Aring
     
  • This patch adds support to set the skb mark value for the DLM tcp and
    sctp socket per peer. The mark value will be offered as per comm value
    of configfs. At creation time of the peer socket it will be set as
    socket option.

    Signed-off-by: Alexander Aring
    Signed-off-by: David Teigland

    Alexander Aring
     
  • This patch adds support to set the skb mark value for the DLM listen
    tcp and sctp sockets. The mark value will be offered as cluster
    configuration. At creation time of the listen socket it will be set as
    socket option.

    Signed-off-by: Alexander Aring
    Signed-off-by: David Teigland

    Alexander Aring
     
  • Currently the error return path from kobject_init_and_add() is not
    followed by a call to kobject_put() - which means we are leaking
    the kobject.

    Set do_unreg = 1 before kobject_init_and_add() to ensure that
    kobject_put() can be called in its error patch.

    Fixes: 901195ed7f4b ("Kobject: change GFS2 to use kobject_init_and_add")
    Reported-by: Hulk Robot
    Signed-off-by: Wang Hai
    Signed-off-by: David Teigland

    Wang Hai
     

17 Jul, 2020

1 commit

  • Using uninitialized_var() is dangerous as it papers over real bugs[1]
    (or can in the future), and suppresses unrelated compiler warnings
    (e.g. "unused variable"). If the compiler thinks it is uninitialized,
    either simply initialize the variable or make compiler changes.

    In preparation for removing[2] the[3] macro[4], remove all remaining
    needless uses with the following script:

    git grep '\buninitialized_var\b' | cut -d: -f1 | sort -u | \
    xargs perl -pi -e \
    's/\buninitialized_var\(([^\)]+)\)/\1/g;
    s:\s*/\* (GCC be quiet|to make compiler happy) \*/$::g;'

    drivers/video/fbdev/riva/riva_hw.c was manually tweaked to avoid
    pathological white-space.

    No outstanding warnings were found building allmodconfig with GCC 9.3.0
    for x86_64, i386, arm64, arm, powerpc, powerpc64le, s390x, mips, sparc64,
    alpha, and m68k.

    [1] https://lore.kernel.org/lkml/20200603174714.192027-1-glider@google.com/
    [2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/
    [3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/
    [4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/

    Reviewed-by: Leon Romanovsky # drivers/infiniband and mlx4/mlx5
    Acked-by: Jason Gunthorpe # IB
    Acked-by: Kalle Valo # wireless drivers
    Reviewed-by: Chao Yu # erofs
    Signed-off-by: Kees Cook

    Kees Cook
     

06 Jun, 2020

1 commit

  • Pull dlm updates from David Teigland:
    "This set includes a couple minor cleanups, and dropping the
    interruptible from a wait_event that waits for an event from the
    userspace cluster management"

    * tag 'dlm-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
    dlm: remove BUG() before panic()
    dlm: Switch to using wait_event()
    fs:dlm:remove unneeded semicolon in rcom.c
    dlm: user: Replace zero-length array with flexible-array member
    dlm: dlm_internal: Replace zero-length array with flexible-array member

    Linus Torvalds
     

30 May, 2020

2 commits

  • The SCTP protocol allows to bind multiple address to a socket. That
    feature is currently only exposed as a socket option. Add a bind_add
    method struct proto that allows to bind additional addresses, and
    switch the dlm code to use the method instead of going through the
    socket option from kernel space.

    Signed-off-by: Christoph Hellwig
    Acked-by: Marcelo Ricardo Leitner
    Signed-off-by: David S. Miller

    Christoph Hellwig
     
  • Add a helper to directly set the SCTP_NODELAY sockopt from kernel space
    without going through a fake uaccess.

    Signed-off-by: Christoph Hellwig
    Acked-by: Marcelo Ricardo Leitner
    Signed-off-by: David S. Miller

    Christoph Hellwig
     

29 May, 2020

5 commits

  • Add a helper to directly set the TCP_NODELAY sockopt from kernel space
    without going through a fake uaccess. Cleanup the callers to avoid
    pointless wrappers now that this is a simple function call.

    Signed-off-by: Christoph Hellwig
    Acked-by: Sagi Grimberg
    Acked-by: Jason Gunthorpe
    Signed-off-by: David S. Miller

    Christoph Hellwig
     
  • Add a helper to directly set the SO_RCVBUFFORCE sockopt from kernel space
    without going through a fake uaccess.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: David S. Miller

    Christoph Hellwig
     
  • Add a helper to directly set the SO_KEEPALIVE sockopt from kernel space
    without going through a fake uaccess.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: David S. Miller

    Christoph Hellwig
     
  • Add a helper to directly set the SO_SNDTIMEO_NEW sockopt from kernel
    space without going through a fake uaccess. The interface is
    simplified to only pass the seconds value, as that is the only
    thing needed at the moment.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: David S. Miller

    Christoph Hellwig
     
  • Add a helper to directly set the SO_REUSEADDR sockopt from kernel space
    without going through a fake uaccess.

    For this the iscsi target now has to formally depend on inet to avoid
    a mostly theoretical compile failure. For actual operation it already
    did depend on having ipv4 or ipv6 support.

    Signed-off-by: Christoph Hellwig
    Acked-by: Sagi Grimberg
    Signed-off-by: David S. Miller

    Christoph Hellwig
     

28 May, 2020

1 commit

  • The only difference between a few missing fixes applied to the SCTP
    one is that TCP uses ->getpeername to get the remote address, while
    SCTP uses kernel_getsockopt(.. SCTP_PRIMARY_ADDR). But given that
    getpeername is defined to return the primary address for sctp, there
    doesn't seem to be any reason for the different way of quering the
    peername, or all the code duplication.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: David S. Miller

    Christoph Hellwig
     

13 May, 2020

5 commits

  • Building a kernel with clang sometimes fails with an objtool error in dlm:

    fs/dlm/lock.o: warning: objtool: revert_lock_pc()+0xbd: can't find jump dest instruction at .text+0xd7fc

    The problem is that BUG() never returns and the compiler knows
    that anything after it is unreachable, however the panic still
    emits some code that does not get fully eliminated.

    Having both BUG() and panic() is really pointless as the BUG()
    kills the current process and the subsequent panic() never hits.
    In most cases, we probably don't really want either and should
    replace the DLM_ASSERT() statements with WARN_ON(), as has
    been done for some of them.

    Remove the BUG() here so the user at least sees the panic message
    and we can reliably build randconfig kernels.

    Fixes: e7fd41792fc0 ("[DLM] The core of the DLM for GFS2/CLVM")
    Cc: Josh Poimboeuf
    Cc: clang-built-linux@googlegroups.com
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David Teigland

    Arnd Bergmann
     
  • We saw an issue in a production server on a customer deployment where
    DLM 4.0.7 gets "stuck" and unable to join new lockspaces.

    There is no useful response for the dlm in do_event() if
    wait_event_interruptible() is interrupted, so switch to
    wait_event().

    Signed-off-by: Ross Lagerwall
    Signed-off-by: David Teigland

    Ross Lagerwall
     
  • Fix the following coccicheck warning:
    fs/dlm/rcom.c:566:2-3: Unneeded semicolon

    Signed-off-by: Wu Bo
    Signed-off-by: David Teigland

    Wu Bo
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: David Teigland

    Gustavo A. R. Silva
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: David Teigland

    Gustavo A. R. Silva
     

19 Dec, 2019

1 commit