04 Jan, 2012

1 commit

  • These new callbacks notify the dlm user about lock recovery.
    GFS2, and possibly others, need to be aware of when the dlm
    will be doing lock recovery for a failed lockspace member.

    In the past, this coordination has been done between dlm and
    file system daemons in userspace, which then direct their
    kernel counterparts. These callbacks allow the same
    coordination directly, and more simply.

    Signed-off-by: David Teigland

    David Teigland
     

13 Jul, 2011

1 commit

  • By pre-allocating rsb structs before searching the hash
    table, they can be inserted immediately. This avoids
    always having to repeat the search when adding the struct
    to hash list.

    This also adds space to the rsb struct for a max resource
    name, so an rsb allocation can be used by any request.
    The constant size also allows us to finally use a slab
    for the rsb structs.

    Signed-off-by: David Teigland

    David Teigland
     

11 Jul, 2011

1 commit


01 Jul, 2011

1 commit


02 Apr, 2011

1 commit


11 Mar, 2011

1 commit


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
     

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
     

05 Sep, 2008

1 commit

  • sparc32:

    fs/dlm/config.c:397: error: expected identifier or '(' before '{' token
    fs/dlm/config.c: In function 'drop_node':
    fs/dlm/config.c:589: warning: initialization from incompatible pointer type
    fs/dlm/config.c:589: warning: initialization from incompatible pointer type
    fs/dlm/config.c: In function 'release_node':
    fs/dlm/config.c:601: warning: initialization from incompatible pointer type
    fs/dlm/config.c:601: warning: initialization from incompatible pointer type
    fs/dlm/config.c: In function 'show_node':
    fs/dlm/config.c:717: warning: initialization from incompatible pointer type
    fs/dlm/config.c:717: warning: initialization from incompatible pointer type
    fs/dlm/config.c: In function 'store_node':
    fs/dlm/config.c:726: warning: initialization from incompatible pointer type
    fs/dlm/config.c:726: warning: initialization from incompatible pointer type

    Cc: Christine Caulfield
    Signed-off-by: Andrew Morton
    Signed-off-by: David Teigland

    Andrew Morton
     

03 Sep, 2008

1 commit


14 Aug, 2008

1 commit

  • Add a dlm_ prefix to the struct names in config.c. This resolves a
    conflict with struct node in particular, when include/linux/node.h
    happens to be included.

    Reported-by: Andrew Morton
    Signed-off-by: David Teigland

    David Teigland
     

18 Jul, 2008

2 commits


15 Jul, 2008

1 commit

  • The configfs operations ->make_item() and ->make_group() currently
    return a new item/group. A return of NULL signifies an error. Because
    of this, -ENOMEM is the only return code bubbled up the stack.

    Multiple folks have requested the ability to return specific error codes
    when these operations fail. This patch adds that ability by changing the
    ->make_item/group() ops to return an int.

    Also updated are the in-kernel users of configfs.

    Signed-off-by: Joel Becker

    Joel Becker
     

22 Apr, 2008

2 commits

  • If a node is removed from a lockspace, and then added back before the
    dlm is notified of the removal, the dlm will not detect the removal
    and won't clear the old state from the node. This is fixed by using a
    list of added nodes so the membership recovery can detect when a newly
    added node is already in the member list.

    Signed-off-by: David Teigland

    David Teigland
     
  • cluster_set is only called from the macro CLUSTER_ATTR which defines read/write
    access functions. Make the signedness match to avoid sparse warnings every time
    CLUSTER_ATTR is used (lines 149-159) all of the form:

    fs/dlm/config.c:149:1: warning: incorrect type in argument 3 (different signedness)
    fs/dlm/config.c:149:1: expected unsigned int *info_field
    fs/dlm/config.c:149:1: got int extern [toplevel] *

    Signed-off-by: Harvey Harrison
    Signed-off-by: David Teigland

    Harvey Harrison
     

07 Feb, 2008

1 commit


11 Jul, 2007

