18 Oct, 2011

1 commit


09 Oct, 2011

1 commit


10 Sep, 2011

1 commit


27 Jul, 2011

1 commit

  • Before this patch, parallel resizers are allowed and protected by a
    mutex lock, actually, there is no need to support parallel resizer, so
    this patch prevents parallel resizers by atmoic bit ops, like
    lock_page() and unlock_page() do.

    To do this, the patch removed the mutex lock s_resize_lock from struct
    ext4_sb_info and added a unsigned long field named s_resize_flags
    which inidicates if there is a resizer.

    Signed-off-by: Yongqiang Yang
    Signed-off-by: "Theodore Ts'o"

    Yongqiang Yang
     

26 Mar, 2011

1 commit

  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (43 commits)
    ext4: fix a BUG in mb_mark_used during trim.
    ext4: unused variables cleanup in fs/ext4/extents.c
    ext4: remove redundant set_buffer_mapped() in ext4_da_get_block_prep()
    ext4: add more tracepoints and use dev_t in the trace buffer
    ext4: don't kfree uninitialized s_group_info members
    ext4: add missing space in printk's in __ext4_grp_locked_error()
    ext4: add FITRIM to compat_ioctl.
    ext4: handle errors in ext4_clear_blocks()
    ext4: unify the ext4_handle_release_buffer() api
    ext4: handle errors in ext4_rename
    jbd2: add COW fields to struct jbd2_journal_handle
    jbd2: add the b_cow_tid field to journal_head struct
    ext4: Initialize fsync transaction ids in ext4_new_inode()
    ext4: Use single thread to perform DIO unwritten convertion
    ext4: optimize ext4_bio_write_page() when no extent conversion is needed
    ext4: skip orphan cleanup if fs has unknown ROCOMPAT features
    ext4: use the nblocks arg to ext4_truncate_restart_trans()
    ext4: fix missing iput of root inode for some mount error paths
    ext4: make FIEMAP and delayed allocation play well together
    ext4: suppress verbose debugging information if malloc-debug is off
    ...

    Fi up conflicts in fs/ext4/super.c due to workqueue changes

    Linus Torvalds
     

24 Mar, 2011

1 commit


21 Mar, 2011

1 commit


24 Feb, 2011

2 commits

  • Discard granularity tells us the minimum size of extent that can be
    discarded by the device. If the user supplies a minimum extent that
    should be discarded (range.minlen) which is smaller than the discard
    granularity, increase minlen to the discard granularity, since there's
    no point submitting trim requests that the device will reject anyway.

    Signed-off-by: Lukas Czerner
    Signed-off-by: "Theodore Ts'o"

    Lukas Czerner
     
  • For a device that does not support discard, the FITRIM ioctl returns
    -EOPNOTSUPP when blkdev_issue_discard() returns this error code, which
    is how the user is informed that the device does not support discard.

    If there are no suitable free extents to be trimmed, then FITRIM will
    return success even though the device does not support discard, which
    could confuse the user. So check explicitly if the device supports
    discard and return an error code at the beginning of the FITRIM ioctl
    processing.

    Signed-off-by: Lukas Czerner
    Signed-off-by: "Theodore Ts'o"

    Lukas Czerner
     

20 Nov, 2010

1 commit

  • Filesystem independent ioctl was rejected as not common enough to be in
    core vfs ioctl. Since we still need to access to this functionality this
    commit adds ext4 specific ioctl EXT4_IOC_TRIM to dispatch
    ext4_trim_fs().

    It takes fstrim_range structure as an argument. fstrim_range is definec in
    the include/linux/fs.h and its definition is as follows.

    struct fstrim_range {
    __u64 start;
    __u64 len;
    __u64 minlen;
    }

    start - first Byte to trim
    len - number of Bytes to trim from start
    minlen - minimum extent length to trim, free extents shorter than this
    number of Bytes will be ignored. This will be rounded up to fs
    block size.

    After the FITRIM is done, the number of actually discarded Bytes is stored
    in fstrim_range.len to give the user better insight on how much storage
    space has been really released for wear-leveling.

    Signed-off-by: Lukas Czerner
    Signed-off-by: "Theodore Ts'o"

    Lukas Czerner
     

17 May, 2010

2 commits


15 May, 2010

1 commit

  • I have an x86_64 kernel with i386 userspace. e4defrag fails on the
    EXT4_IOC_MOVE_EXT ioctl because it is not wired up for the compat
    case. It seems that struct move_extent is compat save, only types
    with fixed widths are used:
    {
    __u32 reserved; /* should be zero */
    __u32 donor_fd; /* donor file descriptor */
    __u64 orig_start; /* logical start offset in block for orig */
    __u64 donor_start; /* logical start offset in block for donor */
    __u64 len; /* block length to be moved */
    __u64 moved_len; /* moved block length */
    };

    Lets just wire up EXT4_IOC_MOVE_EXT for the compat case.

    Signed-off-by: Christian Borntraeger
    Signed-off-by: "Theodore Ts'o"
    Reviewed-by: Eric Sandeen
    CC: Akira Fujita

    Christian Borntraeger
     

