[ovs-git] [openvswitch/ovs] dc497e: checkpatch: Add check for a whitespace after cast.

NIC我是一张网卡 noreply at github.com
Fri Nov 27 18:28:05 UTC 2020


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: dc497e36fc06a72e9f66674ab947d5b3d98b7f5f
      https://github.com/openvswitch/ovs/commit/dc497e36fc06a72e9f66674ab947d5b3d98b7f5f
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-11-27 (Fri, 27 Nov 2020)

  Changed paths:
    M tests/checkpatch.at
    M utilities/checkpatch.py

  Log Message:
  -----------
  checkpatch: Add check for a whitespace after cast.

Coding style says: "Put a space between the ``()`` used in a cast and
the expression whose type is cast: ``(void *) 0``.".
This style rule is frequently overlooked.  Let's check for it.

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Ian Stokes <ian.stokes at intel.com>


  Commit: cd9e88eeb588e382e5c25ed81ed02d222617cc49
      https://github.com/openvswitch/ovs/commit/cd9e88eeb588e382e5c25ed81ed02d222617cc49
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-11-27 (Fri, 27 Nov 2020)

  Changed paths:
    M lib/perf-counter.c

  Log Message:
  -----------
  perf-counter: Split numbers in the output.

While trying to benchmark big functions, values could be longer than
12 digits.  In this case all of them printed without spaces.  It's
hard ot read.

Fixes: 619c3a42dc1e ("lib: add a hardware performance counter access library")
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Greg Rose <gvrose8192 at gmail.com>


  Commit: 37423e4dc8bd0496f562421d922fbb7eb8290b11
      https://github.com/openvswitch/ovs/commit/37423e4dc8bd0496f562421d922fbb7eb8290b11
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-11-27 (Fri, 27 Nov 2020)

  Changed paths:
    M tests/library.at
    M tests/test-sha1.c

  Log Message:
  -----------
  tests: Add overflow test for the sha1 library.

This is a unit test for the overflow detection issue fixed by commit
a1d2c5f5d9ed ("sha1: Fix algorithm for data bigger than 512 megabytes.")

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Paolo Valerio <pvalerio at redhat.com>
Tested-by: Paolo Valerio <pvalerio at redhat.com>


  Commit: f0d23f67954cce22e9465b566f13ff8c4aec168b
      https://github.com/openvswitch/ovs/commit/f0d23f67954cce22e9465b566f13ff8c4aec168b
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2020-11-27 (Fri, 27 Nov 2020)

  Changed paths:
    M lib/ovsdb-idl.c
    M tests/idltest.ovsschema
    M tests/ovsdb-idl.at
    M tests/test-ovsdb.c

  Log Message:
  -----------
  ovsdb-idl: Fix iteration over tracked rows with no actual data.

When idl removes orphan rows, those rows are inserted into the
'track_list'.  This allows iterators such as *_FOR_EACH_TRACKED () to
return orphan rows that never had any data to the IDL user.  In this
case, it is difficult for the user to understand whether it is a row
with no data (there was no "insert" / "modify" for this row) or it is
a row with zero data (columns were cleared by DB transaction).

The main problem with this condition is that rows without data will
have NULL pointers instead of references that should be there according
to the database schema.  For example, ovn-controller might crash:

 ERROR: AddressSanitizer: SEGV on unknown address 0x000000000100
       (pc 0x00000055e9b2 bp 0x7ffef6180880 sp 0x7ffef6180860 T0)
 The signal is caused by a READ memory access.
 Hint: address points to the zero page.
    #0 0x55e9b1 in handle_deleted_lport /controller/binding.c
    #1 0x55e903 in handle_deleted_vif_lport /controller/binding.c:2072:5
    #2 0x55e059 in binding_handle_port_binding_changes /controller/binding.c:2155:23
    #3 0x5a6395 in runtime_data_sb_port_binding_handler /controller/ovn-controller.c:1454:10
    #4 0x5e15b3 in engine_compute /lib/inc-proc-eng.c:306:18
    #5 0x5e0faf in engine_run_node /lib/inc-proc-eng.c:352:14
    #6 0x5e0e04 in engine_run /lib/inc-proc-eng.c:377:9
    #7 0x5a03de in main /controller/ovn-controller.c
    #8 0x7f4fd9c991a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)
    #9 0x483f0d in _start (/controller/ovn-controller+0x483f0d)

