15 May, 2008

1 commit

  • This fix the uninitialized bs when we try to replace a xattr entry in
    ibody with the new value which require more than free space.

    This situation only happens we format ext3/4 with inode size more than 128 and
    we have put xattr entries both in ibody and block. The consequences about
    this bug is we will lost the xattr block which pointed by i_file_acl with all
    xattr entires in it. We will alloc a new xattr block and put that large value
    entry in it. The old xattr block will become orphan block.

    Signed-off-by: Tiger Yang
    Cc:
    Cc: Andreas Gruenbacher
    Acked-by: Andreas Dilger
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tiger Yang
     

30 Apr, 2008

1 commit


28 Apr, 2008

14 commits

  • __FUNCTION__ is gcc-specific, use __func__

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

    Harvey Harrison
     
  • When quota is disabled, we should not print 'journaled quota not supported'
    when user tried to mount non-journaled quota. Also fix typo in the message.

    Signed-off-by: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     
  • If the block allocator gets blocks out of system zone ext3 calls ext3_error.
    But if the file system is mounted with errors=continue retry block allocation.
    We need to mark the system zone blocks as in use to make sure retry don't
    pick them again

    System zone is the block range mapping block bitmap, inode bitmap and inode
    table.

    [akpm@linux-foundation.org: fix typo in comment]
    Signed-off-by: Aneesh Kumar K.V
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aneesh Kumar K.V
     
  • Call dquot_drop() from ext3_dquot_drop() even if we fail to start a
    transaction. Otherwise we never get to dropping references to quota
    structures from the inode and umount will hang indefinitely. Thanks to
    Payphone LIOU for spotting the problem.

    Signed-off-by: Jan Kara
    Cc: Payphone LIOU
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     
  • Make ext3 update mtime and ctime of the directory into which we move file even
    if the directory entry already exists.

    Signed-off-by: Jan Kara
    Cc: Al Viro
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     
  • 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
     
  • Check ext3_journal_get_write_access() errors.

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

    Akinobu Mita
     
  • Use ext3_get_group_desc()

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

    Akinobu Mita
     
  • Add missing ext3_journal_stop() in error handling.

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

    Akinobu Mita
     
  • Use ext3_group_first_block_no()

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

    Akinobu Mita
     
  • Make the needlessly global ext3_xattr_list() static.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Convert byte order of constant instead of variable which can be done at
    compile time (vs run time).

    Signed-off-by: Marcin Slusarz
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcin Slusarz
     
  • Currently fdatasync is identical to fsync in ext3.

    I think fdatasync should skip journal flush in data=ordered and
    data=writeback mode when it overwrites to already-instantiated blocks on
    HDD. When I_DIRTY_DATASYNC flag is not set, fdatasync should skip journal
    writeout because this indicates only atime or/and mtime updates.

    Following patch is the same approach of ext2's fsync code(ext2_sync_file).

    I did a performance test using the sysbench.

    #sysbench --num-threads=128 --max-requests=50000 --test=fileio --file-total-size=128G
    --file-test-mode=rndwr --file-fsync-mode=fdatasync run

    The result on ext3 was:

    -2.6.24
    Operations performed: 0 Read, 50080 Write, 59600 Other = 109680 Total
    Read 0b Written 782.5Mb Total transferred 782.5Mb (12.116Mb/sec)
    775.45 Requests/sec executed

    Test execution summary:
    total time: 64.5814s
    total number of events: 50080
    total time taken by event execution: 3713.9836
    per-request statistics:
    min: 0.0000s
    avg: 0.0742s
    max: 0.9375s
    approx. 95 percentile: 0.2901s

    Threads fairness:
    events (avg/stddev): 391.2500/23.26
    execution time (avg/stddev): 29.0155/1.99

    -2.6.24-patched
    Operations performed: 0 Read, 50009 Write, 61596 Other = 111605 Total
    Read 0b Written 781.39Mb Total transferred 781.39Mb (16.419Mb/sec)
    1050.83 Requests/sec executed

    Test execution summary:
    total time: 47.5900s
    total number of events: 50009
    total time taken by event execution: 2934.5768
    per-request statistics:
    min: 0.0000s
    avg: 0.0587s
    max: 0.8938s
    approx. 95 percentile: 0.1993s

    Threads fairness:
    events (avg/stddev): 390.6953/22.64
    execution time (avg/stddev): 22.9264/1.17

    Filesystem I/O throughput was improved.

    Signed-off-by :Hisashi Hifumi
    Acked-by: Jan Kara
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hisashi Hifumi
     
  • Update ext3 handle quotaon on remount RW.

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

    Jan Kara
     

