Skip to content
  1. Sep 13, 2012
  2. Sep 05, 2012
  3. Aug 20, 2012
  4. Aug 19, 2012
  5. Aug 18, 2012
  6. Aug 17, 2012
    • Theodore Ts'o's avatar
      ext4: return an error if kset_create_and_add fails in ext4_init_fs() · 0e376b1e
      Theodore Ts'o authored
      
      
      In the very unlikely case that kset_create_and_add() fails when the
      ext4.ko module is being loaded (or during kernel startup) set err so
      that it's clear that the module load failed.
      
      https://bugzilla.kernel.org/show_bug.cgi?id=27912
      
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      0e376b1e
    • Robin Dong's avatar
      ext4: remove unused function argument 'order' in mb_find_extent() · 15c006a2
      Robin Dong authored
      
      
      All the routines call mb_find_extent are setting argument 'order' to 0
      just like:
      
      	mb_find_extent(e4b, 0, ex.fe_start, ex.fe_len, &ex);
      
      therefore the useless argument should be removed.
      
      Signed-off-by: default avatarRobin Dong <sanbai@taobao.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      15c006a2
    • Robin Dong's avatar
      cc6eb18d
    • Theodore Ts'o's avatar
      ext4: check return value of blkdev_issue_flush() · a4a39040
      Theodore Ts'o authored
          
      blkdev_issue_flush() can fail; make sure the error gets properly
      propagated.
          
      This is a port of the equivalent ext3 patch from commit 44f4f729
      
      .
          
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      a4a39040
    • Theodore Ts'o's avatar
      jbd2: check return value of blkdev_issue_flush() · 316e4cfd
      Theodore Ts'o authored
      blkdev_issue_flush() can fail; make sure the error gets properly
      propagated.
      
      This is a port of the equivalent jbd patch from commit 349ecd6a
      
      .
      
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      316e4cfd
    • Zheng Liu's avatar
      ext4: make the zero-out chunk size tunable · 67a5da56
      Zheng Liu authored
      
      
      Currently in ext4 the length of zero-out chunk is set to 7 file system
      blocks.  But if an inode has uninitailized extents from using
      fallocate to preallocate space, and the workload issues many random
      writes, this can cause a fragmented extent tree that will
      unnecessarily grow the extent tree.
      
      So create a new sysfs tunable, extent_max_zeroout_kb, which controls
      the maximum size where blocks will be zeroed out instead of creating a
      new uninitialized extent.  The default of this has been sent to 32kb.
      
      CC: Zach Brown <zab@zabbo.net>
      CC: Andreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatarZheng Liu <wenqing.lz@taobao.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      67a5da56
    • Anatol Pomozov's avatar
      81370291
    • Anatol Pomozov's avatar
      ext4: realign trace events structs to make it smaller · 210c0526
      Anatol Pomozov authored
      
      
      Most hardware architectures require that data (including struct fields)
      have to be aligned in memory. To make it happen compiler inserts padding
      between struct fields if they are not aligned correctly.
      
      Reorder fields to remove paddings and make structures denser. Making data
      smaller saves some memory that is very important for trace events.
      Tracing buffer has limited size and making objects smaller we can put more
      of them without overflowing the tracing buffer.
      
      To find data struct holes I used 'pahole -H 1 -E -I vmlinux.o' from
      'dwarves' package.
      
      Signed-off-by: default avatarAnatol Pomozov <anatol.pomozov@gmail.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      210c0526
    • Theodore Ts'o's avatar
      ext4: add max_dir_size_kb mount option · df981d03
      Theodore Ts'o authored
      
      
      Very large directories can cause significant performance problems, or
      perhaps even invoke the OOM killer, if the process is running in a
      highly constrained memory environment (whether it is VM's with a small
      amount of memory or in a small memory cgroup).
      
      So it is useful, in cloud server/data center environments, to be able
      to set a filesystem-wide cap on the maximum size of a directory, to
      ensure that directories never get larger than a sane size.  We do this
      via a new mount option, max_dir_size_kb.  If there is an attempt to
      grow the directory larger than max_dir_size_kb, the system call will
      return ENOSPC instead.
      
      Google-Bug-Id: 6863013
      
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      
      
      
      df981d03
    • Theodore Ts'o's avatar
      ext4: don't load the block bitmap for block groups which have no space · 01fc48e8
      Theodore Ts'o authored
      
      
      Add a short circuit check to ext4_mb_group_group() so that we don't
      bother to load the block bitmap for a block group which does not have
      any space available.  (Or which does not have enough space until we
      are in desperation mode, i.e., when cr == 3.)
      
      Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=45741
      Reported-by: default avatar <mirek@me.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      01fc48e8
    • Theodore Ts'o's avatar
      ext4: collapse a single extent tree block into the inode if possible · ecb94f5f
      Theodore Ts'o authored
      
      
      If an inode has more than 4 extents, but then later some of the
      extents are merged together, we can optimize the file system by moving
      the extents up into the inode, and discarding the extent tree block.
      This is important, because if there are a large number of inodes with
      an external extent tree blocks where the contents could fit in the
      inode, this can significantly increase the fsck time of the file
      system.
      
      Google-Bug-Id: 6801242
      
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      ecb94f5f
    • Theodore Ts'o's avatar
      ext4: fix kernel BUG on large-scale rm -rf commands · 89a4e48f
      Theodore Ts'o authored
      Commit 968dee77: "ext4: fix hole punch failure when depth is greater
      than 0" introduced a regression in v3.5.1/v3.6-rc1 which caused kernel
      crashes when users ran run "rm -rf" on large directory hierarchy on
      ext4 filesystems on RAID devices:
      
          BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
      
          Process rm (pid: 18229, threadinfo ffff8801276bc000, task ffff880123631710)
          Call Trace:
           [<ffffffff81236483>] ? __ext4_handle_dirty_metadata+0x83/0x110
           [<ffffffff812353d3>] ext4_ext_truncate+0x193/0x1d0
           [<ffffffff8120a8cf>] ? ext4_mark_inode_dirty+0x7f/0x1f0
           [<ffffffff81207e05>] ext4_truncate+0xf5/0x100
           [<ffffffff8120cd51>] ext4_evict_inode+0x461/0x490
           [<ffffffff811a1312>] evict+0xa2/0x1a0
           [<ffffffff811a1513>] iput+0x103/0x1f0
           [<ffffffff81196d84>] do_unlinkat+0x154/0x1c0
           [<ffffffff8118cc3a>] ? sys_newfstatat+0x2a/0x40
           [<ffffffff81197b0b>] sys_unlinkat+0x1b/0x50
           [<ffffffff816135e9>] system_call_fastpath+0x16/0x1b
          Code: 8b 4d 20 0f b7 41 02 48 8d 04 40 48 8d 04 81 49 89 45 18 0f b7 49 02 48 83 c1 01 49 89 4d 00 e9 ae f8 ff ff 0f 1f 00 49 8b 45 28 <48> 8b 40 28 49 89 45 20 e9 85 f8 ff ff 0f 1f 80 00 00 00
      
          RIP  [<ffffffff81233164>] ext4_ext_remove_space+0xa34/0xdf0
      
      This could be reproduced as follows:
      
      The problem in commit 968dee77
      
       was that caused the variable 'i' to
      be left uninitialized if the truncate required more space than was
      available in the journal.  This resulted in the function
      ext4_ext_truncate_extend_restart() returning -EAGAIN, which caused
      ext4_ext_remove_space() to restart the truncate operation after
      starting a new jbd2 handle.
      
      Reported-by: default avatarMaciej Żenczykowski <maze@google.com>
      Reported-by: default avatarMarti Raudsepp <marti@juffo.org>
      Tested-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      89a4e48f
    • Theodore Ts'o's avatar
      ext4: fix long mount times on very big file systems · 0548bbb8
      Theodore Ts'o authored
      
      
      Commit 8aeb00ff85a: "ext4: fix overhead calculation used by
      ext4_statfs()" introduced a O(n**2) calculation which makes very large
      file systems take forever to mount.  Fix this with an optimization for
      non-bigalloc file systems.  (For bigalloc file systems the overhead
      needs to be set in the the superblock.)
      
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      0548bbb8
    • Theodore Ts'o's avatar
      ext4: don't call ext4_error while block group is locked · 7a4c5de2
      Theodore Ts'o authored
      
      
      While in ext4_validate_block_bitmap(), if an block allocation bitmap
      is found to be invalid, we call ext4_error() while the block group is
      still locked.  This causes ext4_commit_super() to call a function
      which might sleep while in an atomic context.
      
      There's no need to keep the block group locked at this point, so hoist
      the ext4_error() call up to ext4_validate_block_bitmap() and release
      the block group spinlock before calling ext4_error().
      
      The reported stack trace can be found at:
      
      	http://article.gmane.org/gmane.comp.file-systems.ext4/33731
      
      Reported-by: default avatarDave Jones <davej@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      7a4c5de2
  7. Aug 06, 2012
    • Theodore Ts'o's avatar
      ext4: avoid kmemcheck complaint from reading uninitialized memory · 7e731bc9
      Theodore Ts'o authored
      Commit 03179fe9
      
       introduced a kmemcheck complaint in
      ext4_da_get_block_prep() because we save and restore
      ei->i_da_metadata_calc_last_lblock even though it is left
      uninitialized in the case where i_da_metadata_calc_len is zero.
      
      This doesn't hurt anything, but silencing the kmemcheck complaint
      makes it easier for people to find real bugs.
      
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=45631
      (which is marked as a regression).
      
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      7e731bc9
    • Theodore Ts'o's avatar
      ext4: make sure the journal sb is written in ext4_clear_journal_err() · d796c52e
      Theodore Ts'o authored
      
      
      After we transfer set the EXT4_ERROR_FS bit in the file system
      superblock, it's not enough to call jbd2_journal_clear_err() to clear
      the error indication from journal superblock --- we need to call
      jbd2_journal_update_sb_errno() as well.  Otherwise, when the root file
      system is mounted read-only, the journal is replayed, and the error
      indicator is transferred to the superblock --- but the s_errno field
      in the jbd2 superblock is left set (since although we cleared it in
      memory, we never flushed it out to disk).
      
      This can end up confusing e2fsck.  We should make e2fsck more robust
      in this case, but the kernel shouldn't be leaving things in this
      confused state, either.
      
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@kernel.org
      
      d796c52e
  8. Aug 03, 2012
    • Linus Torvalds's avatar
      Linux 3.6-rc1 · 0d7614f0
      Linus Torvalds authored
      0d7614f0
    • Linus Torvalds's avatar
      Merge branch 'for-linus-3.6' of git://dev.laptop.org/users/dilinger/linux-olpc · fc6bdb59
      Linus Torvalds authored
      Pull OLPC platform updates from Andres Salomon:
       "These move the OLPC Embedded Controller driver out of
        arch/x86/platform and into drivers/platform/olpc.
      
        OLPC machines are now ARM-based (which means lots of x86 and ARM
        changes), but are typically pretty self-contained..  so it makes more
        sense to go through a separate OLPC tree after getting the appropriate
        review/ACKs."
      
      * 'for-linus-3.6' of git://dev.laptop.org/users/dilinger/linux-olpc:
        x86: OLPC: move s/r-related EC cmds to EC driver
        Platform: OLPC: move global variables into priv struct
        Platform: OLPC: move debugfs support from x86 EC driver
        x86: OLPC: switch over to using new EC driver on x86
        Platform: OLPC: add a suspended flag to the EC driver
        Platform: OLPC: turn EC driver into a platform_driver
        Platform: OLPC: allow EC cmd to be overridden, and create a workqueue to call it
        drivers: OLPC: update various drivers to include olpc-ec.h
        Platform: OLPC: add a stub to drivers/platform/ for the OLPC EC driver
      fc6bdb59
    • Linus Torvalds's avatar
      Merge tag 'dt2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 44d82e29
      Linus Torvalds authored
      Pull arm-soc Marvell Orion device-tree updates from Olof Johansson:
       "This contains a set of device-tree conversions for Marvell Orion
        platforms that were staged early but took a few tries to get the
        branch into a format where it was suitable for us to pick up.
      
        Given that most people working on these platforms are hobbyists with
        limited time, we were a bit more flexible with merging it even though
        it came in late."
      
      * tag 'dt2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (21 commits)
        ARM: Kirkwood: Replace mrvl with marvell
        ARM: Kirkwood: Describe GoFlex Net LEDs and SATA in DT.
        ARM: Kirkwood: Describe Dreamplug LEDs in DT.
        ARM: Kirkwood: Describe iConnects LEDs in DT.
        ARM: Kirkwood: Describe iConnects temperature sensor in DT.
        ARM: Kirkwood: Describe IB62x0 LEDs in DT.
        ARM: Kirkwood: Describe IB62x0 gpio-keys in DT.
        ARM: Kirkwood: Describe DNS32? gpio-keys in DT.
        ARM: Kirkwood: Move common portions into a kirkwood-dnskw.dtsi
        ARM: Kirkwood: Replace DNS-320/DNS-325 leds with dt bindings
        ARM: Kirkwood: Describe DNS325 temperature sensor in DT.
        ARM: Kirkwood: Use DT to configure SATA device.
        ARM: kirkwood: use devicetree for SPI on dreamplug
        ARM: kirkwood: Add LS-XHL and LS-CHLv2 support
        ARM: Kirkwood: Initial DTS support for Kirkwood GoFlex Net
        ARM: Kirkwood: Add basic device tree support for QNAP TS219.
        ATA: sata_mv: Add device tree support
        ARM: Orion: DTify the watchdog timer.
        ARM: Orion: Add arch support needed for I2C via DT.
        ARM: kirkwood: use devicetree for orion-spi
        ...
      
      Conflicts:
      	drivers/watchdog/orion_wdt.c
      44d82e29
    • Linus Torvalds's avatar
      Merge tag 'pm2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · bfdf85df
      Linus Torvalds authored
      Pull arm-soc cpuidle enablement for OMAP from Olof Johansson:
       "Coupled cpuidle was meant to merge for 3.5 through Len Brown's tree,
        but didn't go in because the pull request ended up rejected.  So it
        just got merged, and we got this staged branch that enables the
        coupled cpuidle code on OMAP.
      
        With a stable git workflow from the other maintainer we could have
        staged this earlier, but that wasn't the case so we have had to merge
        it late.
      
        The alternative is to hold it off until 3.7 but given that the code is
        well-isolated to OMAP and they are eager to see it go in, I didn't
        push back hard in that direction."
      
      * tag 'pm2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: OMAP4: CPUidle: Open broadcast clock-event device.
        ARM: OMAP4: CPUidle: add synchronization for coupled idle states
        ARM: OMAP4: CPUidle: Use coupled cpuidle states to implement SMP cpuidle.
        ARM: OMAP: timer: allow gp timer clock-event to be used on both cpus
      bfdf85df
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · d1494ba8
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "A few fixes for merge window fallout, and a bugfix for timer resume on
        PRIMA2."
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: mmp: add missing irqs.h
        arm: mvebu: fix typo in .dtsi comment for Armada XP SoCs
        ARM: PRIMA2: delete redundant codes to restore LATCHED when timer resumes
        ARM: mxc: Include missing irqs.h header
      d1494ba8
    • Linus Torvalds's avatar
      Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh · 0a276d16
      Linus Torvalds authored
      Pull SuperH fixes from Paul Mundt.
      
      * tag 'sh-for-linus' of git://github.com/pmundt/linux-sh: (24 commits)
        sh: explicitly include sh_dma.h in setup-sh7722.c
        sh: ecovec: care CN5 VBUS if USB host mode
        sh: sh7724: fixup renesas_usbhs clock settings
        sh: intc: initial irqdomain support.
        sh: pfc: Fix up init ordering mess.
        serial: sh-sci: fix compilation breakage, when DMA is enabled
        dmaengine: shdma: restore partial transfer calculation
        sh: modify the sh_dmae_slave_config for RSPI in setup-sh7757
        sh: Fix up recursive fault in oops with unset TTB.
        sh: pfc: Build fix for pinctrl_remove_gpio_range() changes.
        sh: select the fixed regulator driver on several boards
        sh: ecovec: switch MMC power control to regulators
        sh: add fixed voltage regulators to se7724
        sh: add fixed voltage regulators to sdk7786
        sh: add fixed voltage regulators to rsk
        sh: add fixed voltage regulators to migor
        sh: add fixed voltage regulators to kfr2r09
        sh: add fixed voltage regulators to ap325rxa
        sh: add fixed voltage regulators to sh7757lcr
        sh: add fixed voltage regulators to sh2007
        ...
      0a276d16
    • Linus Torvalds's avatar
      Merge tag 'md-3.6' of git://neil.brown.name/md · 25aa6a7a
      Linus Torvalds authored
      Pull additional md update from NeilBrown:
       "This contains a few patches that depend on plugging changes in the
        block layer so needed to wait for those.
      
        It also contains a Kconfig fix for the new RAID10 support in dm-raid."
      
      * tag 'md-3.6' of git://neil.brown.name/md:
        md/dm-raid: DM_RAID should select MD_RAID10
        md/raid1: submit IO from originating thread instead of md thread.
        raid5: raid5d handle stripe in batch way
        raid5: make_request use batch stripe release
      25aa6a7a
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · c8924234
      Linus Torvalds authored
      Pull two ceph fixes from Sage Weil:
       "The first patch fixes up the old crufty open intent code to use the
        atomic_open stuff properly, and the second fixes a possible null deref
        and memory leak with the crypto keys."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
        libceph: fix crypto key null deref, memory leak
        ceph: simplify+fix atomic_open
      c8924234
    • Linus Torvalds's avatar
      Merge tag 'ecryptfs-3.6-rc1-fixes' of... · 410fc4ce
      Linus Torvalds authored
      Merge tag 'ecryptfs-3.6-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs
      
      Pull ecryptfs fixes from Tyler Hicks:
       - Fixes a bug when the lower filesystem mount options include 'acl',
         but the eCryptfs mount options do not
       - Cleanups in the messaging code
       - Better handling of empty files in the lower filesystem to improve
         usability.  Failed file creations are now cleaned up and empty lower
         files are converted into eCryptfs during open().
       - The write-through cache changes are being reverted due to bugs that
         are not easy to fix.  Stability outweighs the performance
         enhancements here.
       - Improvement to the mount code to catch unsupported ciphers specified
         in the mount options
      
      * tag 'ecryptfs-3.6-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
        eCryptfs: check for eCryptfs cipher support at mount
        eCryptfs: Revert to a writethrough cache model
        eCryptfs: Initialize empty lower files when opening them
        eCryptfs: Unlink lower inode when ecryptfs_create() fails
        eCryptfs: Make all miscdev functions use daemon ptr in file private_data
        eCryptfs: Remove unused messaging declarations and function
        eCryptfs: Copy up POSIX ACL and read-only flags from lower mount
      410fc4ce