1. 30 7月, 2010 1 次提交
  2. 29 7月, 2010 7 次提交
    • S
      Revert "GFS2: recovery stuck on transaction lock" · 7cdee5db
      Steven Whitehouse 提交于
      This reverts commit b7dc2df5.
      
      The initial patch didn't quite work since it doesn't cover all
      the possible routes by which the GLF_FROZEN flag might be set.
      A revised fix is coming up in the next patch.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      7cdee5db
    • S
      GFS2: Make "try" lock not try quite so hard · d5341a92
      Steven Whitehouse 提交于
      This looks like a big change, but in reality its only a single line of actual
      code change, the rest is just moving a function to before its new caller.
      The "try" flag for glocks is a rather subtle and delicate setting since it
      requires that the state machine tries just hard enough to ensure that it has
      a good chance of getting the requested lock, but no so hard that the
      request can land up blocked behind another.
      
      The patch adds in an additional check which will fail any queued try
      locks if there is another request blocking the try lock request which
      is not granted and compatible, nor in progress already. The check is made
      only after all pending locks which may be granted have been granted.
      
      I've checked this with the reproducer for the reported flock bug which
      this is intended to fix, and it now passes.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      d5341a92
    • D
      GFS2: remove dependency on __GFP_NOFAIL · 4244b52e
      David Rientjes 提交于
      The k[mc]allocs in dr_split_leaf() and dir_double_exhash() are failable,
      so remove __GFP_NOFAIL from their masks.
      
      Cc: Bob Peterson <rpeterso@redhat.com>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      4244b52e
    • B
      GFS2: Simplify gfs2_write_alloc_required · 461cb419
      Bob Peterson 提交于
      Function gfs2_write_alloc_required always returned zero as its
      return code.  Therefore, it doesn't need to return a return code
      at all.  Given that, we can use the return value to return whether
      or not the dinode needs block allocations rather than passing
      that value in, which in turn simplifies a bunch of error checking.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      461cb419
    • S
      GFS2: Wait for journal id on mount if not specified on mount command line · ba6e9364
      Steven Whitehouse 提交于
      This patch implements a wait for the journal id in the case that it has
      not been specified on the command line. This is to allow the future
      removal of the mount.gfs2 helper. The journal id would instead be
      directly communicated by gfs_controld to the file system. Here is a
      comparison of the two systems:
      
      Current:
      1. mount calls mount.gfs2
      2. mount.gfs2 connects to gfs_controld to retrieve the journal id
      3. mount.gfs2 adds the journal id to the mount command line and calls
      the mount system call
      4. gfs_controld receives the status of the mount request via a uevent
      
      Proposed:
      1. mount calls the mount system call (no mount.gfs2 helper)
      2. gfs_controld receives a uevent for a gfs2 fs which it doesn't know
      about already
      3. gfs_controld assigns a journal id to it via sysfs
      4. the mount system call then completes as normal (sending a uevent
      according to status)
      
      The advantage of the proposed system is that it is completely backward
      compatible with the current system both at the kernel and at the
      userland levels. The "first" parameter can also be set the same way,
      with the restriction that it must be set before the journal id is
      assigned.
      
      In addition, if mount becomes stuck waiting for a reply from
      gfs_controld which never arrives, then it is killable and will abort the
      mount gracefully.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      ba6e9364
    • S
      GFS2: Use nobh_writepage · 30116ff6
      Steven Whitehouse 提交于
      Use nobh_writepage rather than calling mpage_writepage directly.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      30116ff6
    • S
      GFS2: Use kmalloc when possible for ->readdir() · d2a97a4e
      Steven Whitehouse 提交于
      If we don't need a huge amount of memory in ->readdir() then
      we can use kmalloc rather than vmalloc to allocate it. This
      should cut down on the greater overheads associated with
      vmalloc for smaller directories.
      
      We may be able to eliminate vmalloc entirely at some stage,
      but this is easy to do right away.
      
      Also using GFP_NOFS to avoid any issues wrt to deleting inodes
      while under a glock, and suggestion from Linus to factor out
      the alloc/dealloc.
      
      I've given this a test with a variety of different sized
      directories and it seems to work ok.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Nick Piggin <npiggin@suse.de>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d2a97a4e
  3. 19 7月, 2010 1 次提交
    • D
      mm: add context argument to shrinker callback · 7f8275d0
      Dave Chinner 提交于
      The current shrinker implementation requires the registered callback
      to have global state to work from. This makes it difficult to shrink
      caches that are not global (e.g. per-filesystem caches). Pass the shrinker
      structure to the callback so that users can embed the shrinker structure
      in the context the shrinker needs to operate on and get back to it in the
      callback via container_of().
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      7f8275d0
  4. 15 7月, 2010 5 次提交
    • B
      GFS2: rename causes kernel Oops · 728a756b
      Bob Peterson 提交于
      This patch fixes a kernel Oops in the GFS2 rename code.
      
      The problem was in the way the gfs2 directory code was trying
      to re-use sentinel directory entries.
      
      In the failing case, gfs2's rename function was renaming a
      file to another name that had the same non-trivial length.
      The file being renamed happened to be the first directory
      entry on the leaf block.
      
      First, the rename code (gfs2_rename in ops_inode.c) found the
      original directory entry and decided it could do its job by
      simply replacing the directory entry with another.  Therefore
      it determined correctly that no block allocations were needed.
      
      Next, the rename code deleted the old directory entry prior to
      replacing it with the new name.  Therefore, the soon-to-be
      replaced directory entry was temporarily made into a directory
      entry "sentinel" or a place holder at the start of a leaf block.
      
      Lastly, it went to re-add the replacement directory entry in
      that leaf block.  However, when gfs2_dirent_find_space was
      looking for space in the leaf block, it used the wrong value
      for the sentinel.  That threw off its calculations so later
      it decides it can't really re-use the sentinel and therefore
      must allocate a new leaf block.  But because it previously decided
      to re-use the directory entry, it didn't waste the time to
      grab a new block allocation for the inode.  Therefore, the
      inode's i_alloc pointer was still NULL and it crashes trying to
      reference it.
      
      In the case of sentinel directory entries, the entire dirent is
      reused, not just the "free space" portion of it, and therefore
      the function gfs2_dirent_find_space should use the value 0
      rather than GFS2_DIRENT_SIZE(0) for the actual dirent size.
      
      Fixing this calculation enables the reproducer programs to work
      properly.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      728a756b
    • A
      GFS2: BUG in gfs2_adjust_quota · 8b421601
      Abhijith Das 提交于
      HighMem pages on i686 do not get mapped to the buffer_heads and this was
      causing a NULL pointer dereference when we were trying to memset page buffers
      to zero.
      We now use zero_user() that kmaps the page and directly manipulates page data.
      This patch also fixes a boundary condition that was incorrect.
      Signed-off-by: NAbhi Das <adas@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      8b421601
    • B
      GFS2: Fix kernel NULL pointer dereference by dlm_astd · b1becbde
      Bob Peterson 提交于
      This patch fixes a problem in an error path when looking
      up dinodes.  There are two sister-functions, gfs2_inode_lookup
      and gfs2_process_unlinked_inode.  Both functions acquire and
      hold the i_iopen glock for the dinode being looked up. The last
      thing they try to do is hold the i_gl glock for the dinode.
      If that glock fails for some reason, the error path was
      incorrectly calling gfs2_glock_put for the i_iopen glock twice.
      This resulted in the glock being prematurely freed.  The
      "minimum hold time" usually kept the glock in memory, but the
      lock interface to dlm (aka lock_dlm) freed its memory for the
      glock.  In some circumstances, it would cause dlm's dlm_astd daemon
      to try to call the bast function for the freed lock_dlm memory,
      which resulted in a NULL pointer dereference.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      b1becbde
    • B
      GFS2: recovery stuck on transaction lock · b7dc2df5
      Bob Peterson 提交于
      This patch fixes bugzilla bug #590878: GFS2: recovery stuck on
      transaction lock.  We set the frozen flag on the glock when we receive
      a completion that cannot be delivered due to blocked locks. At that
      point we check to see whether the first waiting holder has the noexp
      flag set. If the noexp lock is queued later, then we need to unfreeze
      the glock at that point in time, namely, in the glock work function.
      
      This patch was originally written by Steve Whitehouse, but since
      he's on holiday, I'm submitting it.  It's been well tested with a
      complex recovery test called revolver.
      Signed-off-by: NSteve Whitehouse <swhiteho@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      b7dc2df5
    • B
      GFS2: O_TRUNC not working on stuffed files across cluster · a8bf2bc2
      Bob Peterson 提交于
      This patch replaces a statement that got dropped out by accident.
      Without the patch, truncates on stuffed (very small) files cause
      those files to have an unpredictable size.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      a8bf2bc2
  5. 28 5月, 2010 2 次提交
  6. 24 5月, 2010 1 次提交
  7. 22 5月, 2010 3 次提交
  8. 21 5月, 2010 2 次提交
  9. 14 5月, 2010 1 次提交
  10. 12 5月, 2010 2 次提交
  11. 10 5月, 2010 1 次提交
    • A
      GFS2: Fix writing to non-page aligned gfs2_quota structures · 7e619bc3
      Abhijith Das 提交于
      This is the upstream fix for this bug. This patch differs
      from the RHEL5 fix (Red Hat bz #555754) which simply writes to the 8-byte
      value field of the quota. In upstream quota code, we're
      required to write the entire quota (88 bytes) which can be split
      across a page boundary. We check for such quotas, and read/write
      the two parts from/to the corresponding pages holding these parts.
      
      With this patch, I don't see the bug anymore using the reproducer
      in Red Hat bz 555754. I successfully ran a couple of simple tests/mounts/
      umounts and it doesn't seem like this patch breaks anything else.
      Signed-off-by: NAbhi Das <adas@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      7e619bc3
  12. 06 5月, 2010 1 次提交
    • S
      GFS2: Add some useful messages · 913a71d2
      Steven Whitehouse 提交于
      The following patch adds a message to indicate when barriers have been
      disabled due to a block device which doesn't support them. You could
      already tell this via the mount options in /proc/mounts, but all the
      other filesystems also log a message at the same time.
      
      Also, the same mechanisms are used to indicate when the lock
      demote interface has been used (only ever used for debugging)
      which is a request from our support team.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      913a71d2
  13. 05 5月, 2010 2 次提交
    • C
      GFS2: fix quota state reporting · ad6bb90f
      Christoph Hellwig 提交于
      We need to report both the accounting and enforcing flags if we are
      in enforcing mode.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      ad6bb90f
    • B
      GFS2: Various gfs2_logd improvements · 5e687eac
      Benjamin Marzinski 提交于
      This patch contains various tweaks to how log flushes and active item writeback
      work. gfs2_logd is now managed by a waitqueue, and gfs2_log_reseve now waits
      for gfs2_logd to do the log flushing.  Multiple functions were rewritten to
      remove the need to call gfs2_log_lock(). Instead of using one test to see if
      gfs2_logd had work to do, there are now seperate tests to check if there
      are two many buffers in the incore log or if there are two many items on the
      active items list.
      
      This patch is a port of a patch Steve Whitehouse wrote about a year ago, with
      some minor changes.  Since gfs2_ail1_start always submits all the active items,
      it no longer needs to keep track of the first ai submitted, so this has been
      removed. In gfs2_log_reserve(), the order of the calls to
      prepare_to_wait_exclusive() and wake_up() when firing off the logd thread has
      been switched.  If it called wake_up first there was a small window for a race,
      where logd could run and return before gfs2_log_reserve was ready to get woken
      up. If gfs2_logd ran, but did not free up enough blocks, gfs2_log_reserve()
      would be left waiting for gfs2_logd to eventualy run because it timed out.
      Finally, gt_logd_secs, which controls how long to wait before gfs2_logd times
      out, and flushes the log, can now be set on mount with ar_commit.
      Signed-off-by: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      5e687eac
  14. 29 4月, 2010 1 次提交
  15. 14 4月, 2010 1 次提交
    • B
      GFS2: glock livelock · 1a0eae88
      Bob Peterson 提交于
      This patch fixes a couple gfs2 problems with the reclaiming of
      unlinked dinodes.  First, there were a couple of livelocks where
      everything would come to a halt waiting for a glock that was
      seemingly held by a process that no longer existed.  In fact, the
      process did exist, it just had the wrong pid number in the holder
      information.  Second, there was a lock ordering problem between
      inode locking and glock locking.  Third, glock/inode contention
      could sometimes cause inodes to be improperly marked invalid by
      iget_failed.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      1a0eae88
  16. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  17. 29 3月, 2010 2 次提交
  18. 12 3月, 2010 1 次提交
  19. 11 3月, 2010 1 次提交
    • B
      GFS2: Allow the number of committed revokes to temporarily be negative · 2e95e3f6
      Benjamin Marzinski 提交于
      GFS2 tracks the number of revokes and unrevokes that are part of committed
      transactions via sd_log_commited_revoke. It is possible for one process to add
      revokes during its transaction, while another process unrevokes them during its
      transaction. If the second process finishes its transaction first,
      sd_log_commited_revoke will be decremented by the number of unrevokes that the
      second process did, without first being incremented by the number of revokes
      the first process did. This is fine, since all started transactions must be
      completed before the journal can be flushed.  However, sd_log_commited_revoke
      is an unsigned integer, and log_refund() causes an assertion failure if it
      would go negative at the end of a transaction.  This patch makes
      sd_log_commited_revoke a signed integer and allows it to go negative.
      __gfs2_log_flush() still checks that it mataches the actual number of revokes.
      Signed-off-by: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      2e95e3f6
  20. 09 3月, 2010 1 次提交
  21. 08 3月, 2010 2 次提交
  22. 06 3月, 2010 1 次提交