1. 05 Mar, 2012 6 commits
    • Jeff Moyer's avatar
      ext4: fix race between sync and completed io work · 491caa43
      Jeff Moyer authored
      The following command line will leave the aio-stress process unkillable
      on an ext4 file system (in my case, mounted on /mnt/test):
      
      aio-stress -t 20 -s 10 -O -S -o 2 -I 1000 /mnt/test/aiostress.3561.4 /mnt/test/aiostress.3561.4.20 /mnt/test/aiostress.3561.4.19 /mnt/test/aiostress.3561.4.18 /mnt/test/aiostress.3561.4.17 /mnt/test/aiostress.3561.4.16 /mnt/test/aiostress.3561.4.15 /mnt/test/aiostress.3561.4.14 /mnt/test/aiostress.3561.4.13 /mnt/test/aiostress.3561.4.12 /mnt/test/aiostress.3561.4.11 /mnt/test/aiostress.3561.4.10 /mnt/test/aiostress.3561.4.9 /mnt/test/aiostress.3561.4.8 /mnt/test/aiostress.3561.4.7 /mnt/test/aiostress.3561.4.6 /mnt/test/aiostress.3561.4.5 /mnt/test/aiostress.3561.4.4 /mnt/test/aiostress.3561.4.3 /mnt/test/aiostress.3561.4.2
      
      This is using the aio-stress program from the xfstests test suite.
      That particular command line tells aio-stress to do random writes to
      20 files from 20 threads (one thread per file).  The files are NOT
      preallocated, so you will get writes to random offsets within the
      file, thus creating holes and extending i_size.  It also opens the
      file with O_DIRECT and O_SYNC.
      
      On to the problem.  When an I/O requires unwritten extent conversion,
      it is queued onto the completed_io_list for the ext4 inode.  Two code
      paths will pull work items from this list.  The first is the
      ext4_end_io_work routine, and the second is ext4_flush_completed_IO,
      which is called via the fsync path (and O_SYNC handling, as well).
      There are two issues I've found in these code paths.  First, if the
      fsync path beats the work routine to a particular I/O, the work
      routine will free the io_end structure!  It does not take into account
      the fact that the io_end may still be in use by the fsync path.  I've
      fixed this issue by adding yet another IO_END flag, indicating that
      the io_end is being processed by the fsync path.
      
      The second problem is that the work routine will make an assignment to
      io->flag outside of the lock.  I have witnessed this result in a hang
      at umount.  Moving the flag setting inside the lock resolved that
      problem.
      
      The problem was introduced by commit b82e384c ("ext4: optimize
      locking for end_io extent conversion"), which first appeared in 3.2.
      As such, the fix should be backported to that release (probably along
      with the unwritten extent conversion race fix).
      Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      CC: stable@kernel.org
      491caa43
    • Jeff Moyer's avatar
      ext4: clean up the flags passed to __blockdev_direct_IO · 93ef8541
      Jeff Moyer authored
      For extent-based files, you can perform DIO to holes, as mentioned in
      the comments in ext4_ext_direct_IO.  However, that function passes
      DIO_SKIP_HOLES to __blockdev_direct_IO, which is *really* confusing to
      the uninitiated reader.  The key, here, is that the get_block function
      passed in, ext4_get_block_write, completely ignores the create flag
      that is passed to it (the create flag is passed in from the direct I/O
      code, which uses the DIO_SKIP_HOLES flag to determine whether or not
      it should be cleared).
      
      This is a long-winded way of saying that the DIO_SKIP_HOLES flag is
      ultimately ignored.  So let's remove it.
      Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      93ef8541
    • Theodore Ts'o's avatar
      ext4: try to deprecate noacl and noxattr_user mount options · f7048605
      Theodore Ts'o authored
      No other file system allows ACL's and extended attributes to be
      enabled or disabled via a mount option.  So let's try to deprecate
      these options from ext4.
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      f7048605
    • Theodore Ts'o's avatar
      ext4: ignore mount options supported by ext2/3 (but have since been removed) · c7198b9c
      Theodore Ts'o authored
      Users who tried to use the ext4 file system driver is being used for
      the ext2 or ext3 file systems (via the CONFIG_EXT4_USE_FOR_EXT23
      option) could have failed mounts if their /etc/fstab contains options
      recognized by ext2 or ext3 but which have since been removed in ext4.
      
      So teach ext4 to recognize them and give a warning that the mount
      option was removed.
      
      Report: https://bbs.archlinux.org/profile.php?id=33804Signed-off-by: default avatarTom Gundersen <teg@jklm.no>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: Thomas Baechler <thomas@archlinux.org>
      Cc: Tobias Powalowski <tobias.powalowski@googlemail.com>
      Cc: Dave Reisner <d@falconindy.com>
      c7198b9c
    • Theodore Ts'o's avatar
      ext4: add debugging /proc file showing file system options · 66acdcf4
      Theodore Ts'o authored
      Now that /proc/mounts is consistently showing only those mount options
      which need to be specified in /etc/fstab or on the mount command line,
      it is useful to have file which shows exactly which file system
      options are enabled.  This can be useful when debugging a user
      problem.
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      66acdcf4
    • Theodore Ts'o's avatar
      ext4: make ext4_show_options() be table-driven · 5a916be1
      Theodore Ts'o authored
      Consistently show mount options which are the non-default, so that
      /proc/mounts accurately shows the mount options that would be
      necessary to mount the file system in its current mode of operation.
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      5a916be1
  2. 04 Mar, 2012 2 commits
  3. 03 Mar, 2012 2 commits
  4. 02 Mar, 2012 3 commits
  5. 27 Feb, 2012 1 commit
  6. 21 Feb, 2012 3 commits
    • Zheng Liu's avatar
      ext4: format flag in dx_probe() · 9ee49302
      Zheng Liu authored
      Fix ext4_warning format flag in dx_probe().
      
      CC: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarZheng Liu <wenqing.lz@taobao.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      9ee49302
    • Eric Sandeen's avatar
      ext4: avoid deadlock on sync-mounted FS w/o journal · c1bb05a6
      Eric Sandeen authored
      Processes hang forever on a sync-mounted ext2 file system that
      is mounted with the ext4 module (default in Fedora 16).
      
      I can reproduce this reliably by mounting an ext2 partition with
      "-o sync" and opening a new file an that partition with vim. vim
      will hang in "D" state forever.  The same happens on ext4 without
      a journal.
      
      I am attaching a small patch here that solves this issue for me.
      In the sync mounted case without a journal,
      ext4_handle_dirty_metadata() may call sync_dirty_buffer(), which
      can't be called with buffer lock held.
      
      Also move mb_cache_entry_release inside lock to avoid race
      fixed previously by 8a2bfdcb ext[34]: EA block reference count racing fix
      Note too that ext2 fixed this same problem in 2006 with
      b2f49033 [PATCH] fix deadlock in ext2
      
      Signed-off-by: Martin.Wilck@ts.fujitsu.com
      [sandeen@redhat.com: move mb_cache_entry_release before unlock, edit commit msg]
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      c1bb05a6
    • Lukas Czerner's avatar
      ext4: fix resize when resizing within single group · a0ade1de
      Lukas Czerner authored
      When resizing file system in the way that the new size of the file
      system is still in the same group (no new groups are added), then we can
      hit a BUG_ON in ext4_alloc_group_tables()
      
      BUG_ON(flex_gd->count == 0 || group_data == NULL);
      
      because flex_gd->count is zero. The reason is the missing check for such
      case, so the code always extend the last group fully and then attempt to
      add more groups, but at that time n_blocks_count is actually smaller
      than o_blocks_count.
      
      It can be easily reproduced like this:
      
      mkfs.ext4 -b 4096 /dev/sda 30M
      mount /dev/sda /mnt/test
      resize2fs /dev/sda 50M
      
      Fix this by checking whether the resize happens within the singe group
      and only add that many blocks into the last group to satisfy user
      request. Then o_blocks_count == n_blocks_count and the resize will exit
      successfully without and attempt to add more groups into the fs.
      
      Also fix mixing together block number and blocks count which might be
      confusing and can easily lead to off-by-one errors (but it is actually
      not the case here since the two occurrence of this mix-up will cancel
      each other).
      Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
      Reported-by: default avatarMilan Broz <mbroz@redhat.com>
      Reviewed-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      a0ade1de
  7. 20 Feb, 2012 18 commits
  8. 07 Feb, 2012 1 commit
  9. 31 Jan, 2012 4 commits
    • Linus Torvalds's avatar
      Linux 3.3-rc2 · 62aa2b53
      Linus Torvalds authored
      62aa2b53
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://github.com/prasad-joshi/logfs_upstream · d3712b9d
      Linus Torvalds authored
      There are few important bug fixes for LogFS
      
      * tag 'for-linus' of git://github.com/prasad-joshi/logfs_upstream:
        Logfs: Allow NULL block_isbad() methods
        logfs: Grow inode in delete path
        logfs: Free areas before calling generic_shutdown_super()
        logfs: remove useless BUG_ON
        MAINTAINERS: Add Prasad Joshi in LogFS maintiners
        logfs: Propagate page parameter to __logfs_write_inode
        logfs: set superblock shutdown flag after generic sb shutdown
        logfs: take write mutex lock during fsync and sync
        logfs: Prevent memory corruption
        logfs: update page reference count for pined pages
      
      Fix up conflict in fs/logfs/dev_mtd.c due to semantic change in what
      "mtd->block_isbad" means in commit f2933e86: "Logfs: Allow NULL
      block_isbad() methods" clashing with the abstraction changes in the
      commits 7086c19d: "mtd: introduce mtd_block_isbad interface" and
      d58b27ed: "logfs: do not use 'mtd->block_isbad' directly".
      
      This resolution takes the semantics from commit f2933e86, and just
      makes mtd_block_isbad() return zero (false) if the 'block_isbad'
      function is NULL.  But that also means that now "mtd_can_have_bb()"
      always returns 0.
      
      Now, "mtd_block_markbad()" will obviously return an error if the
      low-level driver doesn't support bad blocks, so this is somewhat
      non-symmetric, but it actually makes sense if a NULL "block_isbad"
      function is considered to mean "I assume that all my blocks are always
      good".
      d3712b9d
    • Linus Torvalds's avatar
      Merge branch 'hwmon-for-linus' of... · c5d2bc11
      Linus Torvalds authored
      Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      * 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (w83627ehf) Disable setting DC mode for pwm2, pwm3 on NCT6776F
        hwmon: (sht15) fix bad error code
        MAINTAINERS: Drop maintainer for MAX1668 hwmon driver
        MAINTAINERS: Add hwmon entries for Wolfson
        hwmon: (f71805f) Fix clamping of temperature limits
      c5d2bc11
    • Linus Torvalds's avatar
      Merge branch 'for-torvalds' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 8e2a2880
      Linus Torvalds authored
      Here are some fixes to the pin control system that has accumulated since
      -rc1.  Mainly Tony Lindgren fixed the module load/unload logic and the
      rest are minor fixes and documentation.
      
      * 'for-torvalds' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: add checks for empty function names
        pinctrl: fix pinmux_hog_maps when ctrl_dev_name is not set
        pinctrl: fix some pinmux typos
        pinctrl: free debugfs entries when unloading a pinmux driver
        pinctrl: unbreak error messages
        Documentation/pinctrl: fix a few syntax errors in code examples
        pinctrl: fix pinconf_pins_show iteration
      8e2a2880