08 Mar, 2010

1 commit

  • 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

1 commit


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
     

07 May, 2009

2 commits


29 Jan, 2009

1 commit


09 Jan, 2009

1 commit


14 Nov, 2008

1 commit

  • Fixes a regression from commit 0f8e0d9a317406612700426fad3efab0b7bbc467,
    "dlm: allow multiple lockspace creates".

    An extraneous 'else' slipped into a code fragment being moved from
    release_lockspace() to dlm_release_lockspace(). The result of the
    unwanted 'else' is that dlm threads and structures are not stopped
    and cleaned up when the final dlm lockspace is removed. Trying to
    create a new lockspace again afterward will fail with
    "kmem_cache_create: duplicate cache dlm_conn" because the cache
    was not previously destroyed.

    Signed-off-by: David Teigland

    David Teigland
     

29 Aug, 2008

3 commits

  • The dlm_scand thread needs to lock the list of lockspaces
    when going through it.

    Signed-off-by: David Teigland

    David Teigland
     
  • If dlm_controld (the userspace daemon that controls the setup and
    recovery of the dlm) fails, the kernel should shut down the lockspaces
    in the kernel rather than leaving them running. This is detected by
    having dlm_controld hold a misc device open while running, and if
    the kernel detects a close while the daemon is still needed, it stops
    the lockspaces in the kernel.

    Knowing that the userspace daemon isn't running also allows the
    lockspace create/remove routines to avoid waiting on the daemon
    for join/leave operations.

    Signed-off-by: David Teigland

    David Teigland
     
  • Add a count for lockspace create and release so that create can
    be called multiple times to use the lockspace from different places.
    Also add the new flag DLM_LSFL_NEWEXCL to create a lockspace with
    the previous behavior of returning -EEXIST if the lockspace already
    exists.

    Signed-off-by: David Teigland

    David Teigland
     

30 Apr, 2008

1 commit


07 Feb, 2008

1 commit


30 Jan, 2008

2 commits


25 Jan, 2008

6 commits


13 Oct, 2007

2 commits

  • * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (75 commits)
    PM: merge device power-management source files
    sysfs: add copyrights
    kobject: update the copyrights
    kset: add some kerneldoc to help describe what these strange things are
    Driver core: rename ktype_edd and ktype_efivar
    Driver core: rename ktype_driver
    Driver core: rename ktype_device
    Driver core: rename ktype_class
    driver core: remove subsystem_init()
    sysfs: move sysfs file poll implementation to sysfs_open_dirent
    sysfs: implement sysfs_open_dirent
    sysfs: move sysfs_dirent->s_children into sysfs_dirent->s_dir
    sysfs: make sysfs_root a regular directory dirent
    sysfs: open code sysfs_attach_dentry()
    sysfs: make s_elem an anonymous union
    sysfs: make bin attr open get active reference of parent too
    sysfs: kill unnecessary NULL pointer check in sysfs_release()
    sysfs: kill unnecessary sysfs_get() in open paths
    sysfs: reposition sysfs_dirent->s_mode.
    sysfs: kill sysfs_update_file()
    ...

    Linus Torvalds
     
  • A kset should not have its name set directly, so dynamically set the
    name at runtime.

    This is needed to remove the static array in the kobject structure which
    will be changed in a future patch.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

10 Oct, 2007

1 commit

  • Introduce a per-lockspace rwsem that's held in read mode by dlm_recv
    threads while working in the dlm. This allows dlm_recv activity to be
    suspended when the lockspace transitions to, from and between recovery
    cycles.

    The specific bug prompting this change is one where an in-progress
    recovery cycle is aborted by a new recovery cycle. While dlm_recv was
    processing a recovery message, the recovery cycle was aborted and
    dlm_recoverd began cleaning up. dlm_recv decremented recover_locks_count
    on an rsb after dlm_recoverd had reset it to zero. This is fixed by
    suspending dlm_recv (taking write lock on the rwsem) before aborting the
    current recovery.

    The transitions to/from normal and recovery modes are simplified by using
    this new ability to block dlm_recv. The switch from normal to recovery
    mode means dlm_recv goes from processing locking messages, to saving them
    for later, and vice versa. Races are avoided by blocking dlm_recv when
    setting the flag that switches between modes.

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

    David Teigland
     

