1. 30 7月, 2009 2 次提交
    • B
      GFS2: remove dcache entries for remote deleted inodes · b94a170e
      Benjamin Marzinski 提交于
      When a file is deleted from a gfs2 filesystem on one node, a dcache
      entry for it may still exist on other nodes in the cluster. If this
      happens, gfs2 will be unable to free this file on disk. Because of this,
      it's possible to have a gfs2 filesystem with no files on it and no free
      space. With this patch, when a node receives a callback notifying it
      that the file is being deleted on another node, it schedules a new
      workqueue thread to remove the file's dcache entry.
      Signed-off-by: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      b94a170e
    • B
      GFS2: keep statfs info in sync on grows · 1946f70a
      Benjamin Marzinski 提交于
      GFS2 wasn't syncing its statfs info on grows.  This causes a problem
      when you grow the filesystem on multiple nodes.  GFS2 would calculate
      the new space based on the resource groups (which are always current),
      and then assume that the filesystem had grown the from the existing
      statfs size.  If you grew the filesystem on two different nodes in a
      short time, the second node wouldn't see the statfs size change from the
      first node, and would assume that it was grown by a larger amount than
      it was.  When all these changes were synced out, the total fileystem
      size would be incorrect (the first grow would be counted twice).
      
      This patch syncs makes GFS2 read in the statfs changes from disk before
      a grow, and write them out after the grow, while the master statfs inode
      is locked.
      Signed-off-by: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      1946f70a
  2. 12 6月, 2009 3 次提交
  3. 22 5月, 2009 1 次提交
  4. 24 3月, 2009 2 次提交
    • S
      GFS2: Fix freeze issue · df3647b2
      Steven Whitehouse 提交于
      This removes some old code that was causing issues during
      filesystem freeze.
      Reported-by: NAndrew Price <andy@andrewprice.me.uk>
      Tested-by: NAndrew Price <andy@andrewprice.me.uk>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      df3647b2
    • S
      GFS2: Merge lock_dlm module into GFS2 · f057f6cd
      Steven Whitehouse 提交于
      This is the big patch that I've been working on for some time
      now. There are many reasons for wanting to make this change
      such as:
       o Reducing overhead by eliminating duplicated fields between structures
       o Simplifcation of the code (reduces the code size by a fair bit)
       o The locking interface is now the DLM interface itself as proposed
         some time ago.
       o Fewer lookups of glocks when processing replies from the DLM
       o Fewer memory allocations/deallocations for each glock
       o Scope to do further optimisations in the future (but this patch is
         more than big enough for now!)
      
      Please note that (a) this patch relates to the lock_dlm module and
      not the DLM itself, that is still a separate module; and (b) that
      we retain the ability to build GFS2 as a standalone single node
      filesystem with out requiring the DLM.
      
      This patch needs a lot of testing, hence my keeping it I restarted
      my -git tree after the last merge window. That way, this has the maximum
      exposure before its merged. This is (modulo a few minor bug fixes) the
      same patch that I've been posting on and off the the last three months
      and its passed a number of different tests so far.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      f057f6cd
  5. 05 1月, 2009 7 次提交
  6. 13 8月, 2008 1 次提交
    • S
      GFS2: Fix metafs mounts · 9b8df98f
      Steven Whitehouse 提交于
      This patch is intended to fix the issues reported in bz #457798. Instead
      of having the metafs as a separate filesystem, it becomes a second root
      of gfs2. As a result it will appear as type gfs2 in /proc/mounts, but it
      is still possible (for backwards compatibility purposes) to mount it as
      type gfs2meta. A new mount flag "meta" is introduced so that its possible
      to tell the two cases apart in /proc/mounts.
      
      As a result it becomes possible to mount type gfs2 with -o meta and
      get the same result as mounting type gfs2meta. So it is possible to
      mount just the metafs on its own. Currently if you do this, its then
      impossible to mount the "normal" root of the gfs2 filesystem without
      first unmounting the metafs root. I'm not sure if thats a feature or
      a bug :-)
      
      Either way, this is a great improvement on the previous scheme and I've
      verified that it works ok with bind mounts on both the "normal" root
      and the metafs root in various combinations.
      
      There were also a bunch of functions in super.c which didn't belong there,
      so this moves them into ops_fstype.c where they can be static. Hopefully
      the mount/umount sequence is now more obvious as a result.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Cc: Alexander Viro <aviro@redhat.com>
      9b8df98f
  7. 27 7月, 2008 1 次提交
  8. 10 7月, 2008 1 次提交
  9. 27 6月, 2008 1 次提交
    • S
      [GFS2] Clean up the glock core · 6802e340
      Steven Whitehouse 提交于
      This patch implements a number of cleanups to the core of the
      GFS2 glock code. As a result a lot of code is removed. It looks
      like a really big change, but actually a large part of this patch
      is either removing or moving existing code.
      
      There are some new bits too though, such as the new run_queue()
      function which is considerably streamlined. Highlights of this
      patch include:
      
       o Fixes a cluster coherency bug during SH -> EX lock conversions
       o Removes the "glmutex" code in favour of a single bit lock
       o Removes the ->go_xmote_bh() for inodes since it was duplicating
         ->go_lock()
       o We now only use the ->lm_lock() function for both locks and
         unlocks (i.e. unlock is a lock with target mode LM_ST_UNLOCKED)
       o The fast path is considerably shortly, giving performance gains
         especially with lock_nolock
       o The glock_workqueue is now used for all the callbacks from the DLM
         which allows us to simplify the lock_dlm module (see following patch)
       o The way is now open to make further changes such as eliminating the two
         threads (gfs2_glockd and gfs2_scand) in favour of a more efficient
         scheme.
      
      This patch has undergone extensive testing with various test suites
      so it should be pretty stable by now.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Cc: Bob Peterson <rpeterso@redhat.com>
      6802e340
  10. 10 4月, 2008 1 次提交
  11. 31 3月, 2008 1 次提交
    • S
      [GFS2] Streamline indirect pointer tree height calculation · ecc30c79
      Steven Whitehouse 提交于
      This patch improves the calculation of the tree height in order to reduce
      the number of operations which are carried out on each call to gfs2_block_map.
      In the common case, we now make a single comparison, rather than calculating
      the required tree height from scratch each time. Also in the case that the
      tree does need some extra height, we start from the current height rather from
      zero when we work out what the new height ought to be.
      
      In addition the di_height field is moved into the inode proper and reduced
      in size to a u8 since the value must be between 0 and GFS2_MAX_META_HEIGHT (10).
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      ecc30c79
  12. 25 1月, 2008 7 次提交
  13. 12 10月, 2007 1 次提交
  14. 10 10月, 2007 2 次提交
  15. 09 7月, 2007 2 次提交
    • S
      [GFS2] Fix sign problem in quota/statfs and cleanup _host structures · bb8d8a6f
      Steven Whitehouse 提交于
      This patch fixes some sign issues which were accidentally introduced
      into the quota & statfs code during the endianess annotation process.
      Also included is a general clean up which moves all of the _host
      structures out of gfs2_ondisk.h (where they should not have been to
      start with) and into the places where they are actually used (often only
      one place). Also those _host structures which are not required any more
      are removed entirely (which is the eventual plan for all of them).
      
      The conversion routines from ondisk.c are also moved into the places
      where they are actually used, which for almost every one, was just one
      single place, so all those are now static functions. This also cleans up
      the end of gfs2_ondisk.h which no longer needs the #ifdef __KERNEL__.
      
      The net result is a reduction of about 100 lines of code, many functions
      now marked static plus the bug fixes as mentioned above. For good
      measure I ran the code through sparse after making these changes to
      check that there are no warnings generated.
      
      This fixes Red Hat bz #239686
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      bb8d8a6f
    • S
      [GFS2] Clean up inode number handling · dbb7cae2
      Steven Whitehouse 提交于
      This patch cleans up the inode number handling code. The main difference
      is that instead of looking up the inodes using a struct gfs2_inum_host
      we now use just the no_addr member of this structure. The tests relating
      to no_formal_ino can then be done by the calling code. This has
      advantages in that we want to do different things in different code
      paths if the no_formal_ino doesn't match. In the NFS patch we want to
      return -ESTALE, but in the ->lookup() path, its a bug in the fs if the
      no_formal_ino doesn't match and thus we can withdraw in this case.
      
      In order to later fix bz #201012, we need to be able to look up an inode
      without knowing no_formal_ino, as the only information that is known to
      us is the on-disk location of the inode in question.
      
      This patch will also help us to fix bz #236099 at a later date by
      cleaning up a lot of the code in that area.
      
      There are no user visible changes as a result of this patch and there
      are no changes to the on-disk format either.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      dbb7cae2
  16. 08 3月, 2007 1 次提交
  17. 06 2月, 2007 4 次提交
    • S
      [GFS2] Remove local exclusive glock mode · 1c0f4872
      Steven Whitehouse 提交于
      Here is a patch for GFS2 to remove the local exclusive flag. In
      the places it was used, mutex's are always held earlier in the
      call path, so it appears redundant in the LM_ST_SHARED case.
      
      Also, the GFS2 holders were setting local exclusive in any case where
      the requested lock was LM_ST_EXCLUSIVE. So the other places in the glock
      code where the flag was tested have been replaced with tests for the
      lock state being LM_ST_EXCLUSIVE in order to ensure the logic is the
      same as before (i.e. LM_ST_EXCLUSIVE is always locally exclusive as well
      as globally exclusive).
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      1c0f4872
    • S
      [GFS2] Remove the "greedy" function from glock.[ch] · e5dab552
      Steven Whitehouse 提交于
      The "greedy" code was an attempt to retain glocks for a minimum length
      of time when they relate to mmap()ed files. The current implementation
      of this feature is not, however, ideal in that it required allocating
      memory in order to do this and its overly complicated.
      
      It also misses the mark by ignoring the other I/O operations which are
      just as likely to suffer from the same problem. So the plan is to remove
      this now and then add the functionality back as part of the glock state
      machine at a later date (and thus take into account all the possible
      users of this feature)
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      e5dab552
    • S
      [GFS2] Remove max_atomic_write tunable · 330005c2
      Steven Whitehouse 提交于
      This removes an unused sysfs tunable parameter.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      330005c2
    • S
      [GFS2] Clean up/speed up readdir · 3699e3a4
      Steven Whitehouse 提交于
      This removes the extra filldir callback which gfs2 was using to
      enclose an attempt at readahead for inodes during readdir. The
      code was too complicated and also hurts performance badly in the
      case that the getdents64/readdir call isn't being followed by
      stat() and it wasn't even getting it right all the time when it
      was.
      
      As a result, on my test box an "ls" of a directory containing 250000
      files fell from about 7mins (freshly mounted, so nothing cached) to
      between about 15 to 25 seconds. When the directory content was cached,
      the time taken fell from about 3mins to about 4 or 5 seconds.
      
      Interestingly in the cached case, running "ls -l" once reduced the time
      taken for subsequent runs of "ls" to about 6 secs even without this
      patch. Now it turns out that there was a special case of glocks being
      used for prefetching the metadata, but because of the timeouts for these
      locks (set to 10 secs) the metadata was being timed out before it was
      being used and this the prefetch code was constantly trying to prefetch
      the same data over and over.
      
      Calling "ls -l" meant that the inodes were brought into memory and once
      the inodes are cached, the glocks are not disposed of until the inodes
      are pushed out of the cache, thus extending the lifetime of the glocks,
      and thus bringing down the time for subsequent runs of "ls"
      considerably.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      3699e3a4
  18. 30 11月, 2006 2 次提交
    • S
      [GFS2] Add a comment about reading the super block · aac1a3c7
      Steven Whitehouse 提交于
      The comment explains why we use the bio functions to read
      the super block.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Cc: Andrew Morton <akpm@osdl.org>
      Cc: Srinivasa Ds <srinivasa@in.ibm.com>
      aac1a3c7
    • S
      [GFS2] Mount problem with the GFS2 code · 0da3585e
      Srinivasa Ds 提交于
        While mounting the gfs2 filesystem,our test team had a problem and we
      got this error message.
      =======================================================
      
      GFS2: fsid=: Trying to join cluster "lock_nolock", "dasde1"
      GFS2: fsid=dasde1.0: Joined cluster. Now mounting FS...
      GFS2: not a GFS2 filesystem
      GFS2: fsid=dasde1.0: can't read superblock: -22
      
      ==========================================================================
      On debugging further we found that problem is while reading the super
      block(gfs2_read_super) and comparing the magic number in it.
      When I  replace the submit_bio() call(present in gfs2_read_super) with
      the sb_getblk() and ll_rw_block(), mount operation succeded.
      On further analysis we found that before calling submit_bio(),
      bio->bi_sector was set to "sector" variable. This "sector" variable has
      the same value of bh->b_blocknr(block number). Hence there is a need to
      multiply this valuwith (blocksize >> 9)(9 because,sector size
      2^9,samething happens in ll_rw_block also, before calling submit_bio()).
      So I have developed the patch which solves this problem. Please let me
      know your comments.
      ================================================================
      Signed-off-by: NSrinivasa DS <srinivasa@in.ibm.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      0da3585e