01 May, 2010

2 commits

  • Commit 7fe2b3190b8b299409f13cf3a6f85c2bd371f8bb fixed possible
    misordering of completion asts (casts) and blocking asts (basts)
    for kernel locks. This patch does the same for locks taken by
    user space applications.

    Signed-off-by: David Teigland

    David Teigland
     
  • Smatch complains because "lkb" is never NULL. Looking at it, the original
    code actually adds the new element to the end of the list fine, so we can
    just get rid of the if condition. This code is four years old and no one
    has complained so it must work.

    Signed-off-by: Dan Carpenter
    Signed-off-by: David Teigland

    Dan Carpenter
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

13 Mar, 2010

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (56 commits)
    doc: fix typo in comment explaining rb_tree usage
    Remove fs/ntfs/ChangeLog
    doc: fix console doc typo
    doc: cpuset: Update the cpuset flag file
    Fix of spelling in arch/sparc/kernel/leon_kernel.c no longer needed
    Remove drivers/parport/ChangeLog
    Remove drivers/char/ChangeLog
    doc: typo - Table 1-2 should refer to "status", not "statm"
    tree-wide: fix typos "ass?o[sc]iac?te" -> "associate" in comments
    No need to patch AMD-provided drivers/gpu/drm/radeon/atombios.h
    devres/irq: Fix devm_irq_match comment
    Remove reference to kthread_create_on_cpu
    tree-wide: Assorted spelling fixes
    tree-wide: fix 'lenght' typo in comments and code
    drm/kms: fix spelling in error message
    doc: capitalization and other minor fixes in pnp doc
    devres: typo fix s/dev/devm/
    Remove redundant trailing semicolons from macros
    fix typo "definetly" -> "definitely" in comment
    tree-wide: s/widht/width/g typo in comments
    ...

    Fix trivial conflict in Documentation/laptops/00-INDEX

    Linus Torvalds
     

08 Mar, 2010

2 commits

  • Conflicts:
    Documentation/filesystems/proc.txt
    arch/arm/mach-u300/include/mach/debug-macro.S
    drivers/net/qlge/qlge_ethtool.c
    drivers/net/qlge/qlge_main.c
    drivers/net/typhoon.c

    Jiri Kosina
     
  • Constify struct sysfs_ops.

    This is part of the ops structure constification
    effort started by Arjan van de Ven et al.

    Benefits of this constification:

    * prevents modification of data that is shared
    (referenced) by many other structure instances
    at runtime

    * detects/prevents accidental (but not intentional)
    modification attempts on archs that enforce
    read-only kernel data at runtime

    * potentially better optimized code as the compiler
    can assume that the const data cannot be changed

    * the compiler/linker move const data into .rodata
    and therefore exclude them from false sharing

    Signed-off-by: Emese Revfy
    Acked-by: David Teigland
    Acked-by: Matt Domsch
    Acked-by: Maciej Sosnowski
    Acked-by: Hans J. Koch
    Acked-by: Pekka Enberg
    Acked-by: Jens Axboe
    Acked-by: Stephen Hemminger
    Signed-off-by: Greg Kroah-Hartman

    Emese Revfy
     

27 Feb, 2010

3 commits

  • The bast mode that appears in the debugfs output should be
    useful on both master and process nodes. lkb_highbast is
    currently printed, and is only useful on the master node.
    lkb_bastmode is only useful on the process node. This
    patch sets lkb_bastmode on the master node as well, and
    uses that value in the debugfs print.

    Signed-off-by: David Teigland

    David Teigland
     
  • Although it is possible to get this information from the path,
    its much easier to provide the lockspace as a seperate env
    variable.

    Signed-off-by: Steven Whitehouse
    Signed-off-by: David Teigland

    Steven Whitehouse
     
  • When the lock master processes a successful operation (request,
    convert, cancel, or unlock), it will process the effects of the
    change before sending the reply for the operation. The "effects"
    of the operation are:

    - blocking callbacks (basts) for any newly granted locks
    - waiting or converting locks that can now be granted

    The cast is queued on the local node when the reply from the lock
    master is received. This means that a lock holder can receive a
    bast for a lock mode that is doesn't yet know has been granted.

    Signed-off-by: David Teigland

    David Teigland
     

25 Feb, 2010