09 Jul, 2007

6 commits

  • Mask off the recently added DLM_LSFL_FS flag when setting the exflags.
    This way all the nodes in the lockspace aren't required to have the FS
    flag set, since we later check that exflags matches among all nodes.

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

    David Teigland
     
  • Add a new flag, DLM_LSFL_FS, to be used when a file system creates a lockspace.
    This flag causes the dlm to use GFP_NOFS for allocations instead of GFP_KERNEL.
    (This updated version of the patch uses gfp_t for ls_allocation.)

    Signed-Off-By: Patrick Caulfield
    Signed-Off-By: David Teigland
    Signed-off-by: Steven Whitehouse

    Patrick Caulfield
     
  • Joining the lockspace should wait for the initial round of inter-node
    config checks to complete before returning. This way, if there's a
    configuration mismatch between the joining node and the existing nodes,
    the join can fail and return an error to the application.

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

    David Teigland
     
  • Fix the error path when exiting new_lockspace(). It was kfree'ing the
    lockspace struct at the end, but that's only valid if it exits before
    kobject_register occured. After kobject_register we have to let the
    kobject do the freeing.

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

    David Teigland
     
  • New features: lock timeouts and time warnings. If the DLM_LKF_TIMEOUT
    flag is set, then the request/conversion will be canceled after waiting
    the specified number of centiseconds (specified per lock). This feature
    is only available for locks requested through libdlm (can be enabled for
    kernel dlm users if there's a use for it.)

    If the new DLM_LSFL_TIMEWARN flag is set when creating the lockspace, then
    a warning message will be sent to userspace (using genetlink) after a
    request/conversion has been waiting for a given number of centiseconds
    (configurable per node). The time warnings will be used in the future
    to do deadlock detection in userspace.

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

    David Teigland
     
  • Don't let dlm_scand run during recovery since it may try to do a resource
    directory removal while the directory nodes are changing.

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

    David Teigland
     

08 May, 2007

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw: (34 commits)
    [GFS2] Uncomment sprintf_symbol calling code
    [DLM] lowcomms style
    [GFS2] printk warning fixes
    [GFS2] Patch to fix mmap of stuffed files
    [GFS2] use lib/parser for parsing mount options
    [DLM] Lowcomms nodeid range & initialisation fixes
    [DLM] Fix dlm_lowcoms_stop hang
    [DLM] fix mode munging
    [GFS2] lockdump improvements
    [GFS2] Patch to detect corrupt number of dir entries in leaf and/or inode blocks
    [GFS2] bz 236008: Kernel gpf doing cat /debugfs/gfs2/xxx (lock dump)
    [DLM] fs/dlm/ast.c should #include "ast.h"
    [DLM] Consolidate transport protocols
    [DLM] Remove redundant assignment
    [GFS2] Fix bz 234168 (ignoring rgrp flags)
    [DLM] change lkid format
    [DLM] interface for purge (2/2)
    [DLM] add orphan purging code (1/2)
    [DLM] split create_message function
    [GFS2] Set drop_count to 0 (off) by default
    ...

    Linus Torvalds
     

03 May, 2007

1 commit


01 May, 2007

1 commit

  • Full cancel and force-unlock support. In the past, cancel and force-unlock
    wouldn't work if there was another operation in progress on the lock. Now,
    both cancel and unlock-force can overlap an operation on a lock, meaning there
    may be 2 or 3 operations in progress on a lock in parallel. This support is
    important not only because cancel and force-unlock are explicit operations
    that an app can use, but both are used implicitly when a process exits while
    holding locks.

    Summary of changes:

    - add-to and remove-from waiters functions were rewritten to handle situations
    with more than one remote operation outstanding on a lock

    - validate_unlock_args detects when an overlapping cancel/unlock-force
    can be sent and when it needs to be delayed until a request/lookup
    reply is received

    - processing request/lookup replies detects when cancel/unlock-force
    occured during the op, and carries out the delayed cancel/unlock-force

    - manipulation of the "waiters" (remote operation) state of a lock moved under
    the standard rsb mutex that protects all the other lock state

    - the two recovery routines related to locks on the waiters list changed
    according to the way lkb's are now locked before accessing waiters state

    - waiters recovery detects when lkb's being recovered have overlapping
    cancel/unlock-force, and may not recover such locks

    - revert_lock (cancel) returns a value to distinguish cases where it did
    nothing vs cases where it actually did a cancel; the cancel completion ast
    should only be done when cancel did something

    - orphaned locks put on new list so they can be found later for purging

    - cancel must be called on a lock when making it an orphan

    - flag user locks (ENDOFLIFE) at the end of their useful life (to the
    application) so we can return an error for any further cancel/unlock-force

    - we weren't setting COMP/BAST ast flags if one was already set, so we'd lose
    either a completion or blocking ast

    - clear an unread bast on a lock that's become unlocked

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

    David Teigland
     

06 Feb, 2007

1 commit

  • Add a "ci_" prefix to the fields in the dlm_config_info struct so that we
    can use macros to add configfs functions to access them (in a later
    patch). No functional changes in this patch, just naming changes.

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

    David Teigland
     

30 Nov, 2006

2 commits

  • We often abort a recovery after sending a status request to a remote node.
    We want to ignore any potential status reply we get from the remote node.
    If we get one of these unwanted replies, we've often moved on to the next
    recovery message and incremented the message sequence counter, so the
    reply will be ignored due to the seq number. In some cases, we've not
    moved on to the next message so the seq number of the reply we want to
    ignore is still correct, causing the reply to be accepted. The next
    recovery message will then mistake this old reply as a new one.

    To fix this, we add the flag RCOM_WAIT to indicate when we can accept a
    new reply. We clear this flag if we abort recovery while waiting for a
    reply. Before the flag is set again (to allow new replies) we know that
    any old replies will be rejected due to their sequence number. We also
    initialize the recovery-message sequence number to a random value when a
    lockspace is first created. This makes it clear when messages are being
    rejected from an old instance of a lockspace that has since been
    recreated.

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

    David Teigland
     
  • Requests that arrive after recovery has started are saved in the
    requestqueue and processed after recovery is done. Some of these requests
    are purged during recovery if they are from nodes that have been removed.
    We move the purging of the requests (dlm_purge_requestqueue) to later in
    the recovery sequence which allows the routine saving requests
    (dlm_add_requestqueue) to avoid filtering out requests by nodeid since the
    same will be done by the purge. The current code has add_requestqueue
    filtering by nodeid but doesn't hold any locks when accessing the list of
    current nodes. This also means that we need to call the purge routine
    when the lockspace is being shut down since the add routine will not be
    rejecting requests itself any more.

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

    David Teigland
     

06 Nov, 2006

2 commits

  • Now that the lockspace struct is freed when the last sysfs object is released
    this patch prevents use of that lockspace by sysfs. We attempt to re-get the
    lockspace from the lockspace list and fail the request if it has been removed.

    Signed-Off-By: Patrick Caulfield
    Signed-off-by: Steven Whitehouse

    Patrick Caulfield
     
  • This patch fixes the recounting on the lockspace kobject. Previously the lockspace was freed while userspace could have had a
    reference to one of its sysfs files, causing an oops in kref_put.

    Now the lockspace kfree is moved into the kobject release() function

    Signed-Off-By: Patrick Caulfield
    Signed-off-by: Steven Whitehouse

    Patrick Caulfield
     

07 Sep, 2006

1 commit


25 Aug, 2006

1 commit

  • When a new lockspace was being created, the recoverd thread was being
    started for it before the lockspace was added to the global list of
    lockspaces. The new thread was looking up the lockspace in the global
    list and sometimes not finding it due to the race with the original thread
    adding it to the list. We need to add the lockspace to the global list
    before starting the thread instead of after, and if the new thread can't
    find the lockspace for some reason, it should return an error.

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

    David Teigland