22 Apr, 2008

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/juhl/trivial: (24 commits)
    DOC: A couple corrections and clarifications in USB doc.
    Generate a slightly more informative error msg for bad HZ
    fix typo "is" -> "if" in Makefile
    ext*: spelling fix prefered -> preferred
    DOCUMENTATION: Use newer DEFINE_SPINLOCK macro in docs.
    KEYS: Fix the comment to match the file name in rxrpc-type.h.
    RAID: remove trailing space from printk line
    DMA engine: typo fixes
    Remove unused MAX_NODES_SHIFT
    MAINTAINERS: Clarify access to OCFS2 development mailing list.
    V4L: Storage class should be before const qualifier (sn9c102)
    V4L: Storage class should be before const qualifier
    sonypi: Storage class should be before const qualifier
    intel_menlow: Storage class should be before const qualifier
    DVB: Storage class should be before const qualifier
    arm: Storage class should be before const qualifier
    ALSA: Storage class should be before const qualifier
    acpi: Storage class should be before const qualifier
    firmware_sample_driver.c: fix coding style
    MAINTAINERS: Add ati_remote2 driver
    ...

    Fixed up trivial conflicts in firmware_sample_driver.c

    Linus Torvalds
     
  • Spelling fix: prefered -> preferred

    Signed-off-by: Benoit Boissinot
    Signed-off-by: Jesper Juhl

    Benoit Boissinot
     

19 Apr, 2008

1 commit


16 Apr, 2008

1 commit

  • mb_cache_entry_alloc() was allocating cache entries with GFP_KERNEL. But
    filesystems are calling this function while holding xattr_sem so possible
    recursion into the fs violates locking ordering of xattr_sem and transaction
    start / i_mutex for ext2-4. Change mb_cache_entry_alloc() so that filesystems
    can specify desired gfp mask and use GFP_NOFS from all of them.

    Signed-off-by: Jan Kara
    Reported-by: Dave Jones
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     

20 Mar, 2008

1 commit

  • There are several places where we make allocations with GFP_KERNEL while under
    a transaction, which could lead to an assertion panic or lockup if under
    memory pressure. This patch switches these problem areas to use GFP_NOFS to
    keep these problems from happening.

    Signed-off-by: Josef Bacik
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josef Bacik
     

05 Mar, 2008

1 commit

  • The "resize" option won't be noticed as it comes after the NULL option, so if
    you try to mount (or in this case remount) with that option it won't be
    recognized.

    Signed-off-by: Josef Bacik
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josef Bacik
     

15 Feb, 2008

2 commits

  • * Add path_put() functions for releasing a reference to the dentry and
    vfsmount of a struct path in the right order

    * Switch from path_release(nd) to path_put(&nd->path)

    * Rename dput_path() to path_put_conditional()

    [akpm@linux-foundation.org: fix cifs]
    Signed-off-by: Jan Blunck
    Signed-off-by: Andreas Gruenbacher
    Acked-by: Christoph Hellwig
    Cc:
    Cc: Al Viro
    Cc: Steven French
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Blunck
     
  • This is the central patch of a cleanup series. In most cases there is no good
    reason why someone would want to use a dentry for itself. This series reflects
    that fact and embeds a struct path into nameidata.

    Together with the other patches of this series
    - it enforced the correct order of getting/releasing the reference count on
    pairs
    - it prepares the VFS for stacking support since it is essential to have a
    struct path in every place where the stack can be traversed
    - it reduces the overall code size:

    without patch series:
    text data bss dec hex filename
    5321639 858418 715768 6895825 6938d1 vmlinux

    with patch series:
    text data bss dec hex filename
    5320026 858418 715768 6894212 693284 vmlinux

    This patch:

    Switch from nd->{dentry,mnt} to nd->path.{dentry,mnt} everywhere.

    [akpm@linux-foundation.org: coding-style fixes]
    [akpm@linux-foundation.org: fix cifs]
    [akpm@linux-foundation.org: fix smack]
    Signed-off-by: Jan Blunck
    Signed-off-by: Andreas Gruenbacher
    Acked-by: Christoph Hellwig
    Cc: Al Viro
    Cc: Casey Schaufler
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Blunck
     

09 Feb, 2008

1 commit

  • replace all:
    little_endian_variable = cpu_to_leX(leX_to_cpu(little_endian_variable) +
    expression_in_cpu_byteorder);
    with:
    leX_add_cpu(&little_endian_variable, expression_in_cpu_byteorder);
    sparse didn't generate any new warning with this patch

    Signed-off-by: Marcin Slusarz
    Cc: Mark Fasheh
    Cc: David Chinner
    Cc: Timothy Shimmin
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marcin Slusarz
     

08 Feb, 2008

1 commit

  • Stop the EXT3 filesystem from using iget() and read_inode(). Replace
    ext3_read_inode() with ext3_iget(), and call that instead of iget().
    ext3_iget() then uses iget_locked() directly and returns a proper error code
    instead of an inode in the event of an error.

    ext3_fill_super() returns any error incurred when getting the root inode
    instead of EINVAL.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: David Howells
    Acked-by: "Theodore Ts'o"
    Acked-by: Jan Kara
    Cc:
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     

07 Feb, 2008

