1. 24 Dec, 2009 1 commit
  2. 23 Dec, 2009 6 commits
    • Andrew Morton's avatar
      jbd2: don't use __GFP_NOFAIL in journal_init_common() · 3ebfdf88
      Andrew Morton authored
      It triggers the warning in get_page_from_freelist(), and it isn't
      appropriate to use __GFP_NOFAIL here anyway.
      
      Addresses http://bugzilla.kernel.org/show_bug.cgi?id=14843Reported-by: default avatarChristian Casteyde <casteyde.christian@free.fr>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      3ebfdf88
    • Eric Sandeen's avatar
      ext4: flush delalloc blocks when space is low · c8afb446
      Eric Sandeen authored
      Creating many small files in rapid succession on a small
      filesystem can lead to spurious ENOSPC; on a 104MB filesystem:
      
      for i in `seq 1 22500`; do
          echo -n > $SCRATCH_MNT/$i
          echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i
      done
      
      leads to ENOSPC even though after a sync, 40% of the fs is free
      again.
      
      This is because we reserve worst-case metadata for delalloc writes,
      and when data is allocated that worst-case reservation is not
      usually needed.
      
      When freespace is low, kicking off an async writeback will start
      converting that worst-case space usage into something more realistic,
      almost always freeing up space to continue.
      
      This resolves the testcase for me, and survives all 4 generic
      ENOSPC tests in xfstests.
      
      We'll still need a hard synchronous sync to squeeze out the last bit,
      but this fixes things up to a large degree.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      c8afb446
    • Eric Sandeen's avatar
      fs-writeback: Add helper function to start writeback if idle · 17bd55d0
      Eric Sandeen authored
      ext4, at least, would like to start pushing on writeback if it starts
      to get close to ENOSPC when reserving worst-case blocks for delalloc
      writes.  Writing out delalloc data will convert those worst-case
      predictions into usually smaller actual usage, freeing up space
      before we hit ENOSPC based on this speculation.
      
      Thanks to Jens for the suggestion for the helper function,
      & the naming help.
      
      I've made the helper return status on whether writeback was
      started even though I don't plan to use it in the ext4 patch;
      it seems like it would be potentially useful to test this
      in some cases.
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Acked-by: default avatarJan Kara <jack@suse.cz>
      17bd55d0
    • Julia Lawall's avatar
      ext4: Eliminate potential double free on error path · d3533d72
      Julia Lawall authored
      b_entry_name and buffer are initially NULL, are initialized within a loop
      to the result of calling kmalloc, and are freed at the bottom of this loop.
      The loop contains gotos to cleanup, which also frees b_entry_name and
      buffer.  Some of these gotos are before the reinitializations of
      b_entry_name and buffer.  To maintain the invariant that b_entry_name and
      buffer are NULL at the top of the loop, and thus acceptable arguments to
      kfree, these variables are now set to NULL after the kfrees.
      
      This seems to be the simplest solution.  A more complicated solution
      would be to introduce more labels in the error handling code at the end of
      the function.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r@
      identifier E;
      expression E1;
      iterator I;
      statement S;
      @@
      
      *kfree(E);
      ... when != E = E1
          when != I(E,...) S
          when != &E
      *kfree(E);
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      d3533d72
    • Andrew Morton's avatar
      ext4: fix unsigned long long printk warning in super.c · a6b43e38
      Andrew Morton authored
      sparc64 allmodconfig:
      
      fs/ext4/super.c: In function `lifetime_write_kbytes_show':
      fs/ext4/super.c:2174: warning: long long unsigned int format, long unsigned int arg (arg 4)
      fs/ext4/super.c:2174: warning: long long unsigned int format, long unsigned int arg (arg 4)
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      a6b43e38
    • Theodore Ts'o's avatar
      ext4, jbd2: Add barriers for file systems with exernal journals · cc3e1bea
      Theodore Ts'o authored
      This is a bit complicated because we are trying to optimize when we
      send barriers to the fs data disk.  We could just throw in an extra
      barrier to the data disk whenever we send a barrier to the journal
      disk, but that's not always strictly necessary.
      
      We only need to send a barrier during a commit when there are data
      blocks which are must be written out due to an inode written in
      ordered mode, or if fsync() depends on the commit to force data blocks
      to disk.  Finally, before we drop transactions from the beginning of
      the journal during a checkpoint operation, we need to guarantee that
      any blocks that were flushed out to the data disk are firmly on the
      rust platter before we drop the transaction from the journal.
      
      Thanks to Oleg Drokin for pointing out this flaw in ext3/ext4.
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      cc3e1bea
  3. 14 Dec, 2009 1 commit
  4. 21 Dec, 2009 2 commits
  5. 14 Dec, 2009 1 commit
  6. 24 Dec, 2009 29 commits