1. 18 Nov, 2010 5 commits
    • dann frazier's avatar
      ocfs2_connection_find() returns pointer to bad structure · 226291aa
      dann frazier authored
      
      
      If ocfs2_live_connection_list is empty, ocfs2_connection_find() will return
      a pointer to the LIST_HEAD, cast as a ocfs2_live_connection. This can cause
      an oops when ocfs2_control_send_down() dereferences c->oc_conn:
      
      Call Trace:
        [<ffffffffa00c2a3c>] ocfs2_control_message+0x28c/0x2b0 [ocfs2_stack_user]
        [<ffffffffa00c2a95>] ocfs2_control_write+0x35/0xb0 [ocfs2_stack_user]
        [<ffffffff81143a88>] vfs_write+0xb8/0x1a0
        [<ffffffff8155cc13>] ? do_page_fault+0x153/0x3b0
        [<ffffffff811442f1>] sys_write+0x51/0x80
        [<ffffffff810121b2>] system_call_fastpath+0x16/0x1b
      
      Fix by explicitly returning NULL if no match is found.
      Signed-off-by: default avatardann frazier <dann.frazier@canonical.com>
      Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
      226291aa
    • Milton Miller's avatar
      ocfs2: char is not always signed · a2a2f552
      Milton Miller authored
      Commit 1c66b360
      
       (Change some lock status member in ocfs2_lock_res
      to char.)  states that these fields need to be signed due to comparision
      to -1, but only changed the type from unsigned char to char.   However, it
      is a compiler option if char is a signed or unsigned type.  Change these
      fields to signed char so the code will work with all compilers.
      Signed-off-by: default avatarMilton Miller <miltonm@bga.com>
      Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
      a2a2f552
    • Tristan Ye's avatar
      Ocfs2: Stop tracking a negative dentry after dentry_iput(). · 1989a80a
      Tristan Ye authored
      I suddenly hit the problem during 2.6.37-rc1 regression test, which was
      introduced by commit '5e98d492
      
      '(Track
      negative entries v3), following scenario reproduces the issue easily:
      
      Node A			Node B
      ================	============
      $touch 	testfile
      			$ls testfile
      $rm -rf testfile
      $touch 	testfile
      			$ls testfile
      			ls: cannot access testfile: No such file or directory
      
      This patch stops tracking the dentry which was negativated by a inode deletion,
      so as to force the revaliation in next lookup, in case we'll touch the inode
      again in the same node.
      
      It didn't hurt the performance of multiple lookup for none-existed files anyway,
      while regresses a bit in the first try after a file deletion.
      Signed-off-by: default avatarTristan Ye <tristan.ye@oracle.com>
      Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
      1989a80a
    • Jiri Slaby's avatar
      ocfs2: fix memory leak · 1cf257f5
      Jiri Slaby authored
      
      
      Stanse found that o2hb_heartbeat_group_make_item leaks some memory on
      fail paths. Fix the paths by adding a new label and jump there.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <joel.becker@oracle.com>
      Cc: ocfs2-devel@oss.oracle.com
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: linux-fsdevel@vger.kernel.org
      Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
      1cf257f5
    • David Sterba's avatar
      fs/ocfs2/dlm: Use GFP_ATOMIC under spin_lock · a48a982a
      David Sterba authored
      
      
      coccinelle check scripts/coccinelle/locks/call_kern.cocci found that
      in fs/ocfs2/dlm/dlmdomain.c an allocation with GFP_KERNEL is done
      with locks held:
      
      dlm_query_region_handler
        spin_lock(dlm_domain_lock)
          dlm_match_regions
            kmalloc(GFP_KERNEL)
      
      Change it to GFP_ATOMIC.
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
      CC: Joel Becker <joel.becker@oracle.com>
      CC: Mark Fasheh <mfasheh@suse.com>
      CC: ocfs2-devel@oss.oracle.com
      
      --
      Exists in v2.6.37-rc1 and current linux-next.
      Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
      a48a982a
  2. 17 Nov, 2010 1 commit
  3. 13 Nov, 2010 1 commit
  4. 29 Oct, 2010 2 commits
  5. 25 Oct, 2010 3 commits
  6. 22 Oct, 2010 1 commit
  7. 15 Oct, 2010 3 commits
    • Jeff Liu's avatar
      ocfs2: Avoid to evaluate xattr block flags again. · 2decd65a
      Jeff Liu authored
      
      
      It was evaludated to indexed before, check it is ok i think.
      Signed-off-by: default avatarJeff Liu <jeff.liu@oracle.com>
      Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
      2decd65a
    • Sunil Mushran's avatar
      · d4396eaf
      Sunil Mushran authored
      
      ocfs2/cluster: Release debugfs file elapsed_time_in_ms
      
      An earlier commit forgot to remove a debugfs file, elapsed_time_in_ms.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      d4396eaf
    • Arnd Bergmann's avatar
      llseek: automatically add .llseek fop · 6038f373
      Arnd Bergmann authored
      
      
      All file_operations should get a .llseek operation so we can make
      nonseekable_open the default for future file operations without a
      .llseek pointer.
      
      The three cases that we can automatically detect are no_llseek, seq_lseek
      and default_llseek. For cases where we can we can automatically prove that
      the file offset is always ignored, we use noop_llseek, which maintains
      the current behavior of not returning an error from a seek.
      
      New drivers should normally not use noop_llseek but instead use no_llseek
      and call nonseekable_open at open time.  Existing drivers can be converted
      to do the same when the maintainer knows for certain that no user code
      relies on calling seek on the device file.
      
      The generated code is often incorrectly indented and right now contains
      comments that clarify for each added line why a specific variant was
      chosen. In the version that gets submitted upstream, the comments will
      be gone and I will manually fix the indentation, because there does not
      seem to be a way to do that using coccinelle.
      
      Some amount of new code is currently sitting in linux-next that should get
      the same modifications, which I will do at the end of the merge window.
      
      Many thanks to Julia Lawall for helping me learn to write a semantic
      patch that does all this.
      
      ===== begin semantic patch =====
      // This adds an llseek= method to all file operations,
      // as a preparation for making no_llseek the default.
      //
      // The rules are
      // - use no_llseek explicitly if we do nonseekable_open
      // - use seq_lseek for sequential files
      // - use default_llseek if we know we access f_pos
      // - use noop_llseek if we know we don't access f_pos,
      //   but we still want to allow users to call lseek
      //
      @ open1 exists @
      identifier nested_open;
      @@
      nested_open(...)
      {
      <+...
      nonseekable_open(...)
      ...+>
      }
      
      @ open exists@
      identifier open_f;
      identifier i, f;
      identifier open1.nested_open;
      @@
      int open_f(struct inode *i, struct file *f)
      {
      <+...
      (
      nonseekable_open(...)
      |
      nested_open(...)
      )
      ...+>
      }
      
      @ read disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      <+...
      (
         *off = E
      |
         *off += E
      |
         func(..., off, ...)
      |
         E = *off
      )
      ...+>
      }
      
      @ read_no_fpos disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ write @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      <+...
      (
        *off = E
      |
        *off += E
      |
        func(..., off, ...)
      |
        E = *off
      )
      ...+>
      }
      
      @ write_no_fpos @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ fops0 @
      identifier fops;
      @@
      struct file_operations fops = {
       ...
      };
      
      @ has_llseek depends on fops0 @
      identifier fops0.fops;
      identifier llseek_f;
      @@
      struct file_operations fops = {
      ...
       .llseek = llseek_f,
      ...
      };
      
      @ has_read depends on fops0 @
      identifier fops0.fops;
      identifier read_f;
      @@
      struct file_operations fops = {
      ...
       .read = read_f,
      ...
      };
      
      @ has_write depends on fops0 @
      identifier fops0.fops;
      identifier write_f;
      @@
      struct file_operations fops = {
      ...
       .write = write_f,
      ...
      };
      
      @ has_open depends on fops0 @
      identifier fops0.fops;
      identifier open_f;
      @@
      struct file_operations fops = {
      ...
       .open = open_f,
      ...
      };
      
      // use no_llseek if we call nonseekable_open
      ////////////////////////////////////////////
      @ nonseekable1 depends on !has_llseek && has_open @
      identifier fops0.fops;
      identifier nso ~= "nonseekable_open";
      @@
      struct file_operations fops = {
      ...  .open = nso, ...
      +.llseek = no_llseek, /* nonseekable */
      };
      
      @ nonseekable2 depends on !has_llseek @
      identifier fops0.fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...  .open = open_f, ...
      +.llseek = no_llseek, /* open uses nonseekable */
      };
      
      // use seq_lseek for sequential files
      /////////////////////////////////////
      @ seq depends on !has_llseek @
      identifier fops0.fops;
      identifier sr ~= "seq_read";
      @@
      struct file_operations fops = {
      ...  .read = sr, ...
      +.llseek = seq_lseek, /* we have seq_read */
      };
      
      // use default_llseek if there is a readdir
      ///////////////////////////////////////////
      @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier readdir_e;
      @@
      // any other fop is used that changes pos
      struct file_operations fops = {
      ... .readdir = readdir_e, ...
      +.llseek = default_llseek, /* readdir is present */
      };
      
      // use default_llseek if at least one of read/write touches f_pos
      /////////////////////////////////////////////////////////////////
      @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read.read_f;
      @@
      // read fops use offset
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = default_llseek, /* read accesses f_pos */
      };
      
      @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ... .write = write_f, ...
      +	.llseek = default_llseek, /* write accesses f_pos */
      };
      
      // Use noop_llseek if neither read nor write accesses f_pos
      ///////////////////////////////////////////////////////////
      
      @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      identifier write_no_fpos.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ...
       .write = write_f,
       .read = read_f,
      ...
      +.llseek = noop_llseek, /* read and write both use no f_pos */
      };
      
      @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write_no_fpos.write_f;
      @@
      struct file_operations fops = {
      ... .write = write_f, ...
      +.llseek = noop_llseek, /* write uses no f_pos */
      };
      
      @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      @@
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = noop_llseek, /* read uses no f_pos */
      };
      
      @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      @@
      struct file_operations fops = {
      ...
      +.llseek = noop_llseek, /* no read or write fn */
      };
      ===== End semantic patch =====
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: Christoph Hellwig <hch@infradead.org>
      6038f373
  8. 11 Oct, 2010 4 commits
  9. 09 Oct, 2010 1 commit
  10. 06 Oct, 2010 4 commits
    • Sunil Mushran's avatar
      · 43695d09
      Sunil Mushran authored
      
      ocfs2/cluster: Show per region heartbeat elapsed time
      
      This patch adds a per region debugfs file that shows the elapsed time
      since the time the o2hb timer was last armed.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      43695d09
    • Sunil Mushran's avatar
      · d6aa1c7c
      Sunil Mushran authored
      
      ocfs2/cluster: Add mlogs for heartbeat up/down events
      
      This patch adds mlogs for o2hb up and down events.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      d6aa1c7c
    • Sunil Mushran's avatar
      · 1f285305
      Sunil Mushran authored
      
      ocfs2/cluster: Create debugfs dir/files for each region
      
      This patch creates debugfs directory for each o2hb region and creates
      files to expose the region number and the per region live node bitmap.
      This information will be useful in debugging cluster issues.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      1f285305
    • Sunil Mushran's avatar
      · a6de0136
      Sunil Mushran authored
      
      ocfs2/cluster: Create debugfs files for live, quorum and failed region bitmaps
      
      This patch prints the bitmaps of live, quorum and failed regions. This
      information will be useful in debugging cluster issues.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      a6de0136
  11. 07 Oct, 2010 1 commit
    • Sunil Mushran's avatar
      · b1c5ebfb
      Sunil Mushran authored
      
      ocfs2/cluster: Maintain bitmap of failed regions
      
      In global heartbeat mode, we track the bitmap of regions that have seen
      heartbeat timeouts. We fence if the number of such regions is greater than
      or equal to half the number of quorum regions.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      b1c5ebfb
  12. 06 Oct, 2010 2 commits
    • Sunil Mushran's avatar
      · 43182d2a
      Sunil Mushran authored
      
      ocfs2/cluster: Maintain bitmap of quorum regions
      
      o2hb allows online adding of regions. However, a newly added region is not
      used in quorum calculations unless it has been added on all nodes. This patch
      tracks a bitmap of such quorum regions.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      43182d2a
    • Sunil Mushran's avatar
      · e7d656ba
      Sunil Mushran authored
      
      ocfs2/cluster: Track bitmap of live heartbeat regions
      
      A heartbeat region becomes live (or active) after a fixed number of (steady)
      iterations.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      e7d656ba
  13. 07 Oct, 2010 1 commit
    • Sunil Mushran's avatar
      · 536f0741
      Sunil Mushran authored
      
      ocfs2/cluster: Track number of global heartbeat regions
      
      In global heartbeat mode, we have a upper limit for the number of active regions.
      This patch adds the facility to track the number of active global heartbeat
      regions and fails to start heartbeat if the number exceeds the maximum.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      536f0741
  14. 06 Oct, 2010 1 commit
    • Sunil Mushran's avatar
      · 823a637a
      Sunil Mushran authored
      
      ocfs2/cluster: Maintain live node bitmap per heartbeat region
      
      Currently we track a global livenode bitmap that keeps track of all nodes
      that are heartbeating in all regions.
      
      This patch adds the ability to track the livenode bitmap on a per region basis.
      We will use this facility in a later patch to allow us to withstand the loss of
      a minority number of regions.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      823a637a
  15. 07 Oct, 2010 3 commits
  16. 06 Oct, 2010 1 commit
    • Sunil Mushran's avatar
      · 18c50cb0
      Sunil Mushran authored
      
      ocfs2/cluster: Print messages when adding/removing heartbeat regions
      
      Prints messages when the user adds or removes heartbeat regions in global
      heartbeat mode. These messages are useful when debugging cluster related issues.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      18c50cb0
  17. 07 Oct, 2010 1 commit
    • Sunil Mushran's avatar
      · 18cfdf1b
      Sunil Mushran authored
      
      ocfs2/dlm: Add message DLM_QUERY_NODEINFO
      
      Adds new dlm message DLM_QUERY_NODEINFO that sends the attributes of all
      registered nodes. This message is sent if the negotiated dlm protocol is
      1.1 or higher. If the information of the joining node does not match
      that of any existing nodes, the join domain request is rejected.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      18cfdf1b
  18. 06 Oct, 2010 1 commit
    • Sunil Mushran's avatar
      · 5f3c6d9c
      Sunil Mushran authored
      
      ocfs2: Print message if user mounts without starting global heartbeat
      
      In global heartbeat mode, the heartbeat is started by the user. This patch
      prints an error if the user attempts to mount a volume without starting the
      heartbeat.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      5f3c6d9c
  19. 09 Oct, 2010 1 commit
    • Sunil Mushran's avatar
      · ea203441
      Sunil Mushran authored
      
      ocfs2/dlm: Add message DLM_QUERY_REGION
      
      Adds new dlm message DLM_QUERY_REGION that sends the names of all active
      heartbeat regions. This message is only sent in the global heartbeat
      mode. If the regions in the joining node do not fully match the ones in
      the active nodes, the join domain request is rejected.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      ea203441
  20. 07 Oct, 2010 1 commit
    • Sunil Mushran's avatar
      · b3c85c4c
      Sunil Mushran authored
      
      ocfs2/cluster: Get all heartbeat regions
      
      Export function in o2hb to get a list of heartbeat regions. It also adds an
      upper limit to the length of the heartbeat region name.
      
      o2hb_global_heartbeat_active() currently disables global heartbeat. It will
      be enabled in a later patch after all the code is added.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      b3c85c4c
  21. 06 Oct, 2010 1 commit
  22. 07 Oct, 2010 1 commit
    • Sunil Mushran's avatar
      · 2c442719
      Sunil Mushran authored
      
      ocfs2: Add support for heartbeat=global mount option
      
      Adds support for heartbeat=global mount option. It ensures that the heartbeat
      mode passed matches the one enabled on disk.
      Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
      2c442719