1. 20 Aug, 2008 3 commits
    • Mingming Cao's avatar
      ext4: journal credits calulation cleanup and fix for non-extent writepage · a02908f1
      Mingming Cao authored
      When considering how many journal credits are needed for modifying a
      chunk of data, we need to account for the super block, inode block,
      quota blocks and xattr block, indirect/index blocks, also, group bitmap
      and group descriptor blocks for new allocation (including data and
      indirect/index blocks). There are many places in ext4 do the calculation
      on their own and often missed one or two meta blocks, and often they
      assume single block allocation, and did not considering the multile
      chunk of allocation case.
      
      This patch is trying to cleanup current journal credit code, provides
      some common helper funtion to calculate the journal credits, to be used
      for writepage, writepages, DIO, fallocate, migration, defrag, and for
      both nonextent and extent files.
      
      This patch modified the writepage/write_begin credit caculation for
      nonextent files, to use the new helper function. It also fixed the
      problem that writepage on nonextent files did not consider the case
      blocksize <pagesize, thus could possibelly need multiple block
      allocation in a single transaction.
      Signed-off-by: default avatarMingming Cao <cmm@us.ibm.com>
      Reviewed-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      a02908f1
    • Eric Sandeen's avatar
      ext4: Fix bug where we return ENOSPC even though we have plenty of inodes · c001077f
      Eric Sandeen authored
      The find_group_flex() function starts with best_flex as the
      parent_fbg_group, which happens to have 0 inodes free.  Some of the
      flex groups searched have free blocks and free inodes, but the
      flex_freeb_ratio is < 10, so they're skipped.  Then when a group is
      compared to the current "best" flex group, it does not have more free
      blocks than "best", so it is skipped as well.
      
      This continues until no flex group with free inodes is found which has
      a proper ratio or which has more free blocks than the "best" group,
      and we're left with a "best" group that has 0 inodes free, and we
      return -ENOSPC.
      
      We fix this by changing the logic so that if the current "best" flex
      group has no inodes free, and the current one does have room, it is
      promoted to the next "best."
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      c001077f
    • Josef Bacik's avatar
      ext4: don't try to resize if there are no reserved gdt blocks left · 37609fd5
      Josef Bacik authored
      When trying to resize an ext4 fs and you run out of reserved gdt blocks,
      you get an error that doesn't actually tell you what went wrong, it just
      says that the gdb it picked is not correct, which is the case since you
      don't have any reserved gdt blocks left.  This patch adds a check to make
      sure you have reserved gdt blocks to use, and if not prints out a more
      relevant error.
      Signed-off-by: default avatarJosef Bacik <jbacik@redhat.com>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: Andreas Dilger <adilger@sun.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      37609fd5
  2. 16 Aug, 2008 1 commit
  3. 20 Aug, 2008 2 commits
  4. 14 Aug, 2008 1 commit
  5. 20 Aug, 2008 1 commit
  6. 13 Aug, 2008 1 commit
  7. 12 Aug, 2008 31 commits