24 Sep, 2010

1 commit

  • While umounting, a block mle doesn't get freed if dlm is shutdown after
    master request is received but before assert master. This results in unclean
    shutdown of dlm domain.

    This patch frees all mles that lie around after other nodes were notified about
    exiting the dlm and marking dlm state as leaving. Only block mles are expected
    to be around, so we log ERROR for other mles but still free them.

    Signed-off-by: Srinivas Eeda
    Signed-off-by: Joel Becker

    Srinivas Eeda
     

13 Jul, 2010

1 commit

  • This function is only called from one place and it's like this:
    dlm_register_domain(conn->cc_name, dlm_key, &fs_version);

    The "conn->cc_name" is 64 characters long. If strlen(conn->cc_name)
    were equal to O2NM_MAX_NAME_LEN (64) that would be a bug because
    strlen() doesn't count the NULL character.

    In fact, if you look how O2NM_MAX_NAME_LEN is used, it mostly describes
    64 character buffers. The only exception is nd_name from struct
    o2nm_node.

    Anyway I looked into it and in this case the domain string comes from
    osb->uuid_str in ocfs2_setup_osb_uuid(). That's 32 characters and NULL
    which easily fits into O2NM_MAX_NAME_LEN. This patch doesn't change how
    the code works, but I think it makes the code a little cleaner.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Joel Becker

    Dan Carpenter
     

16 Jun, 2010

1 commit

  • Add a spin_unlock missing on the error path. Unlock as in the other code
    that leads to the leave label.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression E1;
    @@

    * spin_lock(E1,...);

    * spin_unlock(E1,...);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Joel Becker

    Julia Lawall
     

19 May, 2010

1 commit

  • Use kstrdup when the goal of an allocation is copy a string into the
    allocated region.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to;
    expression flag,E1,E2;
    statement S;
    @@

    - to = kmalloc(strlen(from) + 1,flag);
    + to = kstrdup(from, flag);
    ... when != \(from = E1 \| to = E1 \)
    if (to==NULL || ...) S
    ... when != \(from = E2 \| to = E2 \)
    - strcpy(to, from);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Joel Becker

    Julia Lawall
     

06 May, 2010

2 commits


26 Jan, 2010

1 commit


24 Sep, 2009

1 commit

  • * remove asm/atomic.h inclusion from linux/utsname.h --
    not needed after kref conversion
    * remove linux/utsname.h inclusion from files which do not need it

    NOTE: it looks like fs/binfmt_elf.c do not need utsname.h, however
    due to some personality stuff it _is_ needed -- cowardly leave ELF-related
    headers and files alone.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

04 Apr, 2009

4 commits

  • This patch replaces the lockres counts that tracked the number number of
    locally and remotely mastered lockres' with a current and total count. The
    total count is the number of lockres' that have been created since the dlm
    domain was created.

    The number of locally and remotely mastered counts can be computed using
    the locking_state output.

    Signed-off-by: Sunil Mushran
    Signed-off-by: Mark Fasheh

    Sunil Mushran
     
  • The lifetime of a mle is limited to the duration of the lockres mastery
    process. While typically this lifetime is fairly short, we have noticed
    the number of mles explode under certain circumstances. This patch tracks
    the number of each different types of mles and should help us determine
    how best to speed up the mastery process.

    Signed-off-by: Sunil Mushran
    Signed-off-by: Mark Fasheh

    Sunil Mushran
     
  • With this patch, the mles are stored in a hash and not a simple list.
    This should improve the mle lookup time when the number of outstanding
    masteries is large.

    Signed-off-by: Sunil Mushran
    Signed-off-by: Mark Fasheh

    Sunil Mushran
     
  • This patch adds code to create and destroy the dlm->master_hash.

    Signed-off-by: Sunil Mushran
    Signed-off-by: Mark Fasheh

    Sunil Mushran
     

06 Jan, 2009

1 commit

  • This patch adds a new lock, dlm->tracking_lock, to protect adding/removing
    lockres' to/from the dlm->tracking_list. We were previously using dlm->spinlock
    for the same, but that proved inadequate as we could be freeing a lockres from
    a context that did not hold that lock. As the new lock only protects this list,
    we can explicitly take it when removing the lockres from the tracking list.

    This bug was exposed when testing multiple processes concurrently flock() the
    same file.

    Signed-off-by: Sunil Mushran
    Signed-off-by: Mark Fasheh

    Sunil Mushran
     

18 Apr, 2008

5 commits


11 Mar, 2008

2 commits

  • struct dlm_query_join_packet is made up of four one-byte fields. They
    are effectively in big-endian order already. However, little-endian
    machines swap them before putting the packet on the wire (because
    query_join's response is a status, and that status is treated as a u32
    on the wire). Thus, a big-endian and little-endian machines will
    treat this structure differently.

    The solution is to have little-endian machines swap the structure when
    converting from the structure to the u32 representation.

    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joel Becker
     
  • fs/ocfs2/dlm/dlmdomain.c: In function 'dlm_send_join_cancels':
    fs/ocfs2/dlm/dlmdomain.c:983: warning: format '%u' expects type 'unsigned int', but argument 7 has type 'long unsigned int'

    Signed-off-by: Andrew Morton
    Signed-off-by: Mark Fasheh

    Andrew Morton
     

