13 Jul, 2019

2 commits

  • Pull dlm updates from David Teigland:
    "This set removes some unnecessary debugfs error handling, and checks
    that lowcomms workqueues are not NULL before destroying"

    * tag 'dlm-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
    dlm: no need to check return value of debugfs_create functions
    dlm: check if workqueues are NULL before flushing/destroying

    Linus Torvalds
     
  • Pull driver core and debugfs updates from Greg KH:
    "Here is the "big" driver core and debugfs changes for 5.3-rc1

    It's a lot of different patches, all across the tree due to some api
    changes and lots of debugfs cleanups.

    Other than the debugfs cleanups, in this set of changes we have:

    - bus iteration function cleanups

    - scripts/get_abi.pl tool to display and parse Documentation/ABI
    entries in a simple way

    - cleanups to Documenatation/ABI/ entries to make them parse easier
    due to typos and other minor things

    - default_attrs use for some ktype users

    - driver model documentation file conversions to .rst

    - compressed firmware file loading

    - deferred probe fixes

    All of these have been in linux-next for a while, with a bunch of
    merge issues that Stephen has been patient with me for"

    * tag 'driver-core-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (102 commits)
    debugfs: make error message a bit more verbose
    orangefs: fix build warning from debugfs cleanup patch
    ubifs: fix build warning after debugfs cleanup patch
    driver: core: Allow subsystems to continue deferring probe
    drivers: base: cacheinfo: Ensure cpu hotplug work is done before Intel RDT
    arch_topology: Remove error messages on out-of-memory conditions
    lib: notifier-error-inject: no need to check return value of debugfs_create functions
    swiotlb: no need to check return value of debugfs_create functions
    ceph: no need to check return value of debugfs_create functions
    sunrpc: no need to check return value of debugfs_create functions
    ubifs: no need to check return value of debugfs_create functions
    orangefs: no need to check return value of debugfs_create functions
    nfsd: no need to check return value of debugfs_create functions
    lib: 842: no need to check return value of debugfs_create functions
    debugfs: provide pr_fmt() macro
    debugfs: log errors when something goes wrong
    drivers: s390/cio: Fix compilation warning about const qualifiers
    drivers: Add generic helper to match by of_node
    driver_find_device: Unify the match function with class_find_device()
    bus_find_device: Unify the match callback with class_find_device
    ...

    Linus Torvalds
     

12 Jul, 2019

2 commits


13 Jun, 2019

1 commit


05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this copyrighted material is made available to anyone wishing to use
    modify copy or redistribute it subject to the terms and conditions
    of the gnu general public license version 2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 44 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531081038.653000175@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this copyrighted material is made available to anyone wishing to use
    modify copy or redistribute it subject to the terms and conditions
    of the gnu general public license v 2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 45 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Richard Fontana
    Reviewed-by: Allison Randal
    Reviewed-by: Steve Winslow
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190528170027.342746075@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit


28 Apr, 2019

1 commit

  • Add options to strictly validate messages and dump messages,
    sometimes perhaps validating dump messages non-strictly may
    be required, so add an option for that as well.

    Since none of this can really be applied to existing commands,
    set the options everwhere using the following spatch:

    @@
    identifier ops;
    expression X;
    @@
    struct genl_ops ops[] = {
    ...,
    {
    .cmd = X,
    + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
    ...
    },
    ...
    };

    For new commands one should just not copy the .validate 'opt-out'
    flags and thus get strict validation.

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

04 Feb, 2019

1 commit

  • 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: Deepa Dinamani
    Acked-by: Willem de Bruijn
    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: David S. Miller

    Deepa Dinamani
     

04 Dec, 2018

2 commits


28 Nov, 2018

1 commit


16 Nov, 2018

1 commit


15 Nov, 2018

4 commits


14 Nov, 2018

1 commit


09 Nov, 2018

1 commit

  • Before this patch, recovery would cause all callbacks to be delayed,
    put on a queue, and afterward they were all queued to the callback
    work queue. This patch does the same thing, but occasionally takes
    a break after 25 of them so it won't swamp the CPU at the expense
    of other RT processes like corosync.

    Signed-off-by: Bob Peterson
    Signed-off-by: David Teigland

    Bob Peterson
     

08 Nov, 2018

