Switch branches/tags
Commits on May 3, 2011
  1. ext4: remove alloc_semp

    After taking care of all group init races, all that remains is to
    remove alloc_semp from ext4_allocation_context and ext4_buddy structs.
    Signed-off-by: Amir Goldstein <>
    amir73il committed May 3, 2011
  2. ext4: teach ext4_mb_init_cache() to skip uptodate buddy caches

    After online resize which adds new groups, some of the groups
    in a buddy page may be initialized and uptodate, while other
    (new ones) may be uninitialized.
    The indication for init of new block groups is when ext4_mb_init_cache()
    is called with an uptodate buddy page. In this case, initialized groups
    on that buddy page must be skipped when initializing the buddy cache.
    Signed-off-by: Amir Goldstein <>
    amir73il committed May 3, 2011
  3. ext4: synchronize ext4_mb_init_group() with buddy page lock

    The old routines ext4_mb_[get|put]_buddy_cache_lock(), which used
    to take grp->alloc_sem for all groups on the buddy page have been
    replaced with the routines ext4_mb_[get|put]_buddy_page_lock().
    The new routines take both buddy and bitmap page locks to protect
    against concurrent init of groups on the same buddy page.
    The GROUP_NEED_INIT flag is tested again under page lock to check
    if the group was initialized by another caller.
    Signed-off-by: Amir Goldstein <>
    amir73il committed May 3, 2011
  4. ext4: implement ext4_add_groupblocks() by freeing blocks

    The old imlementation used to take grp->alloc_sem and set the
    GROUP_NEED_INIT flag, so that the buddy cache would be reloaded.
    The new implementation updates the buddy cache by freeing the added
    blocks and making them available for use, so there is no need to
    reload the buddy cache and there is no need to take grp->alloc_sem.
    Signed-off-by: Amir Goldstein <>
    amir73il committed May 3, 2011
  5. ext4: move ext4_add_groupblocks() to mballoc.c

    In preparation for the next patch, the function ext4_add_groupblocks()
    is moved to mballoc.c, where it could use some static functions.
    I also fixed a checkpatch warning and replaced obsolete get_undo_access
    for bitmap with get_write_access.
    Signed-off-by: Amir Goldstein <>
    amir73il committed May 3, 2011
  6. ext4: reimplement convert and split_unwritten

    Reimplement ext4_ext_convert_to_initialized() and
    ext4_split_unwritten_extents() using ext4_split_extent()
    Signed-off-by: Yongqiang Yang <>
    Signed-off-by: "Theodore Ts'o" <>
    Tested-by: Allison Henderson <>
    committed with tytso May 3, 2011
  7. ext4: add ext4_split_extent_at() and ext4_split_extent()

    Add two functions: ext4_split_extent_at(), which splits an extent into
    two extents at given logical block, and ext4_split_extent() which
    splits an extent into three extents.
    Signed-off-by: Yongqiang Yang <>
    Signed-off-by: "Theodore Ts'o" <>
    Tested-by: Allison Henderson <>
    committed with tytso May 3, 2011
  8. ext4: add a function merging extents right and left

    1) Rename ext4_ext_try_to_merge() to ext4_ext_try_to_merge_right().
    2) Add a new function ext4_ext_try_to_merge() which tries to merge
       an extent both left and right.
    3) Use the new function in ext4_ext_convert_unwritten_endio() and
    Signed-off-by: Yongqiang Yang <>
    Tested-by: Allison Henderson <>
    committed with tytso May 3, 2011
  9. ext4: fix deadlock in ext4_symlink() in ENOSPC conditions

    ext4_symlink() cannot call __page_symlink() with transaction open.
    __page_symlink() calls ext4_write_begin() which can wait for
    transaction commit if we are running out of space thus causing a
    deadlock. Also error recovery in ext4_truncate_failed_write() does not
    count with the transaction being already started (although I'm not
    aware of any particular deadlock here).
    Fix the problem by stopping a transaction before calling
    __page_symlink() (we have to be careful and put inode to orphan list
    so that it gets deleted in case of crash) and starting another one
    after __page_symlink() returns for addition of symlink into a
    Signed-off-by: Jan Kara <>
    Signed-off-by: "Theodore Ts'o" <>
    jankara committed with tytso May 3, 2011
  10. ext4: Fix fs corruption when make_indexed_dir() fails

    When make_indexed_dir() fails (e.g. because of ENOSPC) after it has
    allocated block for index tree root, we did not properly mark all
    changed buffers dirty.  This lead to only some of these buffers being
    written out and thus effectively corrupting the directory.
    Fix the issue by marking all changed data dirty even in the error
    failure case.
    Signed-off-by: Jan Kara <>
    Signed-off-by: "Theodore Ts'o" <>
    jankara committed with tytso May 3, 2011
  11. ext4: set extents flag when migrating file to use extents

    Fix a typo that was introduced in commit 07a0382 (in 2.6.36) which
    caused the extents flag not to be set at the conclusion of converting
    an inode to use extents.
    Reported-by: Peter Uchno <>
    Signed-off-by: "Theodore Ts'o" <>
    tytso committed May 3, 2011