9 commits

  • We cannot start transaction in ext3_direct_IO() and just let it last during
    the whole write because dio_get_page() acquires mmap_sem which ranks above
    transaction start (e.g. because we have dependency chain
    mmap_sem->PageLock->journal_start, or because we update atime while holding
    mmap_sem) and thus deadlocks could happen. We solve the problem by
    starting a transaction separately for each ext3_get_block() call.

    We *could* have a problem that we allocate a block and before its data are
    written out the machine crashes and thus we expose stale data. But that
    does not happen because for hole-filling generic code falls back to
    buffered writes and for file extension, we add inode to orphan list and
    thus in case of crash, journal replay will truncate inode back to the
    original size.

    [akpm@linux-foundation.org: build fix]
    Signed-off-by: Jan Kara
    Cc:
    Cc: Zach Brown
    Cc: Badari Pulavarty
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     
  • Signed-off-by: Mariusz Kozlowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mariusz Kozlowski
     
  • Use ext[234]_bg_has_super() to remove duplicate code.

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

    Akinobu Mita
     
  • The argument chain for ext[234]_find_goal() is not used. This patch removes
    it and fixes comment as well.

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

    Akinobu Mita
     
  • Use ext[234]_get_group_desc() to get group descriptor from group number.

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

    Akinobu Mita
     
  • The comment in ext[234]_new_blocks() describes about "i". But there is no
    local variable called "i" in that scope. I guess it has been renamed to
    group_no.

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

    Akinobu Mita
     
  • ext3 file system was by default ignoring errors and continuing. This is
    not a good default as continuing on error could lead to file system
    corruption. Change the default to mark the file system readonly. Debian
    and ubuntu already does this as the default in their fstab.

    Signed-off-by: Aneesh Kumar K.V
    Cc:
    Cc: Eric Sandeen
    Cc: Jan Kara
    Cc: Dave Jones
    Cc: Chuck Ebbert
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aneesh Kumar K.V
     
  • This fixes some instances where we were continuing after calling
    ext3_error. ext3_error calls panic only if errors=panic mount option is
    set. So we need to make sure we return correctly after ext3_error call

    Signed-off-by: Aneesh Kumar K.V
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aneesh Kumar K.V
     
  • When a new block bitmap is read from disk in read_block_bitmap() there are a
    few bits that should ALWAYS be set. In particular, the blocks given
    corresponding to block bitmap, inode bitmap and inode tables. Validate the
    block bitmap against these blocks.

    Signed-off-by: Aneesh Kumar K.V
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aneesh Kumar K.V
     

06 Feb, 2008

1 commit

  • Simplify page cache zeroing of segments of pages through 3 functions

    zero_user_segments(page, start1, end1, start2, end2)

    Zeros two segments of the page. It takes the position where to
    start and end the zeroing which avoids length calculations and
    makes code clearer.

    zero_user_segment(page, start, end)

    Same for a single segment.

    zero_user(page, start, length)

    Length variant for the case where we know the length.

    We remove the zero_user_page macro. Issues:

    1. Its a macro. Inline functions are preferable.

    2. The KM_USER0 macro is only defined for HIGHMEM.

    Having to treat this special case everywhere makes the
    code needlessly complex. The parameter for zeroing is always
    KM_USER0 except in one single case that we open code.

    Avoiding KM_USER0 makes a lot of code not having to be dealing
    with the special casing for HIGHMEM anymore. Dealing with
    kmap is only necessary for HIGHMEM configurations. In those
    configurations we use KM_USER0 like we do for a series of other
    functions defined in highmem.h.

    Since KM_USER0 is depends on HIGHMEM the existing zero_user_page
    function could not be a macro. zero_user_* functions introduced
    here can be be inline because that constant is not used when these
    functions are called.

    Also extract the flushing of the caches to be outside of the kmap.

    [akpm@linux-foundation.org: fix nfs and ntfs build]
    [akpm@linux-foundation.org: fix ntfs build some more]
    Signed-off-by: Christoph Lameter
    Cc: Steven French
    Cc: Michael Halcrow
    Cc:
    Cc: Steven Whitehouse
    Cc: Trond Myklebust
    Cc: "J. Bruce Fields"
    Cc: Anton Altaparmakov
    Cc: Mark Fasheh
    Cc: David Chinner
    Cc: Michael Halcrow
    Cc: Steven French
    Cc: Steven Whitehouse
    Cc: Trond Myklebust
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

29 Jan, 2008

1 commit


18 Dec, 2007

1 commit

  • As it turns out, the kernel divides by EXT3_INODES_PER_GROUP(s) when
    mounting an ext3 filesystem. If that number is zero, a crash follows.
    Below a patch.

    This crash was reported by Joeri de Ruiter, Carst Tankink and Pim Vullers.

    Cc:
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andries E. Brouwer
     

15 Nov, 2007

2 commits

  • With 64KB blocksize, a directory entry can have size 64KB which does not
    fit into 16 bits we have for entry lenght. So we store 0xffff instead and
    convert value when read from / written to disk. The patch also converts
    some places to use ext3_next_entry() when we are changing them anyway.

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

    Jan Kara
     
  • Forbid user from changing file flags on quota files. User has no bussiness
    in playing with these flags when quota is on. Furthermore there is a
    remote possibility of deadlock due to a lock inversion between quota file's
    i_mutex and transaction's start (i_mutex for quota file is locked only when
    trasaction is started in quota operations) in ext3 and ext4.

    Signed-off-by: Jan Kara
    Cc: LIOU Payphone
    Cc:
    Acked-by: Dave Kleikamp
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara