04 Jan, 2012

1 commit


11 Jan, 2011

1 commit

  • The addition of 64k block capability in the rec_len_from_disk
    and rec_len_to_disk functions added a bit of math overhead which
    slows down file create workloads needlessly when the architecture
    cannot even support 64k blocks, thanks to page size limits.

    The directory entry checking can also be optimized a bit
    by sprinkling in some unlikely() conditions to move the
    error handling out of line.

    bonnie++ sequential file creates on a 512MB ramdisk speeds up
    from about 2200/s to about 2500/s, about a 14% improvement.

    Signed-off-by: Eric Sandeen
    Signed-off-by: Jan Kara

    Eric Sandeen
     

26 Oct, 2010

1 commit

  • Add a new helper to write out the inode using the writeback code,
    that is including the correct dirty bit and list manipulation. A few
    of filesystems already opencode this, and a lot of others should be
    using it instead of using write_inode_now which also writes out the
    data.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

10 Aug, 2010

2 commits

  • Split up the block_write_begin implementation - __block_write_begin is a new
    trivial wrapper for block_prepare_write that always takes an already
    allocated page and can be either called from block_write_begin or filesystem
    code that already has a page allocated. Remove the handling of already
    allocated pages from block_write_begin after switching all callers that
    do it to __block_write_begin.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     
  • For filesystem that implement directories in pagecache we call
    block_write_begin with an already allocated page for this code, while the
    normal regular file write path uses the default block_write_begin behaviour.

    Get rid of the __foofs_write_begin helper and opencode the normal write_begin
    call in foofs_write_begin, while adding a new foofs_prepare_chunk helper for
    the directory code. The added benefit is that foofs_prepare_chunk has
    a much saner calling convention.

    Note that the interruptible flag passed into block_write_begin is always
    ignored if we already pass in a page (see next patch for details), and
    we never were doing truncations of exessive blocks for this case either so we
    can switch directly to block_write_begin_newtrunc.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

16 Dec, 2009

1 commit

  • When an IO error happens while writing metadata buffers, we should better
    report it and call ext2_error since the filesystem is probably no longer
    consistent. Sometimes such IO errors happen while flushing thread does
    background writeback, the buffer gets later evicted from memory, and thus
    the only trace of the error remains as AS_EIO bit set in blockdevice's
    mapping. So we check this bit in ext2_fsync and report the error although
    we cannot be really sure which buffer we failed to write.

    Signed-off-by: Jan Kara
    Cc: Chris Mason
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     

10 Dec, 2009

1 commit


19 Jun, 2009