3 commits

  • In copy_result_to_user(), we first create a struct dlm_lock_result, which
    contains a struct dlm_lksb, the last member of which is a pointer to the
    lvb. Unfortunately, we copy the entire struct dlm_lksb to the result
    struct, which is then copied to userspace at the end of the function,
    leaking the contents of sb_lvbptr, which is a valid kernel pointer in some
    cases (indeed, later in the same function the data it points to is copied
    to userspace).

    It is an error to leak kernel pointers to userspace, as it undermines KASLR
    protections (see e.g. 65eea8edc31 ("floppy: Do not copy a kernel pointer to
    user memory in FDGETPRM ioctl") for another example of this).

    Signed-off-by: Tycho Andersen
    Signed-off-by: David Teigland

    Tycho Andersen
     
  • kobject doesn't like zero length object names, so let's test for that.

    Signed-off-by: Tycho Andersen
    Signed-off-by: David Teigland

    Tycho Andersen
     
  • dlm_config_nodes() does not allocate nodes on failure, so we should not
    free() nodes when it fails.

    Signed-off-by: Tycho Andersen
    Signed-off-by: David Teigland

    Tycho Andersen
     

24 Oct, 2018

1 commit

  • 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: David Howells

    David Howells
     

13 Jun, 2018

1 commit

  • The vmalloc() function has no 2-factor argument form, so multiplication
    factors need to be wrapped in array_size(). This patch replaces cases of:

    vmalloc(a * b)

    with:
    vmalloc(array_size(a, b))

    as well as handling cases of:

    vmalloc(a * b * c)

    with:

    vmalloc(array3_size(a, b, c))

    This does, however, attempt to ignore constant size factors like:

    vmalloc(4 * 1024)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    vmalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    vmalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    vmalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    vmalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    vmalloc(
    - sizeof(TYPE) * (COUNT_ID)
    + array_size(COUNT_ID, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE) * COUNT_ID
    + array_size(COUNT_ID, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE) * (COUNT_CONST)
    + array_size(COUNT_CONST, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE) * COUNT_CONST
    + array_size(COUNT_CONST, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * (COUNT_ID)
    + array_size(COUNT_ID, sizeof(THING))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * COUNT_ID
    + array_size(COUNT_ID, sizeof(THING))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * (COUNT_CONST)
    + array_size(COUNT_CONST, sizeof(THING))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * COUNT_CONST
    + array_size(COUNT_CONST, sizeof(THING))
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    vmalloc(
    - SIZE * COUNT
    + array_size(COUNT, SIZE)
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    vmalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    vmalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    vmalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    vmalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    vmalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    vmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    vmalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    vmalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    vmalloc(C1 * C2 * C3, ...)
    |
    vmalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants.
    @@
    expression E1, E2;
    constant C1, C2;
    @@

    (
    vmalloc(C1 * C2, ...)
    |
    vmalloc(
    - E1 * E2
    + array_size(E1, E2)
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

29 May, 2018

1 commit

  • 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=644fbdeacf1d3ed
    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
    [] new_lockspace+0x957/0xac0 [dlm]
    [] dlm_new_lockspace+0xae/0x140 [dlm]
    [] user_cluster_connect+0xc3/0x3a0 [ocfs2_stack_user]
    [] ocfs2_cluster_connect+0x144/0x220 [ocfs2_stackglue]
    [] ocfs2_dlm_init+0x215/0x440 [ocfs2]
    [] ocfs2_fill_super+0xcb0/0x1290 [ocfs2]
    [] mount_bdev+0x173/0x1b0
    [] mount_fs+0x35/0x150
    [] vfs_kern_mount.part.23+0x54/0x100
    [] do_mount+0x59a/0xc40
    [] SyS_mount+0x80/0xd0
    [] do_syscall_64+0x76/0x140
    [] entry_SYSCALL_64_after_hwframe+0x42/0xb7
    [] 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: Gang He
    Signed-off-by: David Teigland

    Gang He
     

02 May, 2018

2 commits

  • When the user setup a two-ring cluster, DLM kernel module
    will automatically selects to use SCTP protocol to communicate
    between each node. There will be about 5 minute hang in DLM
    kernel module, in case one ring is broken before switching to
    another ring, this will potentially affect the dependent upper
    applications, e.g. ocfs2, gfs2, clvm and clustered-MD, etc.
    Unfortunately, if the user setup a two-ring cluster, we can not
    specify DLM communication protocol with TCP explicitly, since
    DLM kernel module only supports SCTP protocol for multiple
    ring cluster.
    Base on my investigation, the time is spent in sock->ops->connect()
    function before returns ETIMEDOUT(-110) error, since O_NONBLOCK
    argument in connect() function does not work here, then we should
    make sock->ops->connect() function return in specified time via
    setting socket SO_SNDTIMEO atrribute.

    Signed-off-by: Gang He
    Signed-off-by: David Teigland

    Gang He
     
  • There is a clerical error when turn off Nagle's algorithm in
    sctp_connect_to_sock() function, this results in turn off
    Nagle's algorithm failure.
    After this correction, DLM performance will be improved obviously
    when using SCTP procotol.

    Signed-off-by: Gang He
    Signed-off-by: Michal Kubecek
    Signed-off-by: David Teigland

    Gang He
     

13 Feb, 2018

1 commit

  • Changes since v1:
    Added changes in these files:
    drivers/infiniband/hw/usnic/usnic_transport.c
    drivers/staging/lustre/lnet/lnet/lib-socket.c
    drivers/target/iscsi/iscsi_target_login.c
    drivers/vhost/net.c
    fs/dlm/lowcomms.c
    fs/ocfs2/cluster/tcp.c
    security/tomoyo/network.c

    Before:
    All these functions either return a negative error indicator,
    or store length of sockaddr into "int *socklen" parameter
    and return zero on success.

    "int *socklen" parameter is awkward. For example, if caller does not
    care, it still needs to provide on-stack storage for the value
    it does not need.

    None of the many FOO_getname() functions of various protocols
    ever used old value of *socklen. They always just overwrite it.

    This change drops this parameter, and makes all these functions, on success,
    return length of sockaddr. It's always >= 0 and can be differentiated
    from an error.

    Tests in callers are changed from "if (err)" to "if (err < 0)", where needed.

    rpc_sockname() lost "int buflen" parameter, since its only use was
    to be passed to kernel_getsockname() as &buflen and subsequently
    not used in any way.

    Userspace API is not changed.

    text data bss dec hex filename
    30108430 2633624 873672 33615726 200ef6e vmlinux.before.o
    30108109 2633612 873672 33615393 200ee21 vmlinux.o

    Signed-off-by: Denys Vlasenko
    CC: David S. Miller
    CC: linux-kernel@vger.kernel.org
    CC: netdev@vger.kernel.org
    CC: linux-bluetooth@vger.kernel.org
    CC: linux-decnet-user@lists.sourceforge.net
    CC: linux-wireless@vger.kernel.org
    CC: linux-rdma@vger.kernel.org
    CC: linux-sctp@vger.kernel.org
    CC: linux-nfs@vger.kernel.org
    CC: linux-x25@vger.kernel.org
    Signed-off-by: David S. Miller

    Denys Vlasenko
     

12 Feb, 2018

1 commit

  • This is the mindless scripted replacement of kernel use of POLL*
    variables as described by Al, done by this script:

    for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
    L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
    for f in $L; do sed -i "-es/^\([^\"]*\)\(\\)/\\1E\\2/" $f; done
    done

    with de-mangling cleanups yet to come.

    NOTE! On almost all architectures, the EPOLL* constants have the same
    values as the POLL* constants do. But they keyword here is "almost".
    For various bad reasons they aren't the same, and epoll() doesn't
    actually work quite correctly in some cases due to this on Sparc et al.

    The next patch from Al will sort out the final differences, and we
    should be all done.

    Scripted-by: Al Viro
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

31 Jan, 2018

1 commit

  • Pull kern_recvmsg reduction from Al Viro:
    "kernel_recvmsg() is a set_fs()-using wrapper for sock_recvmsg(). In
    all but one case that is not needed - use of ITER_KVEC for ->msg_iter
    takes care of the data and does not care about set_fs(). The only
    exception is svc_udp_recvfrom() where we want cmsg to be store into
    kernel object; everything else can just use sock_recvmsg() and be done
    with that.

    A followup converting svc_udp_recvfrom() away from set_fs() (and
    killing kernel_recvmsg() off) is *NOT* in here - I'd like to hear what
    netdev folks think of the approach proposed in that followup)"

    * 'work.sock_recvmsg' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    tipc: switch to sock_recvmsg()
    smc: switch to sock_recvmsg()
    ipvs: switch to sock_recvmsg()
    mISDN: switch to sock_recvmsg()
    drbd: switch to sock_recvmsg()
    lustre lnet_sock_read(): switch to sock_recvmsg()
    cfs2: switch to sock_recvmsg()
    ncpfs: switch to sock_recvmsg()
    dlm: switch to sock_recvmsg()
    svc_recvfrom(): switch to sock_recvmsg()

    Linus Torvalds
     

03 Dec, 2017

1 commit


28 Nov, 2017

1 commit


15 Nov, 2017

2 commits

  • Pull configfs updates from Christoph Hellwig:
    "A couple of configfs cleanups:

    - proper use of the bool type (Thomas Meyer)

    - constification of struct config_item_type (Bhumika Goyal)"

    * tag 'configfs-for-4.15' of git://git.infradead.org/users/hch/configfs:
    RDMA/cma: make config_item_type const
    stm class: make config_item_type const
    ACPI: configfs: make config_item_type const
    nvmet: make config_item_type const
    usb: gadget: configfs: make config_item_type const
    PCI: endpoint: make config_item_type const
    iio: make function argument and some structures const
    usb: gadget: make config_item_type structures const
    dlm: make config_item_type const
    netconsole: make config_item_type const
    nullb: make config_item_type const
    ocfs2/cluster: make config_item_type const
    target: make config_item_type const
    configfs: make ci_type field, some pointers and function arguments const
    configfs: make config_item_type const
    configfs: Fix bool initialization/comparison

    Linus Torvalds
     
  • Pull dlm updates from David Teigland:
    "This set focuses, as usual, on fixes to the comms layer.

    New testing of the dlm with ocfs2 uncovered a number of bugs in the
    TCP connection handling during recovery, starting, and stopping"

    * tag 'dlm-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
    dlm: remove dlm_send_rcom_lookup_dump
    dlm: recheck kthread_should_stop() before schedule()
    DLM: fix NULL pointer dereference in send_to_sock()
    DLM: fix to reschedule rwork
    DLM: fix to use sk_callback_lock correctly
    DLM: fix overflow dlm_cb_seq
    DLM: fix memory leak in tcp_accept_from_sock()
    DLM: fix conversion deadlock when DLM_LKF_NODLCKWT flag is set
    DLM: use CF_CLOSE flag to stop dlm_send correctly
    DLM: Reanimate CF_WRITE_PENDING flag
    DLM: fix race condition between dlm_recoverd_stop and dlm_recoverd
    DLM: close othercon at send/receive error
    DLM: retry rcom when dlm_wait_function is timed out.
    DLM: fix to use sock_mutex correctly in xxx_accept_from_sock
    DLM: fix race condition between dlm_send and dlm_recv
    DLM: fix double list_del()
    DLM: fix remove save_cb argument from add_sock()
    DLM: Fix saving of NULL callbacks
    DLM: Eliminate CF_WRITE_PENDING flag
    DLM: Eliminate CF_CONNECT_PENDING flag

    Linus Torvalds
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

19 Oct, 2017

1 commit

  • Make config_item_type structures const as they are either passed to a
    function having the argument as const or stored in the const "ci_type"
    field of a config_item structure.

    Done using Coccinelle.

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Christoph Hellwig

    Bhumika Goyal
     

09 Oct, 2017

1 commit

  • This function was only for debugging. It would be
    called in a condition that should not happen, and
    should probably have been removed from the final
    version of the original commit.

    Remove it because it does mutex lock under spin lock.

    Signed-off-by: David Teigland

    David Teigland
     

26 Sep, 2017

2 commits

  • Call schedule() here could make the thread miss wake
    up from kthread_stop(), so it is better to recheck
    kthread_should_stop() before call schedule(), a symptom
    happened when I run indefinite test (which mostly created
    clustered raid1, assemble it in other nodes, then stop
    them) of clustered raid.

    $ ps aux|grep md|grep D
    root 4211 0.0 0.0 19760 2220 ? Ds 02:58 0:00 mdadm -Ssq
    $ cat /proc/4211/stack
    kthread_stop+0x4d/0x150
    dlm_recoverd_stop+0x15/0x20 [dlm]
    dlm_release_lockspace+0x2ab/0x460 [dlm]
    leave+0xbf/0x150 [md_cluster]
    md_cluster_stop+0x18/0x30 [md_mod]
    bitmap_free+0x12e/0x140 [md_mod]
    bitmap_destroy+0x7f/0x90 [md_mod]
    __md_stop+0x21/0xa0 [md_mod]
    do_md_stop+0x15f/0x5c0 [md_mod]
    md_ioctl+0xa65/0x18a0 [md_mod]
    blkdev_ioctl+0x49e/0x8d0
    block_ioctl+0x41/0x50
    do_vfs_ioctl+0x96/0x5b0
    SyS_ioctl+0x79/0x90
    entry_SYSCALL_64_fastpath+0x1e/0xad

    This maybe not resolve the issue completely since the
    KTHREAD_SHOULD_STOP flag could be set between "break"
    and "schedule", but at least the chance for the symptom
    happen could be reduce a lot (The indefinite test runs
    more than 20 hours without problem and it happens easily
    without the change).

    Signed-off-by: Guoqing Jiang
    Signed-off-by: David Teigland

    Guoqing Jiang
     
  • The writequeue and writequeue_lock member of othercon was not initialized.
    If lowcomms_state_change() is called from network layer, othercon->swork
    may be scheduled. In this case, send_to_sock() will generate a NULL pointer
    reference. We avoid this problem by correctly initializing writequeue and
    writequeue_lock member of othercon.

    Signed-off-by: Tadashi Miyauchi
    Signed-off-by: Tsutomu Owa
    Signed-off-by: David Teigland

    tsutomu.owa@toshiba.co.jp