Commits on May 1, 2011
  1. jbd2: fix fsync() tid wraparound bug

    If an application program does not make any changes to the indirect
    blocks or extent tree, i_datasync_tid will not get updated.  If there
    are enough commits (i.e., 2**31) such that tid_geq()'s calculations
    wrap, and there isn't a currently active transaction at the time of
    the fdatasync() call, this can end up triggering a BUG_ON in
    	J_ASSERT(journal->j_running_transaction != NULL);
    It's pretty rare that this can happen, since it requires the use of
    fdatasync() plus *very* frequent and excessive use of fsync().  But
    with the right workload, it can.
    We fix this by replacing the use of tid_geq() with an equality test,
    since there's only one valid transaction id that we is valid for us to
    wait until it is commited: namely, the currently running transaction
    (if it exists).
    Signed-off-by: "Theodore Ts'o" <>
    tytso committed May 1, 2011
  2. ext4: remove obsolete mount options from ext4's documentation

    The block reservation code from ext3 was removed long ago...
    Signed-off-by: "Theodore Ts'o" <>
    tytso committed May 1, 2011
  3. ext4: remove dead code in ext4_has_free_blocks()

    percpu_counter_sum_positive() never returns a negative value.
    Signed-off-by: Shaohua Li <>
    Signed-off-by: "Theodore Ts'o" <>
    Shaohua Li committed with tytso May 1, 2011
Commits on Apr 30, 2011
  1. ext4: ignore errors when issuing discards

    This is an effective revert of commit a30eec2: "ext4: stop issuing
    discards if not supported by device".  The problem is that there are
    some devices that may return errors in response to a discard request
    some times but not others.  (One example would be a hybrid dm device
    which concatenates an SSD and an HDD device).
    By this logic, I also removed the error checking from ext4's FITRIM
    code; so that an error from a discard will not stop the FITRIM from
    trying to trim the rest of the file system.
    Signed-off-by: "Theodore Ts'o" <>
    tytso committed Apr 30, 2011
  2. ext4: don't set PageUptodate in ext4_end_bio()

    In the bio completion routine, we should not be setting
    PageUptodate at all -- it's set at sys_write() time, and is
    unaffected by success/failure of the write to disk.
    This can cause a page corruption bug when the file system's
    block size is less than the architecture's VM page size.
    if we have only written a single block -- we might end up
    setting the page's PageUptodate flag, indicating that page
    is completely read into memory, which may not be true.
    This could cause subsequent reads to get bad data.
    This commit also takes the opportunity to clean up error
    handling in ext4_end_bio(), and remove some extraneous code:
       - fixes ext4_end_bio() to set AS_EIO in the
         page->mapping->flags on error, which was left out by
         mistake.  This is needed so that fsync() will
         return an error if there was an I/O error.
       - remove the clear_buffer_dirty() call on unmapped
         buffers for each page.
       - consolidate page/buffer error handling in a single
    Signed-off-by: Curt Wohlgemuth <>
    Signed-off-by: "Theodore Ts'o" <>
    Reported-by: Jim Meyering <>
    Reported-by: Hugh Dickins <>
    Cc: Mingming Cao <>
    Curt Wohlgemuth committed with tytso Apr 30, 2011
