1. 02 Jun, 2014 1 commit
    • Zheng Liu's avatar
      ext4: handle symlink properly with inline_data · bd9db175
      Zheng Liu authored
      This commit tries to fix a bug that we can't read symlink properly with
      inline data feature when the length of symlink is greater than 60 bytes
      but less than extra space.
      
      The key issue is in ext4_inode_is_fast_symlink() that it doesn't check
      whether or not an inode has inline data.  When the user creates a new
      symlink, an inode will be allocated with MAY_INLINE_DATA flag.  Then
      symlink will be stored in ->i_block and extended attribute space.  In
      the mean time, this inode is with inline data flag.  After remounting
      it, ext4_inode_is_fast_symlink() function thinks that this inode is a
      fast symlink so that the data in ->i_block is copied to the user, and
      the data in extra space is trimmed.  In fact this inode should be as a
      normal symlink.
      
      The following script can hit this bug.
      
        #!/bin/bash
      
        cd ${MNT}
        filename=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
        rm -rf test
        mkdir test
        cd test
        echo "hello" >$filename
        ln -s $filename symlinkfile
        cd
        sudo umount /mnt/sda1
        sudo mount -t ext4 /dev/sda1 /mnt/sda1
        readlink /mnt/sda1/test/symlinkfile
      
      After applying this patch, it will break the assumption in e2fsck
      because the original implementation doesn't want to support symlink
      with inline data.
      Reported-by: default avatar"Darrick J. Wong" <darrick.wong@oracle.com>
      Reported-by: default avatarIan Nartowicz <claws@nartowicz.co.uk>
      Cc: Ian Nartowicz <claws@nartowicz.co.uk>
      Cc: Tao Ma <tm@tao.ma>
      Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Signed-off-by: default avatarZheng Liu <wenqing.lz@taobao.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      bd9db175
  2. 27 May, 2014 4 commits
  3. 26 May, 2014 2 commits
  4. 13 May, 2014 2 commits
  5. 12 May, 2014 8 commits
  6. 21 Apr, 2014 9 commits
    • Dmitry Monakhov's avatar
      ext4: remove obsoleted check · 236f5ecb
      Dmitry Monakhov authored
      BH can not be NULL at this point, ext4_read_dirblock() always return
      non null value, and we already have done all necessery checks.
      Signed-off-by: default avatarDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      236f5ecb
    • Theodore Ts'o's avatar
      ext4: add a new spinlock i_raw_lock to protect the ext4's raw inode · 202ee5df
      Theodore Ts'o authored
      To avoid potential data races, use a spinlock which protects the raw
      (on-disk) inode.
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      202ee5df
    • Theodore Ts'o's avatar
      ext4: fix locking for O_APPEND writes · f5ccfe1d
      Theodore Ts'o authored
      Al Viro pointed out that locking for O_APPEND writes was problematic,
      since the location of the write isn't known until after we take the
      i_mutex, which impacts the ext4_unaligned_aio() and s_bitmap_maxbytes
      check.
      
      For O_APPEND always assume that the write is unaligned so call
      ext4_unwritten_wait().  And to solve the second problem, take the
      i_mutex earlier before we start the s_bitmap_maxbytes check.
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      f5ccfe1d
    • Theodore Ts'o's avatar
      ext4: factor out common code in ext4_file_write() · 7ed07ba8
      Theodore Ts'o authored
      This shouldn't change any logic flow; just delete duplicated code.
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      7ed07ba8
    • Theodore Ts'o's avatar
      ext4: move ext4_file_dio_write() into ext4_file_write() · 8ad2850f
      Theodore Ts'o authored
      This commit doesn't actually change anything; it just moves code
      around in preparation for some code simplification work.
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      8ad2850f
    • Theodore Ts'o's avatar
      ext4: inline generic_file_aio_write() into ext4_file_write() · 7608e610
      Theodore Ts'o authored
      Copy generic_file_aio_write() into ext4_file_write().  This is part of
      a patch series which allows us to simplify ext4_file_write() and
      ext4_file_dio_write(), by calling __generic_file_aio_write() directly.
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      7608e610
    • Lukas Czerner's avatar
      ext4: rename uninitialized extents to unwritten · 556615dc
      Lukas Czerner authored
      Currently in ext4 there is quite a mess when it comes to naming
      unwritten extents. Sometimes we call it uninitialized and sometimes we
      refer to it as unwritten.
      
      The right name for the extent which has been allocated but does not
      contain any written data is _unwritten_. Other file systems are
      using this name consistently, even the buffer head state refers to it as
      unwritten. We need to fix this confusion in ext4.
      
      This commit changes every reference to an uninitialized extent (meaning
      allocated but unwritten) to unwritten extent. This includes comments,
      function names and variable names. It even covers abbreviation of the
      word uninitialized (such as uninit) and some misspellings.
      
      This commit does not change any of the code paths at all. This has been
      confirmed by comparing md5sums of the assembly code of each object file
      after all the function names were stripped from it.
      Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      556615dc
    • Lukas Czerner's avatar
      ext4: get rid of EXT4_MAP_UNINIT flag · 090f32ee
      Lukas Czerner authored
      Currently EXT4_MAP_UNINIT is used in dioread_nolock case to mark the
      cases where we're using dioread_nolock and we're writing into either
      unallocated, or unwritten extent, because we need to make sure that
      any DIO write into that inode will wait for the extent conversion.
      
      However EXT4_MAP_UNINIT is not only entirely misleading name but also
      unnecessary because we can check for EXT4_MAP_UNWRITTEN in the
      dioread_nolock case instead.
      
      This commit removes EXT4_MAP_UNINIT flag.
      Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      090f32ee
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 9ac03675
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "These are regression and bug fixes for ext4.
      
        We had a number of new features in ext4 during this merge window
        (ZERO_RANGE and COLLAPSE_RANGE fallocate modes, renameat, etc.) so
        there were many more regression and bug fixes this time around.  It
        didn't help that xfstests hadn't been fully updated to fully stress
        test COLLAPSE_RANGE until after -rc1"
      
      * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (31 commits)
        ext4: disable COLLAPSE_RANGE for bigalloc
        ext4: fix COLLAPSE_RANGE failure with 1KB block size
        ext4: use EINVAL if not a regular file in ext4_collapse_range()
        ext4: enforce we are operating on a regular file in ext4_zero_range()
        ext4: fix extent merging in ext4_ext_shift_path_extents()
        ext4: discard preallocations after removing space
        ext4: no need to truncate pagecache twice in collapse range
        ext4: fix removing status extents in ext4_collapse_range()
        ext4: use filemap_write_and_wait_range() correctly in collapse range
        ext4: use truncate_pagecache() in collapse range
        ext4: remove temporary shim used to merge COLLAPSE_RANGE and ZERO_RANGE
        ext4: fix ext4_count_free_clusters() with EXT4FS_DEBUG and bigalloc enabled
        ext4: always check ext4_ext_find_extent result
        ext4: fix error handling in ext4_ext_shift_extents
        ext4: silence sparse check warning for function ext4_trim_extent
        ext4: COLLAPSE_RANGE only works on extent-based files
        ext4: fix byte order problems introduced by the COLLAPSE_RANGE patches
        ext4: use i_size_read in ext4_unaligned_aio()
        fs: disallow all fallocate operation on active swapfile
        fs: move falloc collapse range check into the filesystem methods
        ...
      9ac03675
  7. 20 Apr, 2014 5 commits
  8. 19 Apr, 2014 9 commits