04 Mar, 2010

1 commit


24 Feb, 2010

1 commit

  • fallocate() may potentially instantiate blocks past EOF, depending
    on the flags used when it is called.

    e2fsck currently has a test for blocks past i_size, and it
    sometimes trips up - noticeably on xfstests 013 which runs fsstress.

    This patch from Jiayang does fix it up - it (along with
    e2fsprogs updates and other patches recently from Aneesh) has
    survived many fsstress runs in a row.

    Signed-off-by: Eric Sandeen
    Signed-off-by: Jiaying Zhang
    Signed-off-by: "Theodore Ts'o"

    Jiaying Zhang
     

07 Dec, 2009

1 commit

  • This patch fixes three problems in the handling of the
    EXT4_IOC_MOVE_EXT ioctl:

    1. In current EXT4_IOC_MOVE_EXT, there are read access mode checks for
    original and donor files, but they allow the illegal write access to
    donor file, since donor file is overwritten by original file data. To
    fix this problem, change access mode checks of original (r->r/w) and
    donor (r->w) files.

    2. Disallow the use of donor files that have a setuid or setgid bits.

    3. Call mnt_want_write() and mnt_drop_write() before and after
    ext4_move_extents() calling to get write access to a mount.

    Signed-off-by: Akira Fujita
    Signed-off-by: "Theodore Ts'o"

    Akira Fujita
     

24 Nov, 2009

1 commit

  • The move_extent.moved_len is used to pass back the number of exchanged
    blocks count to user space. Currently the caller must clear this
    field; but we spend more code space checking for this requirement than
    simply zeroing the field ourselves, so let's just make life easier for
    everyone all around.

    Signed-off-by: Kazuya Mio
    Signed-off-by: Akira Fujita
    Signed-off-by: "Theodore Ts'o"

    Kazuya Mio
     

06 Sep, 2009

1 commit


14 Jul, 2009

1 commit

  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
    jbd2: fix race between write_metadata_buffer and get_write_access
    ext4: Fix ext4_mb_initialize_context() to initialize all fields
    ext4: fix null handler of ioctls in no journal mode
    ext4: Fix buffer head reference leak in no-journal mode
    ext4: Move __ext4_journalled_writepage() to avoid forward declaration
    ext4: Fix mmap/truncate race when blocksize < pagesize && !nodellaoc
    ext4: Fix mmap/truncate race when blocksize < pagesize && delayed allocation
    ext4: Don't look at buffer_heads outside i_size.
    ext4: Fix goal inum check in the inode allocator
    ext4: fix no journal corruption with locale-gen
    ext4: Calculate required journal credits for inserting an extent properly
    ext4: Fix truncation of symlinks after failed write
    jbd2: Fix a race between checkpointing code and journal_get_write_access()
    ext4: Use rcu_barrier() on module unload.
    ext4: naturally align struct ext4_allocation_request
    ext4: mark several more functions in mballoc.c as noinline
    ext4: Fix potential reclaim deadlock when truncating partial block
    jbd2: Remove GFP_ATOMIC kmalloc from inside spinlock critical region
    ext4: Fix type warning on 64-bit platforms in tracing events header

    Linus Torvalds
     

13 Jul, 2009