1 commit

  • One of our users is complaining that his backup tool is upset on ext2
    (while it's happy on ext3, xfs, ...) because of the mtime change.

    The problem is:

    mkdir foo
    mkdir bar
    mkdir foo/a

    Now under ext2:
    mv foo/a foo/b

    changes mtime of 'foo/a' (foo/b after the move). That does not really
    make sense and it does not happen under any other filesystem I've seen.

    More complicated is:
    mv foo/a bar/a

    This changes mtime of foo/a (bar/a after the move) and it makes some
    sense since we had to update parent directory pointer of foo/a. But
    again, no other filesystem does this. So after some thoughts I'd vote
    for consistency and change ext2 to behave the same as other filesystems.

    Do not update mtime of a moved directory. Specs don't say anything
    about it (neither that it should, nor that it should not be updated) and
    other common filesystems (ext3, ext4, xfs, reiserfs, fat, ...) don't do
    it. So let's become more consistent.

    Spotted by ronny.pretzsch@dfs.de, initial fix by Jörn Engel.

    Reported-by:
    Cc:
    Cc: Jörn Engel
    Signed-off-by: Jan Kara
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     

12 Jun, 2009

1 commit


16 Jan, 2009

1 commit

  • We used to just write changed page for IS_DIRSYNC inodes. But we also
    have to update the directory inode itself just for the case that we've
    allocated a new block and changed i_size.

    [akpm@linux-foundation.org: still sync the data page]
    Signed-off-by: Jan Kara
    Tested-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     

23 Oct, 2008

1 commit


17 Oct, 2008

1 commit

  • A very large directory with many read failures (either due to storage
    problems, or due to invalid size & blocks from corruption) will generate a
    printk storm as the filesystem continues to try to read all the blocks.
    This flood of messages can tie up the box until it is complete - which may
    be a very long time, especially for very large corrupted values.

    This is fixed by only reporting the corruption once each time we try to
    read the directory.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Eric Sandeen
    Signed-off-by: "Theodore Ts'o"
    Cc: Eugene Teo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sandeen
     

28 Apr, 2008

3 commits

  • __FUNCTION__ is gcc-specific, use __func__

    Signed-off-by: Harvey Harrison
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • if (...) BUG(); should be replaced with BUG_ON(...) when the test has no
    side-effects to allow a definition of BUG_ON that drops the code completely.

    The semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @ disable unlikely @ expression E,f; @@

    (
    if () { BUG(); }
    |
    - if (unlikely(E)) { BUG(); }
    + BUG_ON(E);
    )

    @@ expression E,f; @@

    (
    if () { BUG(); }
    |
    - if (E) { BUG(); }
    + BUG_ON(E);
    )
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Improve ext2_readdir() return value for ext2_get_page() failure by using the
    actual result of ext2_get_page().

    Signed-off-by: Akinobu Mita
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

07 Feb, 2008

1 commit


22 Oct, 2007

1 commit

  • With 64KB blocksize, a directory entry can have size 64KB which does not
    fit into 16 bits we have for entry length. So we store 0xffff instead and
    convert the value when read from / written to disk.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Jan Kara
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     

17 Oct, 2007

1 commit


09 May, 2007

1 commit


08 May, 2007

1 commit

  • Ensure pages are uptodate after returning from read_cache_page, which allows
    us to cut out most of the filesystem-internal PageUptodate calls.

    I didn't have a great look down the call chains, but this appears to fixes 7
    possible use-before uptodate in hfs, 2 in hfsplus, 1 in jfs, a few in
    ecryptfs, 1 in jffs2, and a possible cleared data overwritten with readpage in
    block2mtd. All depending on whether the filler is async and/or can return
    with a !uptodate page.

    Signed-off-by: Nick Piggin
    Cc: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

12 Feb, 2007

1 commit

  • This one was pointed out on the MOKB site:
    http://kernelfun.blogspot.com/2006/11/mokb-09-11-2006-linux-26x-ext2checkpage.html

    If a directory's i_size is corrupted, ext2_find_entry() will keep
    processing pages until the i_size is reached, even if there are no more
    blocks associated with the directory inode. This patch puts in some
    minimal sanity-checking so that we don't keep checking pages (and issuing
    errors) if we know there can be no more data to read, based on the block
    count of the directory inode.

    This is somewhat similar in approach to the ext3 patch I sent earlier this
    year.

    Signed-off-by: Eric Sandeen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sandeen
     

09 Dec, 2006

1 commit


01 Oct, 2006

1 commit


26 Jun, 2006

1 commit


23 Jun, 2006

1 commit

  • Add read_mapping_page() which is used for callers that pass
    mapping->a_ops->readpage as the filler for read_cache_page. This removes
    some duplication from filesystem code.

    Signed-off-by: Pekka Enberg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pekka Enberg
     

29 Mar, 2006

1 commit

  • This is a conversion to make the various file_operations structs in fs/
    const. Basically a regexp job, with a few manual fixups

    The goal is both to increase correctness (harder to accidentally write to
    shared datastructures) and reducing the false sharing of cachelines with
    things that get dirty in .data (while .rodata is nicely read only and thus
    cache clean)

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

27 Mar, 2006

1 commit


16 Mar, 2006

1 commit

  • This fixes not one, but _two_, silly (but admittedly hard to hit) bugs
    in the ext2 filesystem "readdir()" function. It also cleans up the code
    to avoid the unnecessary goto mess.

    The bugs were related to re-valiating the f_pos value after somebody had
    either done an "lseek()" on the directory to an invalid offset, or when
    the offset had become invalid due to a file being unlinked in the
    directory. The code would not only set the f_version too eagerly, it
    would also not update f_pos appropriately for when the offset fixup took
    place.

    When that happened, we'd occasionally subsequently fail the readdir()
    even when we shouldn't (no real harm done, but an ugly printk, and
    obviously you would end up not necessarily seeing all entries).

    Thanks to Masoud Sharbiani who noticed the problem
    and had a test-case for it, and also fixed up a thinko in the first
    version of this patch.

    Signed-off-by: Al Viro
    Acked-by: Masoud Sharbiani
    Signed-off-by: Linus Torvalds

    Al Viro
     

11 Jan, 2006

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds