1. 26 Aug, 2009 2 commits
    • Steven Whitehouse's avatar
      GFS2: Rename eattr.[ch] as xattr.[ch] · 307cf6e6
      Steven Whitehouse authored
      Use the more conventional name for the extended attribute
      support code. Update all the places which care.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    • Steven Whitehouse's avatar
      GFS2: Clean up of extended attribute support · 40b78a32
      Steven Whitehouse authored
      This has been on my list for some time. We need to change the way
      in which we handle extended attributes to allow faster file creation
      times (by reducing the number of transactions required) and the
      extended attribute code is the main obstacle to this.
      In addition to that, the VFS provides a way to demultiplex the xattr
      calls which we ought to be using, rather than rolling our own. This
      patch changes the GFS2 code to use that VFS feature and as a result
      the code shrinks by a couple of hundred lines or so, and becomes
      easier to read.
      I'm planning on doing further clean up work in this area, but this
      patch is a good start. The cleaned up code also uses the more usual
      "xattr" shorthand, I plan to eliminate the use of "eattr" eventually
      and in the mean time it serves as a flag as to which bits of the code
      have been updated.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
  2. 17 Aug, 2009 1 commit
  3. 22 May, 2009 4 commits
  4. 15 Apr, 2009 1 commit
  5. 24 Mar, 2009 1 commit
    • Steven Whitehouse's avatar
      GFS2: Merge lock_dlm module into GFS2 · f057f6cd
      Steven Whitehouse authored
      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: default avatarSteven Whitehouse <swhiteho@redhat.com>
  6. 05 Jan, 2009 7 commits
  7. 13 Nov, 2008 1 commit
  8. 18 Sep, 2008 1 commit
    • Steven Whitehouse's avatar
      GFS2: high time to take some time over atime · 719ee344
      Steven Whitehouse authored
      Until now, we've used the same scheme as GFS1 for atime. This has failed
      since atime is a per vfsmnt flag, not a per fs flag and as such the
      "noatime" flag was not getting passed down to the filesystems. This
      patch removes all the "special casing" around atime updates and we
      simply use the VFS's atime code.
      The net result is that GFS2 will now support all the same atime related
      mount options of any other filesystem on a per-vfsmnt basis. We do lose
      the "lazy atime" updates, but we gain "relatime". We could add lazy
      atime to the VFS at a later date, if there is a requirement for that
      variant still - I suspect relatime will be enough.
      Also we lose about 100 lines of code after this patch has been applied,
      and I have a suspicion that it will speed things up a bit, even when
      atime is "on". So it seems like a nice clean up as well.
      From a user perspective, everything stays the same except the loss of
      the per-fs atime quantum tweekable (ought to be per-vfsmnt at the very
      least, and to be honest I don't think anybody ever used it) and that a
      number of options which were ignored before now work correctly.
      Please let me know if you've got any comments. I'm pushing this out
      early so that you can all see what my plans are.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
  9. 05 Sep, 2008 1 commit
  10. 27 Aug, 2008 1 commit
    • Steven Whitehouse's avatar
      GFS2: Fix & clean up GFS2 rename · 0188d6c5
      Steven Whitehouse authored
      This patch fixes a locking issue in the rename code by ensuring that we hold
      the per sb rename lock over both directory and "other" renames which involve
      different parent directories.
      At the same time, this moved the (only called from one place) function
      gfs2_ok_to_move into the file that its called from, so we can mark it
      static. This should make a code a bit easier to follow.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      Cc: Peter Staubach <staubach@redhat.com>
  11. 26 Jul, 2008 1 commit
  12. 10 Jul, 2008 1 commit
  13. 03 Jul, 2008 1 commit
    • Miklos Szeredi's avatar
      [GFS2] don't call permission() · f58ba889
      Miklos Szeredi authored
      GFS2 calls permission() to verify permissions after locks on the files
      have been taken.
      For this it's sufficient to call gfs2_permission() instead.  This
      results in the following changes:
        - IS_RDONLY() check is not performed
        - IS_IMMUTABLE() check is not performed
        - devcgroup_inode_permission() is not called
        - security_inode_permission() is not called
      IS_RDONLY() should be unnecessary anyway, as the per-mount read-only
      flag should provide protection against read-only remounts during
      operations.  do_gfs2_set_flags() has been fixed to perform
      mnt_want_write()/mnt_drop_write() to protect against remounting
      IS_IMMUTABLE has been added to gfs2_permission()
      Repeating the security checks seems to be pointless, as they don't
      normally change, and if they do, it's independent of the filesystem
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
  14. 12 May, 2008 1 commit
  15. 10 Apr, 2008 1 commit
  16. 31 Mar, 2008 9 commits
    • Cyrill Gorcunov's avatar
      [GFS2] possible null pointer dereference fixup · 182fe5ab
      Cyrill Gorcunov authored
      gfs2_alloc_get may fail so we have to check it to prevent
      NULL pointer dereference.
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gamil.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    • Denis Cheng's avatar
      [GFS2] re-support special inode · 43a33c53
      Denis Cheng authored
      a previous commit removed call to
      init_special_inode from inode lookuping, this cause problems as:
       # mknod /mnt/gfs2/dev/null c 1 3
       # cat /mnt/gfs2/dev/null
       cat: /mnt/gfs2/dev/null: Invalid argument
      without special inode, GFS2 cannot support char device file,
      block device file, fifo pipe, and socket file, lose many important
      features as a common file system.
      this one line patch re add special inode support.
      Signed-off-by: default avatarDenis Cheng <crquan@gmail.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    • Denis Cheng's avatar
      [GFS2] remove gfs2_dev_iops · d83225d4
      Denis Cheng authored
      struct inode_operations gfs2_dev_iops is always the same as gfs2_file_iops,
      since Jan 2006, when GFS2 merged into mainstream kernel.
      So one of them could be removed.
      Signed-off-by: default avatarDenis Cheng <crquan@gmail.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    • Steven Whitehouse's avatar
      [GFS2] Fix a page lock / glock deadlock · 7afd88d9
      Steven Whitehouse authored
      We've previously been using a "try lock" in readpage on the basis that
      it would prevent deadlocks due to the inverted lock ordering (our normal
      lock ordering is glock first and then page lock). Unfortunately tests
      have shown that this isn't enough. If the glock has a demote request
      queued such that run_queue() in the glock code tries to do a demote when
      its called under readpage then it will try and write out all the dirty
      pages which requires locking them. This then deadlocks with the page
      locked by readpage.
      The solution is to always require two calls into readpage. The first
      unlocks the page, gets the glock and returns AOP_TRUNCATED_PAGE, the
      second does the actual readpage and unlocks the glock & page as
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    • Steven Whitehouse's avatar
      [GFS2] Eliminate (almost) duplicate field from gfs2_inode · 77658aad
      Steven Whitehouse authored
      The blocks counter is almost a duplicate of the i_blocks
      field in the VFS inode. The only difference is that i_blocks
      can be only 32bits long for 32bit arch without large single file
      support. Since GFS2 doesn't handle the non-large single file
      case (for 32 bit anyway) this adds a new config dependency on
      64BIT || LSF. This has always been the case, however we've never
      explicitly said so before.
      Even if we do add support for the non-LSF case, we will still
      not require this field to be duplicated since we will not be
      able to access oversized files anyway.
      So the net result of all this is that we shave 8 bytes from a gfs2_inode
      and get our config deps correct.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    • Steven Whitehouse's avatar
      [GFS2] Reduce inode size by merging fields · ce276b06
      Steven Whitehouse authored
      There were three fields being used to keep track of the location
      of the most recently allocated block for each inode. These have
      been merged into a single field in order to better keep the
      data and metadata for an inode close on disk, and also to reduce
      the space required for storage.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    • Steven Whitehouse's avatar
      [GFS2] Shrink & rename di_depth · 9a004508
      Steven Whitehouse authored
      This patch forms a pair with the previous patch which shrunk
      di_height. Like that patch di_depth is renamed i_depth and moved
      into struct gfs2_inode directly. Also the field goes from 16 bits
      to 8 bits since it is also limited to a max value which is rather
      small (17 in this case). In addition we also now validate the field
      against this maximum value when its read in.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    • Bob Peterson's avatar
      [GFS2] Fix debug inode printing · ca390601
      Bob Peterson authored
      I noticed that the latest change to i_height got rid of the
      value from the inode dump.  This patch adds it back.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    • Steven Whitehouse's avatar
      [GFS2] Streamline indirect pointer tree height calculation · ecc30c79
      Steven Whitehouse authored
      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: default avatarSteven Whitehouse <swhiteho@redhat.com>
  17. 07 Feb, 2008 1 commit
  18. 25 Jan, 2008 5 commits
    • Bob Peterson's avatar
      [GFS2] Lockup on error · 1b8177ec
      Bob Peterson authored
      I spotted this bug while I was digging around.  Looks like it could cause
      a lockup in some rare error condition.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    • Steven Whitehouse's avatar
      [GFS2] Reduce inode size by moving i_alloc out of line · 6dbd8224
      Steven Whitehouse authored
      It is possible to reduce the size of GFS2 inodes by taking the i_alloc
      structure out of the gfs2_inode. This patch allocates the i_alloc
      structure whenever its needed, and frees it afterward. This decreases
      the amount of low memory we use at the expense of requiring a memory
      allocation for each page or partial page that we write. A quick test
      with postmark shows that the overhead is not measurable and I also note
      that OCFS2 use the same approach.
      In the future I'd like to solve the problem by shrinking down the size
      of the members of the i_alloc structure, but for now, this reduces the
      immediate problem of using too much low-memory on x86 and doesn't add
      too much overhead.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    • Wendy Cheng's avatar
      [GFS2] Remove lock methods for lock_nolock protocol · c97bfe43
      Wendy Cheng authored
      GFS2 supports two modes of locking - lock_nolock for single node filesystem
      and lock_dlm for cluster mode locking. The gfs2 lock methods are removed from
      file operation table for lock_nolock protocol. This would allow VFS to handle
      posix lock and flock logics just like other in-tree filesystems without
      Signed-off-by: default avatarS. Wendy Cheng <wcheng@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    • Steven Whitehouse's avatar
      [GFS2] Don't add glocks to the journal · 2bcd610d
      Steven Whitehouse authored
      The only reason for adding glocks to the journal was to keep track
      of which locks required a log flush prior to release. We add a
      flag to the glock to allow this check to be made in a simpler way.
      This reduces the size of a glock (by 12 bytes on i386, 24 on x86_64)
      and means that we can avoid extra work during the journal flush.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    • Steven Whitehouse's avatar
      [GFS2] Introduce gfs2_set_aops() · 5561093e
      Steven Whitehouse authored
      Just like ext3 we now have three sets of address space operations
      to cover the cases of writeback, ordered and journalled data
      writes. This means that the individual operations can now become
      less complicated as we are able to remove some of the tests for
      file data mode from the code.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>