2 commits

  • The EXT4_IOC_GROUP_ADD and EXT4_IOC_GROUP_EXTEND ioctls should not
    flush the journal in no_journal mode. Otherwise, running resize2fs on
    a mounted no_journal partition triggers the following error messages:

    BUG: unable to handle kernel NULL pointer dereference at 00000014
    IP: [] _spin_lock+0x8/0x19
    *pde = 00000000
    Oops: 0002 [#1] SMP

    Signed-off-by: Peng Tao
    Signed-off-by: "Theodore Ts'o"

    Peng Tao
     
  • * Remove smp_lock.h from files which don't need it (including some headers!)
    * Add smp_lock.h to files which do need it
    * Make smp_lock.h include conditional in hardirq.h
    It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT

    This will make hardirq.h inclusion cheaper for every PREEMPT=n config
    (which includes allmodconfig/allyesconfig, BTW)

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

18 Jun, 2009

1 commit

  • The EXT4_IOC_MOVE_EXT exchanges the blocks between orig_fd and donor_fd,
    and then write the file data of orig_fd to donor_fd.
    ext4_mext_move_extent() is the main fucntion of ext4 online defrag,
    and this patch includes all functions related to ext4 online defrag.

    Signed-off-by: Akira Fujita
    Signed-off-by: Takashi Sato
    Signed-off-by: Kazuya Mio
    Signed-off-by: "Theodore Ts'o"

    Akira Fujita
     

26 Feb, 2009

1 commit

  • Add an ioctl which forces all of the delay allocated blocks to be
    allocated. This also provides a function ext4_alloc_da_blocks() which
    will be used by the following commits to force files to be fully
    allocated to preserve application-expected ext3 behaviour.

    Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     

16 Feb, 2009

1 commit

  • At the moment there are few restrictions on which flags may be set on
    which inodes. Specifically DIRSYNC may only be set on directories and
    IMMUTABLE and APPEND may not be set on links. Tighten that to disallow
    TOPDIR being set on non-directories and only NODUMP and NOATIME to be set
    on non-regular file, non-directories.

    Introduces a flags masking function which masks flags based on mode and
    use it during inode creation and when flags are set via the ioctl to
    facilitate future consistency.

    Signed-off-by: Duane Griffin
    Acked-by: Andreas Dilger
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: "Theodore Ts'o"

    Duane Griffin
     

07 Jan, 2009

1 commit

  • 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: Frank Mayhar
    Signed-off-by: "Theodore Ts'o"

    Frank Mayhar
     

11 Oct, 2008

1 commit

  • If the journal has aborted due to a checkpointing failure, we
    have to keep the contents of the journal space. Otherwise, the
    filesystem will lose uncheckpointed metadata completely and
    become inconsistent. To avoid this, we need to keep needs_recovery
    flag if checkpoint has failed.

    With this patch, ext4_put_super() detects a checkpointing failure
    from the return value of journal_destroy(), then it invokes
    ext4_abort() to make the filesystem read only and keep
    needs_recovery flag. Errors from jbd2_journal_flush() are also
    handled by this patch in some places.

    Signed-off-by: Hidehiro Kawai
    Signed-off-by: Theodore Ts'o

    Hidehiro Kawai
     

10 Oct, 2008

1 commit


09 Oct, 2008

1 commit


14 Sep, 2008

1 commit


09 Sep, 2008

1 commit


30 Apr, 2008

2 commits


19 Apr, 2008

1 commit


29 Jan, 2008

2 commits


15 Nov, 2007

1 commit

  • 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
     

18 Jul, 2007

4 commits

  • This patch adds nanosecond timestamps for ext4. This involves adding
    *time_extra fields to the ext4_inode to extend the timestamps to
    64-bits. Creation time is also added by this patch.

    These extended fields will fit into an inode if the filesystem was
    formatted with large inodes (-I 256 or larger) and there are currently
    no EAs consuming all of the available space. For new inodes we always
    reserve enough space for the kernel's known extended fields, but for
    inodes created with an old kernel this might not have been the case. So
    this patch also adds the EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE feature
    flag(ro-compat so that older kernels can't create inodes with a smaller
    extra_isize). which indicates if the fields fitting inside
    s_min_extra_isize are available or not. If the expansion of inodes if
    unsuccessful then this feature will be disabled. This feature is only
    enabled if requested by the sysadmin.

    None of the extended inode fields is critical for correct filesystem
    operation.

    Signed-off-by: Andreas Dilger
    Signed-off-by: Kalpak Shah
    Signed-off-by: Eric Sandeen
    Signed-off-by: Dave Kleikamp
    Signed-off-by: Mingming Cao
    Signed-off-by: "Theodore Ts'o"

    Kalpak Shah
     
  • When the JBD code was forked to create the new JBD2 code base, the
    references to CONFIG_JBD_DEBUG where never changed to
    CONFIG_JBD2_DEBUG. This patch fixes that.

    Signed-off-by: Jose R. Santos
    Signed-off-by: "Theodore Ts'o"

    Jose R. Santos
     
  • Propagate flags such as S_APPEND, S_IMMUTABLE, etc. from i_flags into
    ext4-specific i_flags. Quota code changes these flags on quota files
    (to make it harder for sysadmin to screw himself) and these changes were
    not correctly propagated into the filesystem.

    (This is a forward port patch from ext3)

    Signed-off-by: Jan Kara
    Signed-off-by: Mingming Cao
    Signed-off-by: "Theodore Ts'o"

    Jan Kara
     
  • Introduce is_owner_or_cap() macro in fs.h, and convert over relevant
    users to it. This is done because we want to avoid bugs in the future
    where we check for only effective fsuid of the current task against a
    file's owning uid, without simultaneously checking for CAP_FOWNER as
    well, thus violating its semantics.
    [ XFS uses special macros and structures, and in general looked ...
    untouchable, so we leave it alone -- but it has been looked over. ]

    The (current->fsuid != inode->i_uid) check in generic_permission() and
    exec_permission_lite() is left alone, because those operations are
    covered by CAP_DAC_OVERRIDE and CAP_DAC_READ_SEARCH. Similarly operations
    falling under the purview of CAP_CHOWN and CAP_LEASE are also left alone.

    Signed-off-by: Satyam Sharma
    Cc: Al Viro
    Acked-by: Serge E. Hallyn
    Signed-off-by: Linus Torvalds

    Satyam Sharma