1 commit

  • When both blocking and completion callbacks are queued for lock,
    the dlm would always deliver the completion callback (cast) first.
    In some cases the blocking callback (bast) is queued before the
    cast, though, and should be delivered first. This patch keeps
    track of the order in which they were queued and delivers them
    in that order.

    This patch also keeps track of the granted mode in the last cast
    and eliminates the following bast if the bast mode is compatible
    with the preceding cast mode. This happens when a remotely mastered
    lock is demoted, e.g. EX->NL, in which case the local node queues
    a cast immediately after sending the demote message. In this way
    a cast can be queued for a mode, e.g. NL, that makes an in-transit
    bast extraneous.

    Signed-off-by: David Teigland

    David Teigland
     

04 Feb, 2010

1 commit


11 Dec, 2009

1 commit


04 Dec, 2009

1 commit

  • That is "success", "unknown", "through", "performance", "[re|un]mapping"
    , "access", "default", "reasonable", "[con]currently", "temperature"
    , "channel", "[un]used", "application", "example","hierarchy", "therefore"
    , "[over|under]flow", "contiguous", "threshold", "enough" and others.

    Signed-off-by: André Goddard Rosa
    Signed-off-by: Jiri Kosina

    André Goddard Rosa
     

01 Dec, 2009

1 commit

  • Replace all GFP_KERNEL and ls_allocation with GFP_NOFS.
    ls_allocation would be GFP_KERNEL for userland lockspaces
    and GFP_NOFS for file system lockspaces.

    It was discovered that any lockspaces on the system can
    affect all others by triggering memory reclaim in the
    file system which could in turn call back into the dlm
    to acquire locks, deadlocking dlm threads that were
    shared by all lockspaces, like dlm_recv.

    Signed-off-by: David Teigland

    David Teigland
     

01 Oct, 2009

2 commits

  • The code to set up sctp sockets was not using the sockfd_lookup()
    and sockfd_put() routines to translate an fd to a socket. The
    direct fget and fput calls were resulting in error messages from
    alloc_fd().

    Also clean up two log messages and remove a third, related to
    setting up sctp associations.

    Signed-off-by: David Teigland

    David Teigland
     
  • The recently added dlm_lowcomms_connect_node() from
    391fbdc5d527149578490db2f1619951d91f3561 does not work
    when using SCTP instead of TCP. The sctp connection code
    has nothing to do without data to send. Check for no data
    in the sctp connection code and do nothing instead of
    triggering a BUG. Also have connect_node() do nothing
    when the protocol is sctp.

    Signed-off-by: David Teigland

    David Teigland
     

23 Sep, 2009

1 commit

  • Make all seq_operations structs const, to help mitigate against
    revectoring user-triggerable function pointers.

    This is derived from the grsecurity patch, although generated from scratch
    because it's simpler than extracting the changes from there.

    Signed-off-by: James Morris
    Acked-by: Serge Hallyn
    Acked-by: Casey Schaufler
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Morris
     

19 Sep, 2009

1 commit


25 Aug, 2009

2 commits

  • Using kernel_sendpage() is cleaner and safer than following
    sock->ops ourselves.

    Signed-off-by: Paolo Bonzini
    Signed-off-by: David Teigland

    Paolo Bonzini
     
  • Closing a connection to a node can create problems if there are
    outstanding messages for that node. The problems include dlm_send
    spinning attempting to reconnect, or BUG from tcp_connect_to_sock()
    attempting to use a partially closed connection.

    To cleanly close a connection, we now first attempt to send any pending
    messages, cancel any remaining workqueue work, and flag the connection
    as closed to avoid reconnect attempts.

    Signed-off-by: Lars Marowsky-Bree
    Signed-off-by: Christine Caulfield
    Signed-off-by: David Teigland

    Lars Marowsky-Bree
     

19 Aug, 2009

1 commit

  • The last correction to the tcp_connect_to_sock error exit path,
    commit a89d63a159b1ba5833be2bef00adf8ad8caac8be, can free an already
    freed socket, due to collision with a previous (incomplete) attempt
    to fix the same issue, commit 311f6fc77c51926dbdfbeab0a5d88d70f01fa3f4.

    Signed-off-by: Casey Dahlin
    Signed-off-by: David Teigland

    Casey Dahlin
     

13 Aug, 2009

1 commit


15 Jul, 2009

1 commit


13 Jul, 2009