Commits on Apr 18, 2011
  1. ext4: check for ext[23] file system features when mounting as ext[23]

    Provide better emulation for ext[23] mode by enforcing that the file
    system does not have any unsupported file system features as defined
    by ext[23] when emulating the ext[23] file system driver when
    CONFIG_EXT4_USE_FOR_EXT23 is defined.
    This causes the file system type information in /proc/mounts to be
    correct for the automatically mounted root file system.  This also
    means that "mount -t ext2 /dev/sda /mnt" will fail if /dev/sda
    contains an ext3 or ext4 file system, just as one would expect if the
    original ext2 file system driver were in use.
    Signed-off-by: "Theodore Ts'o" <>
    tytso committed Apr 18, 2011
Commits on Apr 16, 2011
  1. ext4: release page cache in ext4_mb_load_buddy error path

    Add missing page_cache_release in the error path of ext4_mb_load_buddy
    Signed-off-by: Yang Ruirui <>
    Signed-off-by: "Theodore Ts'o" <>
    Yang Ruirui committed with tytso Apr 16, 2011
Commits on Apr 12, 2011
  1. Linux 2.6.39-rc3

    torvalds committed Apr 12, 2011
Commits on Apr 11, 2011
  1. Merge branch 'for-linus' of git://

    * 'for-linus' of git://
      xfs: use proper interfaces for on-stack plugging
      xfs: fix xfs_debug warnings
      xfs: fix variable set but not used warnings
      xfs: convert log tail checking to a warning
      xfs: catch bad block numbers freeing extents.
      xfs: push the AIL from memory reclaim and periodic sync
      xfs: clean up code layout in xfs_trans_ail.c
      xfs: convert the xfsaild threads to a workqueue
      xfs: introduce background inode reclaim work
      xfs: convert ENOSPC inode flushing to use new syncd workqueue
      xfs: introduce a xfssyncd workqueue
      xfs: fix extent format buffer allocation size
      xfs: fix unreferenced var error in xfs_buf.c
    Also, applied patch from Tony Luck that fixes ia64:
      xfs_destroy_workqueues() should not be tagged with__exit
    in the branch before merging.
    torvalds committed Apr 11, 2011
  2. xfs_destroy_workqueues() should not be tagged with__exit

    ia64 throws away .exit sections for the built-in CONFIG case, so routines
    that are used in other circumstances should not be tagged as __exit.
    Signed-off-by: Tony Luck <>
    Reviewed-by: Christoph Hellwig <>
    Signed-off-by: Alex Elder <>
    Signed-off-by: Linus Torvalds <>
    Luck, Tony committed with torvalds Apr 11, 2011
  3. Merge branch 'for_linus' of git://…

    * 'for_linus' of git://
      ext4: fix data corruption regression by reverting commit 6de9843
      ext4: Allow indirect-block file to grow the file size to max file size
      ext4: allow an active handle to be started when freezing
      ext4: sync the directory inode in ext4_sync_parent()
      ext4: init timer earlier to avoid a kernel panic in __save_error_info
      jbd2: fix potential memory leak on transaction commit
      ext4: fix a double free in ext4_register_li_request
      ext4: fix credits computing for indirect mapped files
      ext4: remove unnecessary [cm]time update of quota file
      jbd2: move bdget out of critical section
    torvalds committed Apr 11, 2011
  4. Merge branch 'for-2.6.39' of git://

    * 'for-2.6.39' of git://
      nfsd4: fix oops on lock failure
      nfsd: fix auth_domain reference leak on nlm operations
    torvalds committed Apr 11, 2011
  5. Merge branch 'spi/merge' of git://

    * 'spi/merge' of git://
      dt/fsldma: fix build warning caused by of_platform_device changes
      spi: Fix race condition in stop_queue()
      gpio/pch_gpio: Fix output value of pch_gpio_direction_output()
      gpio/ml_ioh_gpio: Fix output value of ioh_gpio_direction_output()
      gpio/pca953x: fix error handling path in probe() call
    torvalds committed Apr 11, 2011
  6. pci: fix PCI bus allocation alignment handling

    In commit 13583b1 ("PCI: refactor io size calculation code") Ram
    had a thinko in the refactorization of the code: the end result used the
    variable 'align' for the bus alignment, but the original code used
    Since then, another use of that 'align' variable got introduced by
    commit c8adf9a ("PCI: pre-allocate additional resources to devices
    only after successful allocation of essential resources.")
    Fix both of those uses to use 'min_align' as they should.
    Daniel Hellstrom <>
    Acked-by: Ram Pai <>
    Acked-by: Jesse Barnes <>
    Signed-off-by: Linus Torvalds <>
    torvalds committed Apr 11, 2011
  7. Merge git://

    * git:// (34 commits)
      net: Add support for SMSC LAN9530, LAN9730 and LAN89530
      mlx4_en: Restoring RX buffer pointer in case of failure
      mlx4: Sensing link type at device initialization
      ipv4: Fix "Set rt->rt_iif more sanely on output routes."
      MAINTAINERS: add entry for Xen network backend
      be2net: Fix suspend/resume operation
      be2net: Rename some struct members for clarity
      pppoe: drop PPPOX_ZOMBIEs in pppoe_flush_dev
      dsa/mv88e6131: add support for mv88e6085 switch
      ipv6: Enable RFS sk_rxhash tracking for ipv6 sockets (v2)
      be2net: Fix a potential crash during shutdown.
      bna: Fix for handling firmware heartbeat failure
      can: mcp251x: Allow pass IRQ flags through platform data.
      smsc911x: fix mac_lock acquision before calling smsc911x_mac_read
      iwlwifi: accept EEPROM version 0x423 for iwl6000
      rt2x00: fix cancelling uninitialized work
      rtlwifi: Fix some warnings/bugs
      p54usb: IDs for two new devices
      wl12xx: fix potential buffer overflow in testmode nvs push
      zd1211rw: reset rx idle timer from tasklet
    torvalds committed Apr 11, 2011
  8. dt/fsldma: fix build warning caused by of_platform_device changes

    Commit 0000612, "dt/powerpc:
    Eliminate users of of_platform_{,un}register_driver" forgot to convert
    the type of structure passed into platform_device_register() when it
    was converted from of_platform_device_register. Fix it.
    Signed-off-by: Ira W. Snyder <>
    Signed-off-by: Grant Likely <>
    Ira W. Snyder committed with glikely Apr 7, 2011
  9. ext4: fix data corruption regression by reverting commit 6de9843

    Revert commit 6de9843, since it
    caused a data corruption regression with BitTorrent downloads.  Thanks
    to Damien for discovering and bisecting to find the problem commit.
    Reported-by: Damien Grassart <>
    Signed-off-by: "Theodore Ts'o" <>
    tytso committed Apr 11, 2011
  10. ext4: Allow indirect-block file to grow the file size to max file size

    We can create 4402345721856 byte file with indirect block mapping.
    However, if we grow an indirect-block file to the size with ftruncate(),
    we can see an ext4 warning. The following patch fixes this problem.
    How to reproduce:
    # dd if=/dev/zero of=/mnt/mp1/hoge bs=1 count=0 seek=4402345721856
    0+0 records in
    0+0 records out
    0 bytes (0 B) copied, 0.000221428 s, 0.0 kB/s
    # tail -n 1 /var/log/messages
    Nov 25 15:10:27 test kernel: EXT4-fs warning (device sda8): ext4_block_to_path:345: block 1074791436 > max in inode 12
    Signed-off-by: Kazuya Mio <>
    Signed-off-by: "Theodore Ts'o" <>
    Kazuya Mio committed with tytso Apr 11, 2011
  11. ext4: allow an active handle to be started when freezing

    ext4_journal_start_sb() should not prevent an active handle from being
    started due to s_frozen.  Otherwise, deadlock is easy to happen, below
    is a situation.
         freeze         |       truncate
                        |  ext4_ext_truncate()
        freeze_super()  |   starts a handle
        sets s_frozen   |
                        |  ext4_ext_truncate()
                        |  holds i_data_sem
      ext4_freeze()     |
      waits for updates |
                        |  ext4_free_blocks()
                        |  calls dquot_free_block()
                        |  dquot_free_blocks()
                        |  calls ext4_dirty_inode()
                        |  ext4_dirty_inode()
                        |  trys to start an active
                        |  handle
                        |  block due to s_frozen
    Signed-off-by: Yongqiang Yang <>
    Signed-off-by: "Theodore Ts'o" <>
    Reported-by: Amir Goldstein <>
    Reviewed-by: Jan Kara <>
    Reviewed-by: Andreas Dilger <>
    committed with tytso Apr 11, 2011
  12. ext4: sync the directory inode in ext4_sync_parent()

    ext4 has taken the stance that, in the absence of a journal,
    when an fsync/fdatasync of an inode is done, the parent
    directory should be sync'ed if this inode entry is new.
    ext4_sync_parent(), which implements this, does indeed sync
    the dirent pages for parent directories, but it does not
    sync the directory *inode*.  This patch fixes this.
    Also now return error status from ext4_sync_parent().
    I tested this using a power fail test, which panics a
    machine running a file server getting requests from a
    client.  Without this patch, on about every other test run,
    the server is missing many, many files that had been synced.
    With this patch, on > 6 runs, I see zero files being lost.
    Google-Bug-Id: 4179519
    Signed-off-by: Curt Wohlgemuth <>
    Signed-off-by: "Theodore Ts'o" <>
    Curt Wohlgemuth committed with tytso Apr 11, 2011
  13. net: Add support for SMSC LAN9530, LAN9730 and LAN89530

    This patch adds support for SMSC's LAN9530, LAN9730 and LAN89530 USB
    ethernet controllers to the existing smsc95xx driver by adding
    their new USB VID/PID pairs.
    Signed-off-by: Steve Glendinning <>
    Signed-off-by: David S. Miller <>
    Steve Glendinning committed with davem330 Apr 11, 2011
Commits on Apr 10, 2011
  1. Merge branch 'for-linus' of git://…

    * 'for-linus' of git://
      ALSA: hda - Don't query connections for widgets have no connections
      ALSA: HDA: Fix single internal mic on ALC275 (Sony Vaio VPCSB1C5E)
      ALSA: hda - HDMI: Fix MCP7x audio infoframe checksums
      ALSA: usb-audio: define another USB ID for a buggy USB MIDI cable
      ALSA: HDA: Fix dock mic for Lenovo X220-tablet
      ASoC: format_register_str: Don't clip register values
      ASoC: PXA: Fix oops in __pxa2xx_pcm_prepare
      ASoC: zylonite: set .codec_dai_name in initializer
    torvalds committed Apr 10, 2011
  2. nfsd4: fix oops on lock failure

    Lock stateid's can have access_bmap 0 if they were only partially
    initialized (due to a failed lock request); handle that case in
    ------------[ cut here ]------------
    kernel BUG at fs/nfsd/nfs4state.c:380!
    invalid opcode: 0000 [#1] SMP
    last sysfs file: /sys/kernel/mm/ksm/run
    Modules linked in: nfs fscache md4 nls_utf8 cifs ip6table_filter ip6_tables ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat bridge stp llc nfsd lockd nfs_acl auth_rpcgss sunrpc ipv6 ppdev parport_pc parport pcnet32 mii pcspkr microcode i2c_piix4 BusLogic floppy [last unloaded: mperf]
    Pid: 1468, comm: nfsd Not tainted 2.6.38+ #120 VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform
    EIP: 0060:[<e24f180d>] EFLAGS: 00010297 CPU: 0
    EIP is at nfs4_access_to_omode+0x1c/0x29 [nfsd]
    EAX: ffffffff EBX: dd758120 ECX: 00000000 EDX: 00000004
    ESI: dd758120 EDI: ddfe657c EBP: dd54dde0 ESP: dd54dde0
     DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
    Process nfsd (pid: 1468, ti=dd54c000 task=ddc92580 task.ti=dd54c000)
     dd54ddf0 e24f19ca 00000000 ddfe6560 dd54de08 e24f1a5d dd758130 deee3a20
     ddfe6560 31270000 dd54df1c e24f52fd 0000000f dd758090 e2505dd0 0be304cf
     dbb51d68 0000000e ddfe657c ddcd8020 dd758130 dd758128 dd7580d8 dd54de68
    Call Trace:
     [<e24f19ca>] free_generic_stateid+0x1c/0x3e [nfsd]
     [<e24f1a5d>] release_lockowner+0x71/0x8a [nfsd]
     [<e24f52fd>] nfsd4_lock+0x617/0x66c [nfsd]
     [<e24e57b6>] ? nfsd_setuser+0x199/0x1bb [nfsd]
     [<e24e056c>] ? nfsd_setuser_and_check_port+0x65/0x81 [nfsd]
     [<c07a0052>] ? _cond_resched+0x8/0x1c
     [<c04ca61f>] ? slab_pre_alloc_hook.clone.33+0x23/0x27
     [<c04cac01>] ? kmem_cache_alloc+0x1a/0xd2
     [<c04835a0>] ? __call_rcu+0xd7/0xdd
     [<e24e0dfb>] ? fh_verify+0x401/0x452 [nfsd]
     [<e24f0b61>] ? nfsd4_encode_operation+0x52/0x117 [nfsd]
     [<e24ea0d7>] ? nfsd4_putfh+0x33/0x3b [nfsd]
     [<e24f4ce6>] ? nfsd4_delegreturn+0xd4/0xd4 [nfsd]
     [<e24ea2c9>] nfsd4_proc_compound+0x1ea/0x33e [nfsd]
     [<e24de6ee>] nfsd_dispatch+0xd1/0x1a5 [nfsd]
     [<e1d6e1c7>] svc_process_common+0x282/0x46f [sunrpc]
     [<e1d6e578>] svc_process+0xdc/0xfa [sunrpc]
     [<e24de0fa>] nfsd+0xd6/0x115 [nfsd]
     [<e24de024>] ? nfsd_shutdown+0x24/0x24 [nfsd]
     [<c0454322>] kthread+0x62/0x67
     [<c04542c0>] ? kthread_worker_fn+0x114/0x114
     [<c07a6ebe>] kernel_thread_helper+0x6/0x10
    Code: eb 05 b8 00 00 27 4f 8d 65 f4 5b 5e 5f 5d c3 83 e0 03 55 83 f8 02 89 e5 74 17 83 f8 03 74 05 48 75 09 eb 09 b8 02 00 00 00 eb 0b <0f> 0b 31 c0 eb 05 b8 01 00 00 00 5d c3 55 89 e5 57 56 89 d6 8d
    EIP: [<e24f180d>] nfs4_access_to_omode+0x1c/0x29 [nfsd] SS:ESP 0068:dd54dde0
    ---[ end trace 2b0bf6c6557cb284 ]---
    The trace route is:
     -> nfsd4_lock()
       -> if (lock->lk_is_new) {
         -> alloc_init_lock_stateid()
            3739: stp->st_access_bmap = 0;
       ->if (status && lock->lk_is_new && lock_sop)
         -> release_lockowner()
          -> free_generic_stateid()
           -> nfs4_access_bmap_to_omode()
              -> nfs4_access_to_omode()
            380: BUG();   *****
    This problem was introduced by 0997b17.
    Reported-by: Mi Jinlong <>
    Tested-by: Mi Jinlong <>
    Signed-off-by: J. Bruce Fields <>
    J. Bruce Fields committed Mar 28, 2011
Commits on Apr 9, 2011
  1. Merge git://

    * git://
      mtd: atmel_nand: use CPU I/O when buffer is in vmalloc(ed) region
      mtd: atmel_nand: modify test case for using DMA operations
      mtd: atmel_nand: fix support for CPUs that do not support DMA access
      mtd: atmel_nand: trivial: change DMA usage information trace
      mtd: mtdswap: fix printk format warning
    torvalds committed Apr 9, 2011