This project is mirrored from Pull mirroring updated .
  1. 23 Feb, 2009 1 commit
  2. 14 Feb, 2009 1 commit
  3. 10 Feb, 2009 1 commit
    • Jan Kara's avatar
      jbd2: Avoid possible NULL dereference in jbd2_journal_begin_ordered_truncate() · 7f5aa215
      Jan Kara authored
      If we race with commit code setting i_transaction to NULL, we could
      possibly dereference it.  Proper locking requires the journal pointer
      (to access journal->j_list_lock), which we don't have.  So we have to
      change the prototype of the function so that filesystem passes us the
      journal pointer.  Also add a more detailed comment about why the
      function jbd2_journal_begin_ordered_truncate() does what it does and
      how it should be used.
      Thanks to Dan Carpenter <> for pointing to the
      suspitious code.
      Signed-off-by: default avatarJan Kara <>
      Signed-off-by: default avatar"Theodore Ts'o" <>
      Acked-by: default avatarJoel Becker <>
      CC: Dan Carpenter <>
  4. 30 Jan, 2009 1 commit
    • Theodore Ts'o's avatar
      ext4: Remove bogus BUG() check in ext4_bmap() · b9ec63f7
      Theodore Ts'o authored
      The code to support journal-less ext4 operation added a BUG to
      ext4_bmap() which fired if there was no journal and the
      EXT4_STATE_JDATA bit was set in the i_state field.  This caused
      running the filefrag program (which uses the FIMBAP ioctl) to trigger
      a BUG().
      The EXT4_STATE_JDATA bit is only used for ext4_bmap(), and it's
      harmless for the bit to be set.  We could add a check in
      __ext4_journalled_writepage() and ext4_journalled_write_end() to only
      set the EXT4_STATE_JDATA bit if the journal is present, but that adds
      an extra test and jump instruction.  It's easier to simply remove the
      BUG check.
      Signed-off-by: default avatar"Theodore Ts'o" <>
  5. 20 Jan, 2009 1 commit
  6. 17 Jan, 2009 1 commit
    • Theodore Ts'o's avatar
      ext4: only use i_size_high for regular files · 06a279d6
      Theodore Ts'o authored
      Directories are not allowed to be bigger than 2GB, so don't use
      i_size_high for anything other than regular files.  E2fsck should
      complain about these inodes, but the simplest thing to do for the
      kernel is to only use i_size_high for regular files.
      This prevents an intentially corrupted filesystem from causing the
      kernel to burn a huge amount of CPU and issuing error messages such
      EXT4-fs warning (device loop0): ext4_block_to_path: block 135090028 > max
      Thanks to David Maciejak from Fortinet's FortiGuard Global Security
      Research Team for reporting this issue.
      Signed-off-by: default avatar"Theodore Ts'o" <>
  7. 06 Jan, 2009 1 commit
  8. 04 Jan, 2009 2 commits
    • Nick Piggin's avatar
      fs: symlink write_begin allocation context fix · 54566b2c
      Nick Piggin authored
      With the write_begin/write_end aops, page_symlink was broken because it
      could no longer pass a GFP_NOFS type mask into the point where the
      allocations happened.  They are done in write_begin, which would always
      assume that the filesystem can be entered from reclaim.  This bug could
      cause filesystem deadlocks.
      The funny thing with having a gfp_t mask there is that it doesn't really
      allow the caller to arbitrarily tinker with the context in which it can be
      called.  It couldn't ever be GFP_ATOMIC, for example, because it needs to
      take the page lock.  The only thing any callers care about is __GFP_FS
      anyway, so turn that into a single flag.
      Add a new flag for write_begin, AOP_FLAG_NOFS.  Filesystems can now act on
      this flag in their write_begin function.  Change __grab_cache_page to
      accept a nofs argument as well, to honour that flag (while we're there,
      change the name to grab_cache_page_write_begin which is more instructive
      and does away with random leading underscores).
      This is really a more flexible way to go in the end anyway -- if a
      filesystem happens to want any extra allocations aside from the pagecache
      ones in ints write_begin function, it may now use GFP_KERNEL (rather than
      GFP_NOFS) for common case allocations (eg.  ocfs2_alloc_write_ctxt, for a
      random example).
      [ fix ubifs]
      [ fix fuse]
      Signed-off-by: default avatarNick Piggin <>
      Reviewed-by: default avatarKOSAKI Motohiro <>
      Cc: <>		[2.6.28.x]
      Signed-off-by: default avatarKOSAKI Motohiro <>
      Signed-off-by: default avatarAndrew Morton <>
      [ Cleaned up the calling convention: just pass in the AOP flags
        untouched to the grab_cache_page_write_begin() function.  That
        just simplifies everybody, and may even allow future expansion of the
        logic.   - Linus ]
      Signed-off-by: default avatarLinus Torvalds <>
    • Theodore Ts'o's avatar
      ext4: Add markers for better debuggability · ba80b101
      Theodore Ts'o authored
      Signed-off-by: default avatar"Theodore Ts'o" <>
  9. 06 Jan, 2009 1 commit
  10. 31 Dec, 2008 1 commit
  11. 07 Nov, 2008 1 commit
  12. 22 Nov, 2008 1 commit
  13. 06 Nov, 2008 1 commit
    • Theodore Ts'o's avatar
      ext4: calculate journal credits correctly · ac51d837
      Theodore Ts'o authored
      This fixes a 2.6.27 regression which was introduced in commit a02908f1.
      We weren't passing the chunk parameter down to the two subections,
      ext4_indirect_trans_blocks() and ext4_ext_index_trans_blocks(), with
      the result that massively overestimate the amount of credits needed by
      ext4_da_writepages, especially in the non-extents case.  This causes
      failures especially on /boot partitions, which tend to be small and
      non-extent using since GRUB doesn't handle extents.
      This patch fixes the bug reported by Joseph Fannin at:
      Signed-off-by: default avatar"Theodore Ts'o" <>
  14. 05 Nov, 2008 1 commit
    • Theodore Ts'o's avatar
      ext4: Change unsigned long to unsigned int · 498e5f24
      Theodore Ts'o authored
      Convert the unsigned longs that are most responsible for bloating the
      stack usage on 64-bit systems.
      Nearly all places in the ext3/4 code which uses "unsigned long" is
      probably a bug, since on 32-bit systems a ulong a 32-bits, which means
      we are wasting stack space on 64-bit systems.
      Signed-off-by: default avatar"Theodore Ts'o" <>
  15. 07 Jan, 2009 1 commit
    • Frank Mayhar's avatar
      ext4: Allow ext4 to run without a journal · 0390131b
      Frank Mayhar authored
      A few weeks ago I posted a patch for discussion that allowed ext4 to run
      without a journal.  Since that time I've integrated the excellent
      comments from Andreas and fixed several serious bugs.  We're currently
      running with this patch and generating some performance numbers against
      both ext2 (with backported reservations code) and ext4 with and without
      a journal.  It just so happens that running without a journal is
      slightly faster for most everything.
      We did
      	iozone -T -t 4 s 2g -r 256k -T -I -i0 -i1 -i2
      which creates 4 threads, each of which create and do reads and writes on
      a 2G file, with a buffer size of 256K, using O_DIRECT for all file opens
      to bypass the page cache.  Results:
                           ext2        ext4, default   ext4, no journal
        initial writes   13.0 MB/s        15.4 MB/s          15.7 MB/s
        rewrites         13.1 MB/s        15.6 MB/s          15.9 MB/s
        reads            15.2 MB/s        16.9 MB/s          17.2 MB/s
        re-reads         15.3 MB/s        16.9 MB/s          17.2 MB/s
        random readers    5.6 MB/s         5.6 MB/s           5.7 MB/s
        random writers    5.1 MB/s         5.3 MB/s           5.4 MB/s 
      So it seems that, so far, this was a useful exercise.
      Signed-off-by: default avatarFrank Mayhar <>
      Signed-off-by: default avatar"Theodore Ts'o" <>
  16. 06 Jan, 2009 1 commit
  17. 05 Nov, 2008 1 commit
    • Theodore Ts'o's avatar
      ext4: tone down ext4_da_writepages warnings · 2a21e37e
      Theodore Ts'o authored
      If the filesystem has errors, ext4_da_writepages() will return a *lot*
      of errors, including lots and lots of stack dumps.  While it's true
      that we are dropping user data on the floor, which is unfortunate, the
      stack dumps aren't helpful, and they tend to obscure the true original
      root cause of the problem.  So in the case where the filesystem has
      aborted, return an EROFS right away.
      Signed-off-by: default avatar"Theodore Ts'o" <>
  18. 02 Jan, 2009 1 commit
  19. 29 Oct, 2008 1 commit
  20. 17 Oct, 2008 1 commit
  21. 16 Oct, 2008 1 commit
  22. 14 Oct, 2008 1 commit
  23. 11 Oct, 2008 1 commit
  24. 07 Oct, 2008 1 commit
  25. 10 Oct, 2008 2 commits
  26. 13 Sep, 2008 2 commits
  27. 09 Sep, 2008 2 commits
  28. 09 Oct, 2008 1 commit
  29. 10 Oct, 2008 1 commit
  30. 09 Sep, 2008 1 commit
  31. 09 Oct, 2008 1 commit
    • Aneesh Kumar K.V's avatar
      ext4: Make sure all the block allocation paths reserve blocks · a30d542a
      Aneesh Kumar K.V authored
      With delayed allocation we need to make sure block are reserved before
      we attempt to allocate them. Otherwise we get block allocation failure
      (ENOSPC) during writepages which cannot be handled. This would mean
      silent data loss (We do a printk stating data will be lost). This patch
      updates the DIO and fallocate code path to do block reservation before
      block allocation. This is needed to make sure parallel DIO and fallocate
      request doesn't take block out of delayed reserve space.
      When free blocks count go below a threshold we switch to a slow patch
      which looks at other CPU's accumulated percpu counter values.
      Signed-off-by: default avatarAneesh Kumar K.V <>
      Signed-off-by: default avatar"Theodore Ts'o" <>
  32. 20 Aug, 2008 1 commit
  33. 09 Sep, 2008 1 commit
  34. 03 Aug, 2008 1 commit
  35. 28 Jul, 2008 1 commit
    • Hisashi Hifumi's avatar
      vfs: pagecache usage optimization for pagesize!=blocksize · 8ab22b9a
      Hisashi Hifumi authored
      When we read some part of a file through pagecache, if there is a
      pagecache of corresponding index but this page is not uptodate, read IO
      is issued and this page will be uptodate.
      I think this is good for pagesize == blocksize environment but there is
      room for improvement on pagesize != blocksize environment.  Because in
      this case a page can have multiple buffers and even if a page is not
      uptodate, some buffers can be uptodate.
      So I suggest that when all buffers which correspond to a part of a file
      that we want to read are uptodate, use this pagecache and copy data from
      this pagecache to user buffer even if a page is not uptodate.  This can
      reduce read IO and improve system throughput.
      I wrote a benchmark program and got result number with this program.
      This benchmark do:
        1: mount and open a test file.
        2: create a 512MB file.
        3: close a file and umount.
        4: mount and again open a test file.
        5: pwrite randomly 300000 times on a test file.  offset is aligned
           by IO size(1024bytes).
        6: measure time of preading randomly 100000 times on a test file.
      The result was:
              330 sec
              226 sec
      Blocksize:1024 bytes
      Memory: 1GB
      On ext3/4, a file is written through buffer/block.  So random read/write
      mixed workloads or random read after random write workloads are optimized
      with this patch under pagesize != blocksize environment.  This test result
      showed this.
      The benchmark program is as follows:
      #include <stdio.h>
      #include <sys/types.h>
      #include <sys/stat.h>
      #include <fcntl.h>
      #include <unistd.h>
      #include <time.h>
      #include <stdlib.h>
      #include <string.h>
      #include <sys/mount.h>
      #define LEN 1024
      #define LOOP 1024*512 /* 512MB */
      	unsigned long i, offset, filesize;
      	int fd;
      	char buf[LEN];
      	time_t t1, t2;
      	if (mount("/dev/sda1", "/root/test1/", "ext3", 0, 0) < 0) {
      		perror("cannot mount\n");
      	memset(buf, 0, LEN);
      	fd = open("/root/test1/testfile", O_CREAT|O_RDWR|O_TRUNC);
      	if (fd < 0) {
      		perror("cannot open file\n");
      	for (i = 0; i < LOOP; i++)
      		write(fd, buf, LEN);
      	if (umount("/root/test1/") < 0) {
      		perror("cannot umount\n");
      	if (mount("/dev/sda1", "/root/test1/", "ext3", 0, 0) < 0) {
      		perror("cannot mount\n");
      	fd = open("/root/test1/testfile", O_RDWR);
      	if (fd < 0) {
      		perror("cannot open file\n");
      	filesize = LEN * LOOP;
      	for (i = 0; i < 300000; i++){
      		offset = (random() % filesize) & (~(LEN - 1));
      		pwrite(fd, buf, LEN, offset);
      	printf("start test\n");
      	for (i = 0; i < 100000; i++){
      		offset = (random() % filesize) & (~(LEN - 1));
      		pread(fd, buf, LEN, offset);
      	printf("%ld sec\n", t2-t1);
      	if (umount("/root/test1/") < 0) {
      		perror("cannot umount\n");
      Signed-off-by: default avatarHisashi Hifumi <>
      Cc: Nick Piggin <>
      Cc: Christoph Hellwig <>
      Cc: Jan Kara <>
      Cc: <>
      Signed-off-by: default avatarAndrew Morton <>
      Signed-off-by: default avatarLinus Torvalds <>
  36. 18 Aug, 2008 1 commit