3 commits

  • Convert the su_sem member of struct configfs_subsystem to a struct
    mutex, as that's what it is. Also convert all the users and update
    Documentation/configfs.txt and Documentation/configfs_example.c
    accordingly.

    [ Conflict in fs/dlm/config.c with commit
    3168b0780d06ace875696f8a648d04d6089654e5 manually resolved. --Mark ]

    Inspired-by: Satyam Sharma
    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joel Becker
     
  • Configfs being based upon sysfs code, config_group_find_obj() is probably
    so named because of the similar kset_find_obj() in sysfs. However,
    "kobject"s in sysfs become "config_item"s in configfs, so let's call it
    config_group_find_item() instead, for sake of uniformity, and make
    corresponding change in the users of this function.

    BTW a crucial difference between kset_find_obj and config_group_find_item
    is in locking expectations. kset_find_obj does its locking by itself, but
    config_group_find_item expects the *caller* to do the locking. The reason
    for this: kset's have their own locks, config_group's don't but instead
    rely on the subsystem mutex. And, subsystem needn't necessarily be around
    when config_group_find_item() is called.

    So let's state these locking semantics explicitly, and rectify the comment,
    otherwise bugs could continue to occur in future, as they did in the past
    (refer commit d82b8191e238 in gfs2-2.6-fixes.git).

    [ I also took the opportunity to fix some bad whitespace and
    double-empty lines. --Joel ]

    [ Conflict in fs/dlm/config.c with commit
    3168b0780d06ace875696f8a648d04d6089654e5 manually resolved. --Mark ]

    Signed-off-by: Satyam Sharma
    Cc: David Teigland
    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Satyam Sharma
     
  • fs/dlm/config.c contains a useful generic macro called __CONFIGFS_ATTR
    that is similar to sysfs' __ATTR macro that makes defining attributes
    easy for any user of configfs. Separate it out into configfs.h so that
    other users (forthcoming in dynamic netconsole patchset) can use it too.

    Signed-off-by: Satyam Sharma
    Cc: David Teigland
    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Satyam Sharma
     

09 Jul, 2007

4 commits

  • Display the initial value of the "protocol" config value in configfs.
    The default value has always been 0 in the past anyway, so it's always
    appeared to be correct.

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

    David Teigland
     
  • Various fixes related to the new timeout feature:
    - add_timeout() missed setting TIMEWARN flag on lkb's when the
    TIMEOUT flag was already set
    - clear_proc_locks should remove a dead process's locks from the
    timeout list
    - the end-of-life calculation for user locks needs to consider that
    ETIMEDOUT is equivalent to -DLM_ECANCEL
    - make initial default timewarn_cs config value visible in configfs
    - change bit position of TIMEOUT_CANCEL flag so it's not copied to
    a remote master node
    - set timestamp on remote lkb's so a lock dump will display the time
    they've been waiting

    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
     
  • Fix two races in fs/dlm/config.c:

    (1) Grab the configfs subsystem semaphore before calling
    config_group_find_obj() in get_space(). This solves a potential race
    between get_space() and concurrent mkdir(2) or rmdir(2).

    (2) Grab a reference on the found config_item _while_ holding the configfs
    subsystem semaphore in get_comm(), and not after it. This solves a
    potential race between get_comm() and concurrent rmdir(2).

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

    Satyam Sharma
     

01 May, 2007

1 commit

  • This patch consolidates the TCP & SCTP protocols for the DLM into a single file
    and makes it switchable at run-time (well, at least before the DLM actually
    starts up!)

    For RHEL5 this patch requires Neil Horman's patch that expands the in-kernel
    socket API but that has already been twice ACKed so it should be OK.

    The patch adds a new lowcomms.c file that replaces the existing lowcomms-sctp.c
    & lowcomms-tcp.c files.

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

    Patrick Caulfield
     

06 Feb, 2007

3 commits


28 Apr, 2006

1 commit


20 Jan, 2006

1 commit


18 Jan, 2006

1 commit

  • This is the core of the distributed lock manager which is required
    to use GFS2 as a cluster filesystem. It is also used by CLVM and
    can be used as a standalone lock manager independantly of either
    of these two projects.

    It implements VAX-style locking modes.

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

    David Teigland