1 commit

  • This makes generic netlink network namespace aware. No
    generic netlink families except for the controller family
    are made namespace aware, they need to be checked one by
    one and then set the family->netnsok member to true.

    A new function genlmsg_multicast_netns() is introduced to
    allow sending a multicast message in a given namespace,
    for example when it applies to an object that lives in
    that namespace, a new function genlmsg_multicast_allns()
    to send a message to all network namespaces (for objects
    that do not have an associated netns).

    The function genlmsg_multicast() is changed to multicast
    the message in just init_net, which is currently correct
    for all generic netlink families since they only work in
    init_net right now. Some will later want to work in all
    net namespaces because they do not care about the netns
    at all -- those will have to be converted to use one of
    the new functions genlmsg_multicast_allns() or
    genlmsg_multicast_netns() whenever they are made netns
    aware in some way.

    After this patch families can easily decide whether or
    not they should be available in all net namespaces. Many
    genl families us it for objects not related to networking
    and should therefore be available in all namespaces, but
    that will have to be done on a per family basis.

    Note that this doesn't touch on the checkpoint/restart
    problem where network namespaces could be used, genl
    families and multicast groups are numbered globally and
    I see no easy way of changing that, especially since it
    must be possible to multicast to all network namespaces
    for those families that do not care about netns.

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

    Johannes Berg
     

19 Jun, 2009

1 commit

  • Fix a regression from the original addition of nfs lock support
    586759f03e2e9031ac5589912a51a909ed53c30a. When a synchronous
    (non-nfs) plock completes, the waiting thread will wake up and
    free the op struct. This races with the user thread in
    dev_write() which goes on to read the op's callback field to
    check if the lock is async and needs a callback. This check
    can happen on the freed op. The fix is to note the callback
    value before the op can be freed.

    Signed-off-by: David Teigland

    David Teigland
     

18 Jun, 2009

1 commit


16 May, 2009

1 commit

  • Change some GFP_KERNEL allocations to use either GFP_NOFS or
    ls_allocation (when available) which the fs sets to GFP_NOFS.
    The point is to prevent allocations from going back into the
    cluster fs in places where that might lead to deadlock.

    Signed-off-by: David Teigland

    David Teigland
     

15 May, 2009

1 commit

  • Make network connections to other nodes earlier, in the context of
    dlm_recoverd. This avoids connecting to nodes from dlm_send where we
    try to avoid allocations which could possibly deadlock if memory reclaim
    goes into the cluster fs which may try to do a dlm operation.

    Signed-off-by: Christine Caulfield
    Signed-off-by: David Teigland

    Christine Caulfield
     

07 May, 2009

2 commits


12 Mar, 2009

4 commits

  • Using offsetof() to calculate name length does not work because
    it does not produce consistent results with with structure packing.
    This caused memcpy to corrupt memory by copying 4 extra bytes off
    the end of the buffer on 64 bit kernels with 32 bit userspace
    (the only case where this 32/64 compat code is used).

    The fix is to calculate name length directly from the start instead
    of trying to derive it later using count and offsetof.

    Signed-off-by: David Teigland

    David Teigland
     
  • Return immediately from dlm_unlock(CANCEL) if the lock is
    granted and not being converted; there's nothing to cancel.

    Signed-off-by: David Teigland

    David Teigland
     
  • When a conversion completes successfully and finds that a cancel
    of the convert is still in progress (which is now a moot point),
    preemptively clear the state associated with outstanding cancel.
    That state could cause a subsequent conversion to be ignored.

    Also, improve the consistency and content of error and debug
    messages in this area.

    Signed-off-by: David Teigland

    David Teigland
     
  • Integer nodeids can be too large for the idr code; use a hash
    table instead.

    Signed-off-by: Christine Caulfield
    Signed-off-by: David Teigland

    Christine Caulfield
     

29 Jan, 2009

3 commits


22 Jan, 2009

2 commits

  • dlm_posix_get fills out the relevant fields in the file_lock before
    returning when there is a lock conflict, but doesn't clean out any of
    the other fields in the file_lock.

    When nfsd does a NFSv4 lockt call, it sets the fl_lmops to
    nfsd_posix_mng_ops before calling the lower fs. When the lock comes back
    after testing a lock on GFS2, it still has that field set. This confuses
    nfsd into thinking that the file_lock is a nfsd4 lock.

    Fix this by making DLM reinitialize the file_lock before copying the
    fields from the conflicting lock.

    Signed-off-by: Jeff Layton
    Signed-off-by: David Teigland

    Jeff Layton
     
  • We should use the original copy of the file_lock, fl, instead
    of the copy, flc in the lockd notify callback. The range in flc has
    been modified by posix_lock_file(), so it will not match a copy of the
    lock in lockd.

    Signed-off-by: David Teigland

    David Teigland
     

09 Jan, 2009

1 commit