1. 12 8月, 2013 1 次提交
  2. 10 4月, 2013 1 次提交
  3. 09 4月, 2013 1 次提交
    • D
      ext4: implementation of a new ioctl called EXT4_IOC_SWAP_BOOT · 393d1d1d
      Dr. Tilmann Bubeck 提交于
      Add a new ioctl, EXT4_IOC_SWAP_BOOT which swaps i_blocks and
      associated attributes (like i_blocks, i_size, i_flags, ...) from the
      specified inode with inode EXT4_BOOT_LOADER_INO (#5). This is
      typically used to store a boot loader in a secure part of the
      filesystem, where it can't be changed by a normal user by accident.
      The data blocks of the previous boot loader will be associated with
      the given inode.
      
      This usercode program is a simple example of the usage:
      
      int main(int argc, char *argv[])
      {
        int fd;
        int err;
      
        if ( argc != 2 ) {
          printf("usage: ext4-swap-boot-inode FILE-TO-SWAP\n");
          exit(1);
        }
      
        fd = open(argv[1], O_WRONLY);
        if ( fd < 0 ) {
          perror("open");
          exit(1);
        }
      
        err = ioctl(fd, EXT4_IOC_SWAP_BOOT);
        if ( err < 0 ) {
          perror("ioctl");
          exit(1);
        }
      
        close(fd);
        exit(0);
      }
      
      [ Modified by Theodore Ts'o to fix a number of bugs in the original code.]
      Signed-off-by: NDr. Tilmann Bubeck <t.bubeck@reinform.de>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      393d1d1d
  4. 04 4月, 2013 1 次提交
    • T
      ext4: support simple conversion of extent-mapped inodes to use i_blocks · 996bb9fd
      Theodore Ts'o 提交于
      In order to make it simpler to test the code which support
      i_blocks/indirect-mapped inodes, support the conversion of inodes
      which are less than 12 blocks and which are contained in no more than
      a single extent.
      
      The primary intended use of this code is to converting freshly created
      zero-length files and empty directories.
      
      Note that the version of chattr in e2fsprogs 1.42.7 and earlier has a
      check that prevents the clearing of the extent flag.  A simple patch
      which allows "chattr -e <file>" to work will be checked into the
      e2fsprogs git repository.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      996bb9fd
  5. 23 2月, 2013 1 次提交
  6. 09 2月, 2013 1 次提交
    • T
      ext4: pass context information to jbd2__journal_start() · 9924a92a
      Theodore Ts'o 提交于
      So we can better understand what bits of ext4 are responsible for
      long-running jbd2 handles, use jbd2__journal_start() so we can pass
      context information for logging purposes.
      
      The recommended way for finding the longer-running handles is:
      
         T=/sys/kernel/debug/tracing
         EVENT=$T/events/jbd2/jbd2_handle_stats
         echo "interval > 5" > $EVENT/filter
         echo 1 > $EVENT/enable
      
         ./run-my-fs-benchmark
      
         cat $T/trace > /tmp/problem-handles
      
      This will list handles that were active for longer than 20ms.  Having
      longer-running handles is bad, because a commit started at the wrong
      time could stall for those 20+ milliseconds, which could delay an
      fsync() or an O_SYNC operation.  Here is an example line from the
      trace file describing a handle which lived on for 311 jiffies, or over
      1.2 seconds:
      
      postmark-2917  [000] ....   196.435786: jbd2_handle_stats: dev 254,32 
         tid 570 type 2 line_no 2541 interval 311 sync 0 requested_blocks 1
         dirtied_blocks 0
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      9924a92a
  7. 13 1月, 2013 1 次提交
  8. 27 9月, 2012 5 次提交
  9. 05 9月, 2012 1 次提交
  10. 23 7月, 2012 2 次提交
  11. 18 7月, 2012 1 次提交
  12. 08 6月, 2012 1 次提交
  13. 01 6月, 2012 1 次提交
  14. 30 4月, 2012 1 次提交
  15. 09 1月, 2012 1 次提交
  16. 05 1月, 2012 2 次提交
    • D
      ext4: add missing ext4_resize_end on error paths · 014a1770
      Djalal Harouni 提交于
      Online resize ioctls 'EXT4_IOC_GROUP_EXTEND' and 'EXT4_IOC_GROUP_ADD'
      call ext4_resize_begin() to check permissions and to set the
      EXT4_RESIZING bit lock, they do their work and they must finish with
      ext4_resize_end() which calls clear_bit_unlock() to unlock and to
      avoid -EBUSY errors for the next resize operations.
      
      This patch adds the missing ext4_resize_end() calls on error paths.
      
      Patch tested.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NDjalal Harouni <tixxdz@opendz.org>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      014a1770
    • Y
      ext4: add new online resize interface · 19c5246d
      Yongqiang Yang 提交于
      This patch adds new online resize interface, whose input argument is a
      64-bit integer indicating how many blocks there are in the resized fs.
      
      In new resize impelmentation, all work like allocating group tables
      are done by kernel side, so the new resize interface can support
      flex_bg feature and prepares ground for suppoting resize with features
      like bigalloc and exclude bitmap. Besides these, user-space tools just
      passes in the new number of blocks.
      
      We delay initializing the bitmaps and inode tables of added groups if
      possible and add multi groups (a flex groups) each time, so new resize
      is very fast like mkfs.
      Signed-off-by: NYongqiang Yang <xiaoqiangnk@gmail.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      19c5246d
  17. 04 1月, 2012 2 次提交
  18. 22 12月, 2011 1 次提交
    • T
      ext4: remove unneeded file_remove_suid() from ext4_ioctl() · 22cdfca5
      Theodore Ts'o 提交于
      In the code to support EXT4_IOC_MOVE_EXT, ext4_ioctl calls
      file_remove_suid() after the call to ext4_move_extents() if any
      extents has been moved.  There are at least three things wrong with
      this.  First, file_remove_suid() should be called with i_mutex down,
      which is not here.  Second, it should be called before the donor file
      has been modified, to avoid a potential race condition.  Third, and
      most importantly, it's pointless, because ext4_file_extents() already
      checks if the donor file has the setuid or setgid bit set, and will
      return an error in that case.  So the first two objections don't
      really matter, since file_remove_suid() will never need to modify the
      inode in any case.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      22cdfca5
  19. 18 10月, 2011 1 次提交
  20. 09 10月, 2011 1 次提交
  21. 10 9月, 2011 1 次提交
  22. 27 7月, 2011 1 次提交
  23. 24 3月, 2011 1 次提交
  24. 21 3月, 2011 1 次提交
  25. 24 2月, 2011 2 次提交
  26. 20 11月, 2010 1 次提交
    • L
      ext4: Add EXT4_IOC_TRIM ioctl to handle batched discard · e681c047
      Lukas Czerner 提交于
      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: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      e681c047
  27. 17 5月, 2010 2 次提交
  28. 15 5月, 2010 1 次提交
  29. 04 3月, 2010 1 次提交
  30. 24 2月, 2010 1 次提交
  31. 07 12月, 2009 1 次提交
    • A
      ext4: Fix insufficient checks in EXT4_IOC_MOVE_EXT · 4a58579b
      Akira Fujita 提交于
      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: NAkira Fujita <a-fujita@rs.jp.nec.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      4a58579b