07 Feb, 2008

1 commit

  • Currently, when ocfs2 nodes connect via TCP, they advertise their
    compatibility level. If the versions do not match, two nodes cannot speak
    to each other and they disconnect. As a result, this provides no forward or
    backwards compatibility.

    This patch implements a simple protocol negotiation at the dlm level by
    introducing a major/minor version number scheme for entities that
    communicate. Specifically, o2dlm has a major/minor version for interaction
    with o2dlm on other nodes, and ocfs2 itself has a major/minor version for
    interacting with the filesystem on other nodes.

    This will allow rolling upgrades of ocfs2 clusters when changes to the
    locking or network protocols can be done in a backwards compatible manner.
    In those cases, only the minor number is changed and the negotatied protocol
    minor is returned from dlm join. In the far less likely event that a
    required protocol change makes backwards compatibility impossible, we simply
    bump the major number.

    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joel Becker
     

11 Jul, 2007

1 commit

  • ocfs2 mounts require a heartbeat region. Use the new configfs_depend_item()
    facility to actually depend on them so they can't go away from under us.

    First, teach cluster/nodemanager.c to depend an item on the o2cb subsystem.
    Then teach o2hb_register_callbacks to take a UUID and depend on the
    appropriate region. Finally, teach all users of o2hb to pass a UUID or
    NULL if they don't require a pin.

    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joel Becker
     

27 Apr, 2007

2 commits


27 Mar, 2007

2 commits


08 Feb, 2007

6 commits

  • Currently the ocfs2 dlm has no timeout during dlm join domain. While this is
    not a problem in normal operation, this does become an issue if, say, the
    other node is refusing to let the node join the domain because of a stuck
    recovery. This patch adds a 90 sec timeout.

    Signed-off-by: Sunil Mushran
    Signed-off-by: Mark Fasheh

    Sunil Mushran
     
  • These messages can easily be activated using the mlog infrastructure
    and don't need to be enabled by default.

    Signed-off-by: Sunil Mushran
    Signed-off-by: Mark Fasheh

    Sunil Mushran
     
  • There is a small window where a joining node may not see the node(s) that
    just died but are still part of the domain. To fix this, we must disallow
    join requests if the joining node has a different node map.

    A new field node_map is added to dlm_query_join_request to send the current
    nodes nodemap along with join request. On the receiving end the nodes that
    are part of the cluster verifies if this new node sees all the nodes that
    are still part of the cluster. They disallow the join if the maps mismatch.

    Signed-off-by: Srinivas Eeda
    Signed-off-by: Mark Fasheh

    Srinivas Eeda
     
  • This patch prevents the dlm from sending the clear refmap message
    before the set refmap. We use the newly created post function handler
    routine to accomplish the task.

    Signed-off-by: Kurt Hackel
    Signed-off-by: Sunil Mushran
    Signed-off-by: Mark Fasheh

    Kurt Hackel
     
  • Currently o2net allows one handler function per message type. This
    patch adds the ability to call another function to be called after
    the handler has returned the message to the other node.

    Handlers are now given the option of returning a context (in the form of a
    void **) which will be passed back into the post message handler function.

    Signed-off-by: Kurt Hackel
    Signed-off-by: Sunil Mushran
    Signed-off-by: Mark Fasheh

    Kurt Hackel
     
  • This was previously broken and migration of some locks had to be temporarily
    disabled. We use a new (and backward-incompatible) set of network messages
    to account for all references to a lock resources held across the cluster.
    once these are all freed, the master node may then free the lock resource
    memory once its local references are dropped.

    Signed-off-by: Kurt Hackel
    Signed-off-by: Mark Fasheh

    Kurt Hackel
     

14 Dec, 2006

1 commit

  • All kcalloc() calls of the form "kcalloc(1,...)" are converted to the
    equivalent kzalloc() calls, and a few kcalloc() calls with the incorrect
    ordering of the first two arguments are fixed.

    Signed-off-by: Robert P. J. Day
    Cc: Jeff Garzik
    Cc: Alan Cox
    Cc: Dominik Brodowski
    Cc: Adam Belay
    Cc: James Bottomley
    Cc: Greg KH
    Cc: Mark Fasheh
    Cc: Trond Myklebust
    Cc: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     

06 Dec, 2006

1 commit


02 Dec, 2006

1 commit


22 Nov, 2006

1 commit


30 Jun, 2006

1 commit


28 Jun, 2006

1 commit

  • locking init cleanups:

    - convert " = SPIN_LOCK_UNLOCKED" to spin_lock_init() or DEFINE_SPINLOCK()
    - convert rwlocks in a similar manner

    this patch was generated automatically.

    Motivation:

    - cleanliness
    - lockdep needs control of lock initialization, which the open-coded
    variants do not give
    - it's also useful for -rt and for lock debugging in general

    Signed-off-by: Ingo Molnar
    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

27 Jun, 2006

2 commits