It doesn't make much sense to return non-real rows to the user, so it's
best to exclude them from iteration.

Test included.  Without the fix, provided test will print empty orphan
rows that was never received by idl as tracked changes.

Fixes: 932104f483ef ("ovsdb-idl: Add support for change tracking.")
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Dumitru Ceara <dceara at redhat.com>


  Commit: 82367043e3e8984d9f94f54e7fe123f4b7ac9dd8
      https://github.com/openvswitch/ovs/commit/82367043e3e8984d9f94f54e7fe123f4b7ac9dd8
  Author: Joel Fernandes (Google) <joel at joelfernandes.org>
  Date:   2020-11-27 (Fri, 27 Nov 2020)

  Changed paths:
    M datapath/linux/compat/include/linux/rculist.h

  Log Message:
  -----------
  compat: rcu: Add support for consolidated-RCU reader checking

Upstream commit:
    commit 28875945ba98d1b47a8a706812b6494d165bb0a0
    Author: Joel Fernandes (Google) <joel at joelfernandes.org>
    Date:   Tue Jul 16 18:12:22 2019 -0400

    rcu: Add support for consolidated-RCU reader checking

    This commit adds RCU-reader checks to list_for_each_entry_rcu() and
    hlist_for_each_entry_rcu().  These checks are optional, and are indicated
    by a lockdep expression passed to a new optional argument to these two
    macros.  If this optional lockdep expression is omitted, these two macros
    act as before, checking for an RCU read-side critical section.

    Signed-off-by: Joel Fernandes (Google) <joel at joelfernandes.org>
    [ paulmck: Update to eliminate return within macro and update comment. ]
    Signed-off-by: Paul E. McKenney <paulmck at linux.ibm.com>

Backport portion of upstream commit for hlist_for_each_entry_rcu() macro
so that it can be used in following bug fix.

Cc: Joel Fernandes (Google) <joel at joelfernandes.org>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: fa57e9e45257f32b80c135c18ae821ac3c43a738
      https://github.com/openvswitch/ovs/commit/fa57e9e45257f32b80c135c18ae821ac3c43a738
  Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
  Date:   2020-11-27 (Fri, 27 Nov 2020)

  Changed paths:
    M datapath/conntrack.c
    M datapath/datapath.c

  Log Message:
  -----------
  datapath: ovs_ct_exit to be done under ovs_lock

Upstream commit:
    commit 27de77cec985233bdf6546437b9761853265c505
    Author: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Date:   Fri Apr 17 02:57:31 2020 +0800

    net: openvswitch: ovs_ct_exit to be done under ovs_lock

    syzbot wrote:
    | =============================
    | WARNING: suspicious RCU usage
    | 5.7.0-rc1+ #45 Not tainted
    | -----------------------------
    | net/openvswitch/conntrack.c:1898 RCU-list traversed in non-reader section!!
    |
    | other info that might help us debug this:
    | rcu_scheduler_active = 2, debug_locks = 1
    | ...
    |
    | stack backtrace:
    | Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-0-ga698c8995f-prebuilt.qemu.org 04/01/2014
    | Workqueue: netns cleanup_net
    | Call Trace:
    | ...
    | ovs_ct_exit
    | ovs_exit_net
    | ops_exit_list.isra.7
    | cleanup_net
    | process_one_work
    | worker_thread

    To avoid that warning, invoke the ovs_ct_exit under ovs_lock and add
    lockdep_ovsl_is_held as optional lockdep expression.

    Link: https://lore.kernel.org/lkml/000000000000e642a905a0cbee6e@google.com
    Fixes: 11efd5cb04a1 ("openvswitch: Support conntrack zone limit")
    Cc: Pravin B Shelar <pshelar at ovn.org>
    Cc: Yi-Hung Wei <yihung.wei at gmail.com>
    Reported-by: syzbot+7ef50afd3a211f879112 at syzkaller.appspotmail.com
    Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
    Acked-by: Pravin B Shelar <pshelar at ovn.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Cc: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Fixes: cb2a5486a3a3 ("datapath: conntrack: Support conntrack zone limit")
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
Acked-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/a8ee6bf72852...fa57e9e45257


More information about the git mailing list