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

2 commits

  • The rwlock is almost always used in write mode, so there's no reason
    to not use a spinlock instead.

    Signed-off-by: David Teigland

    David Teigland
     
  • The old code would leak iterators and leave reference counts on
    rsbs because it was ignoring the "stop" seq callback. The code
    followed an example that used the seq operations differently.
    This new code is based on actually understanding how the seq
    operations work. It also improves things by saving the hash bucket
    in the position to avoid cycling through completed buckets in start.

    Siged-off-by: Davd Teigland

    David Teigland
     

06 Jan, 2009

1 commit


24 Dec, 2008

10 commits

  • fs/dlm/ast.c: In function 'dlm_astd':
    fs/dlm/ast.c:64: warning: 'bastmode' may be used uninitialized in this function

    Cleans code up.

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

    Andrew Morton
     
  • The new debugfs entry dumps all rsb and lkb structures, and includes
    a lot more information than has been available before. This includes
    the new timestamps added by a previous patch for debugging callback
    issues.

    Signed-off-by: David Teigland

    David Teigland
     
  • Record the time the latest blocking callback was queued for
    a lock. This will be used for debugging in combination with
    lock queue timestamp changes in the previous patch.

    Signed-off-by: David Teigland

    David Teigland
     
  • Use ktime instead of jiffies for timestamping lkb's. Also stamp the
    time on every lkb whenever it's added to a resource queue, instead of
    just stamping locks subject to timeouts. This will allow us to use
    timestamps more widely for debugging all locks.

    Signed-off-by: David Teigland

    David Teigland
     
  • The lkb bastmode value is set in the context of processing the
    lock, and read by the dlm_astd thread. Because it's accessed
    in these two separate contexts, the writing/reading ought to
    be done under a lock. This is simple to do by setting it and
    reading it when the lkb is added to and removed from dlm_astd's
    callback list which is properly locked.

    Signed-off-by: David Teigland

    David Teigland
     
  • Just before delivering a blocking callback (bast), the dlm_astd
    thread checks again that the granted mode of the lkb actually
    blocks the mode requested by the bast. The idea behind this was
    originally that the granted mode may have changed since the bast
    was queued, making the callback now unnecessary. Reasons for
    removing this extra check are:
    - dlm_astd doesn't lock the rsb before reading the lkb grmode, so
    it's not technically safe (this removes the long standing FIXME)
    - after running some tests, it doesn't appear the check ever actually
    eliminates a bast
    - delivering an unnecessary blocking callback isn't a bad thing and
    can happen anyway

    Signed-off-by: David Teigland

    David Teigland
     
  • This is a one-liner to use cond_resched() rather than schedule()
    in the ast delivery loop. It should not be necessary to schedule
    every time, so this will save some cpu time while continuing to
    allow scheduling when required.

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

    Steven Whitehouse
     
  • The pages used in lowcomms are not highmem, so kmap is not necessary.

    Cc: Christine Caulfield
    Signed-off-by: Steven Whitehouse
    Signed-off-by: David Teigland

    Steven Whitehouse
     
  • fs/dlm/dir.c:419:14: warning: incorrect type in assignment (different base types)
    fs/dlm/dir.c:419:14: expected unsigned short [unsigned] [addressable] [assigned] [usertype] be_namelen
    fs/dlm/dir.c:419:14: got restricted __be16 [usertype]

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

    Harvey Harrison
     
  • Use ls_allocation for memory allocations, which a cluster fs sets to
    GFP_NOFS. Use GFP_NOFS for allocations when no lockspace struct is
    available. Taking dlm locks needs to avoid calling back into the
    cluster fs because write-out can require taking dlm locks.

    Cc: Christine Caulfield
    Signed-off-by: Steven Whitehouse
    Signed-off-by: David Teigland

    Steven Whitehouse
     

26 Nov, 2008

1 commit

  • this warning:

    fs/dlm/netlink.c: In function ‘dlm_timeout_warn’:
    fs/dlm/netlink.c:131: warning: ‘send_skb’ may be used uninitialized in this function

    triggers because GCC does not recognize the (correct) error flow
    between prepare_data() and send_skb.

    Annotate it.

    Signed-off-by: Ingo Molnar
    Signed-off-by: David S. Miller

    Ingo Molnar
     

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