1. 17 11月, 2012 1 次提交
    • D
      dlm: fix lvb invalidation conditions · da8c6663
      David Teigland 提交于
      When a node is removed that held a PW/EX lock, the
      existing master node should invalidate the lvb on the
      resource due to the purged lock.
      
      Previously, the existing master node was invalidating
      the lvb if it found only NL/CR locks on the resource
      during recovery for the removed node.  This could lead
      to cases where it invalidated the lvb and shouldn't
      have, or cases where it should have invalidated and
      didn't.
      
      When recovery selects a *new* master node for a
      resource, and that new master finds only NL/CR locks
      on the resource after lock recovery, it should
      invalidate the lvb.  This case was handled correctly
      (but was incorrectly applied to the existing master
      case also.)
      
      When a process exits while holding a PW/EX lock,
      the lvb on the resource should be invalidated.
      This was not happening.
      
      The lvb contents and VALNOTVALID flag should be
      recovered before granting locks in recovery so that
      the recovered lvb state is provided in the callback.
      The lvb was being recovered after the lock was granted.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      da8c6663
  2. 02 11月, 2012 2 次提交
  3. 11 9月, 2012 1 次提交
  4. 10 9月, 2012 1 次提交
  5. 13 8月, 2012 1 次提交
  6. 10 8月, 2012 2 次提交
  7. 09 8月, 2012 3 次提交
    • D
      dlm: fix unlock balance warnings · 475f230c
      David Teigland 提交于
      The in_recovery rw_semaphore has always been acquired and
      released by different threads by design.  To work around
      the "BUG: bad unlock balance detected!" messages, adjust
      things so the dlm_recoverd thread always does both down_write
      and up_write.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      475f230c
    • D
      dlm: fix uninitialized spinlock · 6ad22916
      David Teigland 提交于
      Use DEFINE_SPINLOCK for global dlm_cb_seq_spin.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      6ad22916
    • D
      dlm: fix deadlock between dlm_send and dlm_controld · 36b71a8b
      David Teigland 提交于
      A deadlock sometimes occurs between dlm_controld closing
      a lowcomms connection through configfs and dlm_send looking
      up the address for a new connection in configfs.
      
      dlm_controld does a configfs rmdir which calls
      dlm_lowcomms_close which waits for dlm_send to
      cancel work on the workqueues.
      
      The dlm_send workqueue thread has called
      tcp_connect_to_sock which calls dlm_nodeid_to_addr
      which does a configfs lookup and blocks on a lock
      held by dlm_controld in the rmdir path.
      
      The solution here is to save the node addresses within
      the lowcomms code so that the lowcomms workqueue does
      not need to step through configfs to get a node address.
      
      dlm_controld:
      wait_for_completion+0x1d/0x20
      __cancel_work_timer+0x1b3/0x1e0
      cancel_work_sync+0x10/0x20
      dlm_lowcomms_close+0x4c/0xb0 [dlm]
      drop_comm+0x22/0x60 [dlm]
      client_drop_item+0x26/0x50 [configfs]
      configfs_rmdir+0x180/0x230 [configfs]
      vfs_rmdir+0xbd/0xf0
      do_rmdir+0x103/0x120
      sys_rmdir+0x16/0x20
      
      dlm_send:
      mutex_lock+0x2b/0x50
      get_comm+0x34/0x140 [dlm]
      dlm_nodeid_to_addr+0x18/0xd0 [dlm]
      tcp_connect_to_sock+0xf4/0x2d0 [dlm]
      process_send_sockets+0x1d2/0x260 [dlm]
      worker_thread+0x170/0x2a0
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      36b71a8b
  8. 17 7月, 2012 6 次提交
    • D
      dlm: fix missing dir remove · 96006ea6
      David Teigland 提交于
      I don't know exactly how, but in some cases, a dir
      record is not removed, or a new one is created when
      it shouldn't be.  The result is that the dir node
      lookup returns a master node where the rsb does not
      exist.  In this case, The master node will repeatedly
      return -EBADR for requests, and the lock requests will
      be stuck.
      
      Until all possible ways for this to happen can be
      eliminated, a simple and effective way to recover from
      this situation is for the supposed master node to send
      a standard remove message to the dir node when it
      receives a request for a resource it has no rsb for.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      96006ea6
    • D
      dlm: fix conversion deadlock from recovery · c503a621
      David Teigland 提交于
      The process of rebuilding locks on a new master during
      recovery could re-order the locks on the convert queue,
      creating an "in place" conversion deadlock that would
      not be resolved.  Fix this by not considering queue
      order when granting conversions after recovery.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      c503a621
    • D
      dlm: use wait_event_timeout · 6d768177
      David Teigland 提交于
      Use wait_event_timeout to avoid using a timer
      directly.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      6d768177
    • D
      dlm: fix race between remove and lookup · 05c32f47
      David Teigland 提交于
      It was possible for a remove message on an old
      rsb to be sent after a lookup message on a new
      rsb, where the rsbs were for the same resource
      name.  This could lead to a missing directory
      entry for the new rsb.
      
      It is fixed by keeping a copy of the resource
      name being removed until after the remove has
      been sent.  A lookup checks if this in-progress
      remove matches the name it is looking up.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      05c32f47
    • D
      dlm: use idr instead of list for recovered rsbs · 1d7c484e
      David Teigland 提交于
      When a large number of resources are being recovered,
      a linear search of the recover_list takes a long time.
      Use an idr in place of a list.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      1d7c484e
    • D
      dlm: use rsbtbl as resource directory · c04fecb4
      David Teigland 提交于
      Remove the dir hash table (dirtbl), and use
      the rsb hash table (rsbtbl) as the resource
      directory.  It has always been an unnecessary
      duplication of information.
      
      This improves efficiency by using a single rsbtbl
      lookup in many cases where both rsbtbl and dirtbl
      lookups were needed previously.
      
      This eliminates the need to handle cases of rsbtbl
      and dirtbl being out of sync.
      
      In many cases there will be memory savings because
      the dir hash table no longer exists.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      c04fecb4
  9. 15 5月, 2012 1 次提交
  10. 03 5月, 2012 1 次提交
    • D
      dlm: fixes for nodir mode · 4875647a
      David Teigland 提交于
      The "nodir" mode (statically assign master nodes instead
      of using the resource directory) has always been highly
      experimental, and never seriously used.  This commit
      fixes a number of problems, making nodir much more usable.
      
      - Major change to recovery: recover all locks and restart
        all in-progress operations after recovery.  In some
        cases it's not possible to know which in-progess locks
        to recover, so recover all.  (Most require recovery
        in nodir mode anyway since rehashing changes most
        master nodes.)
      
      - Change the way nodir mode is enabled, from a command
        line mount arg passed through gfs2, into a sysfs
        file managed by dlm_controld, consistent with the
        other config settings.
      
      - Allow recovering MSTCPY locks on an rsb that has not
        yet been turned into a master copy.
      
      - Ignore RCOM_LOCK and RCOM_LOCK_REPLY recovery messages
        from a previous, aborted recovery cycle.  Base this
        on the local recovery status not being in the state
        where any nodes should be sending LOCK messages for the
        current recovery cycle.
      
      - Hold rsb lock around dlm_purge_mstcpy_locks() because it
        may run concurrently with dlm_recover_master_copy().
      
      - Maintain highbast on process-copy lkb's (in addition to
        the master as is usual), because the lkb can switch
        back and forth between being a master and being a
        process copy as the master node changes in recovery.
      
      - When recovering MSTCPY locks, flag rsb's that have
        non-empty convert or waiting queues for granting
        at the end of recovery.  (Rename flag from LOCKS_PURGED
        to RECOVER_GRANT and similar for the recovery function,
        because it's not only resources with purged locks
        that need grant a grant attempt.)
      
      - Replace a couple of unnecessary assertion panics with
        error messages.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      4875647a
  11. 27 4月, 2012 5 次提交
  12. 24 4月, 2012 1 次提交
  13. 06 4月, 2012 1 次提交
    • S
      simple_open: automatically convert to simple_open() · 234e3405
      Stephen Boyd 提交于
      Many users of debugfs copy the implementation of default_open() when
      they want to support a custom read/write function op.  This leads to a
      proliferation of the default_open() implementation across the entire
      tree.
      
      Now that the common implementation has been consolidated into libfs we
      can replace all the users of this function with simple_open().
      
      This replacement was done with the following semantic patch:
      
      <smpl>
      @ open @
      identifier open_f != simple_open;
      identifier i, f;
      @@
      -int open_f(struct inode *i, struct file *f)
      -{
      (
      -if (i->i_private)
      -f->private_data = i->i_private;
      |
      -f->private_data = i->i_private;
      )
      -return 0;
      -}
      
      @ has_open depends on open @
      identifier fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...
      -.open = open_f,
      +.open = simple_open,
      ...
      };
      </smpl>
      
      [akpm@linux-foundation.org: checkpatch fixes]
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      234e3405
  14. 21 3月, 2012 1 次提交
  15. 09 3月, 2012 2 次提交
  16. 04 1月, 2012 3 次提交
    • D
      dlm: add recovery callbacks · 60f98d18
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      60f98d18
    • D
      dlm: add node slots and generation · 757a4271
      David Teigland 提交于
      Slot numbers are assigned to nodes when they join the lockspace.
      The slot number chosen is the minimum unused value starting at 1.
      Once a node is assigned a slot, that slot number will not change
      while the node remains a lockspace member.  If the node leaves
      and rejoins it can be assigned a new slot number.
      
      A new generation number is also added to a lockspace.  It is
      set and incremented during each recovery along with the slot
      collection/assignment.
      
      The slot numbers will be passed to gfs2 which will use them as
      journal id's.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      757a4271
    • D
      dlm: move recovery barrier calls · f95a34c6
      David Teigland 提交于
      Put all the calls to recovery barriers in the same function
      to clarify where they each happen.  Should not change any behavior.
      Also modify some recovery debug lines to make them consistent.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      f95a34c6
  17. 23 11月, 2011 1 次提交
  18. 19 11月, 2011 1 次提交
  19. 21 7月, 2011 1 次提交
    • J
      locks: rename lock-manager ops · 8fb47a4f
      J. Bruce Fields 提交于
      Both the filesystem and the lock manager can associate operations with a
      lock.  Confusingly, one of them (fl_release_private) actually has the
      same name in both operation structures.
      
      It would save some confusion to give the lock-manager ops different
      names.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      8fb47a4f
  20. 20 7月, 2011 1 次提交
  21. 16 7月, 2011 1 次提交
  22. 15 7月, 2011 1 次提交
  23. 13 7月, 2011 1 次提交
    • D
      dlm: improve rsb searches · 3881ac04
      David Teigland 提交于
      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: NDavid Teigland <teigland@redhat.com>
      3881ac04
  24. 11 7月, 2011 1 次提交