Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync up with Linus #40

Merged
merged 191 commits into from
Feb 20, 2015
Merged

Sync up with Linus #40

merged 191 commits into from
Feb 20, 2015

Commits on Dec 12, 2014

  1. btrfs: sink blocksize parameter to readahead_tree_block

    All callers pass nodesize.
    
    Signed-off-by: David Sterba <[email protected]>
    kdave committed Dec 12, 2014
    Configuration menu
    Copy the full SHA
    d3e46fe View commit details
    Browse the repository at this point in the history
  2. btrfs: remove blocksize from reada_extent

    Replace with global nodesize instead.
    
    Signed-off-by: David Sterba <[email protected]>
    kdave committed Dec 12, 2014
    Configuration menu
    Copy the full SHA
    b6ae40e View commit details
    Browse the repository at this point in the history
  3. btrfs: sink blocksize parameter to reada_tree_block_flagged

    Signed-off-by: David Sterba <[email protected]>
    kdave committed Dec 12, 2014
    Configuration menu
    Copy the full SHA
    c0dcaa4 View commit details
    Browse the repository at this point in the history
  4. btrfs: sink blocksize parameter to btrfs_init_new_buffer

    Signed-off-by: David Sterba <[email protected]>
    kdave committed Dec 12, 2014
    Configuration menu
    Copy the full SHA
    fe86457 View commit details
    Browse the repository at this point in the history
  5. btrfs: sink blocksize parameter to btrfs_find_create_tree_block

    Finally it's clear that the requested blocksize is always equal to
    nodesize, with one exception, the superblock.
    
    Superblock has fixed size regardless of the metadata block size, but
    uses the same helpers to initialize sys array/chunk tree and to work
    with the chunk items. So it pretends to be an extent_buffer for a
    moment, btrfs_read_sys_array is full of special cases, we're adding one
    more.
    
    Signed-off-by: David Sterba <[email protected]>
    kdave committed Dec 12, 2014
    Configuration menu
    Copy the full SHA
    a83fffb View commit details
    Browse the repository at this point in the history
  6. btrfs: sink blocksize parameter to tree_block_processed

    Signed-off-by: David Sterba <[email protected]>
    kdave committed Dec 12, 2014
    Configuration menu
    Copy the full SHA
    7476dfd View commit details
    Browse the repository at this point in the history
  7. btrfs: use GFP_NOFS in __alloc_extent_buffer directly

    Same mask from all callers.
    
    Signed-off-by: David Sterba <[email protected]>
    kdave committed Dec 12, 2014
    Configuration menu
    Copy the full SHA
    23d79d8 View commit details
    Browse the repository at this point in the history
  8. btrfs: unify extent buffer allocation api

    Make the extent buffer allocation interface consistent.  Cloned eb will
    set a valid fs_info.  For dummy eb, we can drop the length parameter and
    set it from fs_info.
    
    The built-in sanity checks may pass a NULL fs_info that's queried for
    nodesize, but we know it's 4096.
    
    Signed-off-by: David Sterba <[email protected]>
    kdave committed Dec 12, 2014
    Configuration menu
    Copy the full SHA
    3f556f7 View commit details
    Browse the repository at this point in the history
  9. btrfs: sink parameter len to alloc_extent_buffer

    Because we're using globally known nodesize. Do the same for the sanity
    test function variant.
    
    Signed-off-by: David Sterba <[email protected]>
    kdave committed Dec 12, 2014
    Configuration menu
    Copy the full SHA
    ce3e698 View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2015

  1. kbuild: Drop support for clean-rule

    clean-rule has not been used since 94869f8 (kbuild: Accept absolute
    paths in clean-files and introduce clean-dirs) ten years ago.
    
    Tested-by: Sedat Dilek <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    michal42 committed Jan 2, 2015
    Configuration menu
    Copy the full SHA
    34948e0 View commit details
    Browse the repository at this point in the history
  2. builddeb: Update year and git repository URL in debian/copyright

    Happy new 2015!
    
    I have combined two patches which I had already sent to linux-kbuild ML.
    
    Today, I prefer "builddeb" as a label for such patches.
    
    [1] http://marc.info/?l=linux-kbuild&m=133521955904706
    [2] http://marc.info/?l=linux-kbuild&m=133521955004705
    
    CC: Ben Hutchings <[email protected]>
    CC: maximilian attems <[email protected]>
    Signed-off-by: Sedat Dilek <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    dileks authored and michal42 committed Jan 2, 2015
    Configuration menu
    Copy the full SHA
    701ca30 View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2015

  1. kbuild: merge bounds.h and asm-offsets.h rules

    The rules "cmd_bounds" and "cmd_offsets" are almost the same.
    (The difference is only the include guards.)  They can be merged.
    
    Signed-off-by: Masahiro Yamada <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    masahir0y authored and michal42 committed Jan 5, 2015
    Configuration menu
    Copy the full SHA
    39664e2 View commit details
    Browse the repository at this point in the history
  2. kbuild: remove redundant line from bounds.h/asm-offsets.h

    This line produces an extra comment line for bounds.h and
    asm-offsets.h.
    
    Signed-off-by: Masahiro Yamada <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    masahir0y authored and michal42 committed Jan 5, 2015
    Configuration menu
    Copy the full SHA
    343d3e6 View commit details
    Browse the repository at this point in the history

Commits on Jan 6, 2015

  1. builddeb: Try to determine distribution

    lsb_release command is a good choice to determine the distribution
    name for the changelog file in the generated Debian packages [1].
    Its installation is no precondition.
    In Debian it is still not essential or build-essential.
    
    Ben gave some helpful informations and detailed explanations in [2].
    There he also suggested to have an option to explicitly set the
    distribution name (see $KDEB_CHANGELOG_DIST variable).
    
    Embedded the improvement as suggested by Thorsten (see [3]):
    
    "This is suboptimal: if KDEB_CHANGELOG_DIST is defined,
    lsb_release is not necessary. The following snippet
    also omits using its output if it fails but still
    produces any:"
    
    Dealing with this issue I learned about "The Colon in the Shell." and
    possible pitfalls in this area (see [4,5]). Furthermore, refreshed my
    knowledge about redirecting outputs with the echo command (see [5]).
    Special thanks to Thorsten, I enjoyed the IRC session with you.
    
    Cooked together the snippets of Ben and Thorsten (see [2,3]).
    Tested against Linux v3.19-rc2.
    
    Thanks goes to Alexander, Ben, maximilian and Thorsten for the very
    vital help.
    
    [1] https://lkml.org/lkml/2012/4/23/516
    [2] http://marc.info/?l=linux-kbuild&m=142022188322321&w=2
    [3] http://marc.info/?l=linux-kbuild&m=142023476825460&w=2
    [4] http://blog.brlink.eu/index.html#i70
    [5] https://www.mirbsd.org/permalinks/wlog-10_e20141209-tg.htm
    [6] http://stackoverflow.com/questions/23489934/echo-2-some-text-what-does-it-mean-in-shell-scripting
    
    CC: Alexander Wirt <[email protected]>
    Suggested-by: Ben Hutchings <[email protected]>
    Suggested-by: Thorsten Glaser <[email protected]>
    Reviewed-by: Ben Hutchings <[email protected]>
    Acked-by: maximilian attems <[email protected]>
    [ dileks: Reviewed his suggested diff in RFC v4 ]
    Reviewed-by: Thorsten Glaser <[email protected]>
    Signed-off-by: Sedat Dilek <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    dileks authored and michal42 committed Jan 6, 2015
    Configuration menu
    Copy the full SHA
    d9f711d View commit details
    Browse the repository at this point in the history

Commits on Jan 7, 2015

  1. kconfig: use bool instead of boolean for type definition attributes

    Support for keyword 'boolean' will be dropped later on.
    
    No functional change.
    
    Reference: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Christoph Jaeger <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    christophjaeger authored and michal42 committed Jan 7, 2015
    Configuration menu
    Copy the full SHA
    6341e62 View commit details
    Browse the repository at this point in the history
  2. merge_config.sh: Display usage if given too few arguments

    Two or more arguments are always expected. Show usage and exit if
    given less.
    
    Signed-off-by: Olof Johansson <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    olofj authored and michal42 committed Jan 7, 2015
    Configuration menu
    Copy the full SHA
    09950bc View commit details
    Browse the repository at this point in the history

Commits on Jan 8, 2015

  1. kbuild: Update documentation of clean-files and clean-dirs

    Commit a16c5f9 (kbuild: Fix removal of the debian/ directory) slightly
    changed the processing of the clean-files and clean-dirs variables.
    Also, use a current real-world example of clean-files usage.
    
    Signed-off-by: Michal Marek <[email protected]>
    michal42 committed Jan 8, 2015
    Configuration menu
    Copy the full SHA
    9765918 View commit details
    Browse the repository at this point in the history
  2. kbuild: trivial - fix the help doc of CONFIG_CC_OPTIMIZE_FOR_SIZE

    Other than GCC, we have another choice, Clang for building the kernel
    these days.  It seems better to say "compiler" rather than "gcc".
    
    Signed-off-by: Masahiro Yamada <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    masahir0y authored and michal42 committed Jan 8, 2015
    Configuration menu
    Copy the full SHA
    31a4af7 View commit details
    Browse the repository at this point in the history
  3. kbuild: use mixed-targets when two or more config targets are given

    "make kvmconfig" expects that the .config has already been created,
    but some people might want to create the .config and run kvmconfig
    in one shot command, like this:
    
      $ make defconfig kvmconfig
    
    To make sure this command works correctly even if -j* option is set,
    we must handle them one by one.
    This commit turns on mixed-targets when $(MAKECMDGOALS) includes
    at least one config target and also includes another target.
    
    Signed-off-by: Masahiro Yamada <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    masahir0y authored and michal42 committed Jan 8, 2015
    Configuration menu
    Copy the full SHA
    d0d38cd View commit details
    Browse the repository at this point in the history
  4. kbuild: drop $(version_h) from MRPROPER_FILES

    Now $(version_h) is include/generated/uapi/linux/version.h.
    
    $(version_h) in MRPROPER_FILES is redundant because it is covered
    by include/generated in MRPROPER_DIRS.
    
    Signed-off-by: Masahiro Yamada <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    masahir0y authored and michal42 committed Jan 8, 2015
    Configuration menu
    Copy the full SHA
    c22bd32 View commit details
    Browse the repository at this point in the history

Commits on Jan 9, 2015

  1. kbuild: fix cc-ifversion macro

    The macro "cc-version" takes no argument.  Drop $(CC) from the
    "cc-ifversion" definition.
    
    Signed-off-by: Masahiro Yamada <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    masahir0y authored and michal42 committed Jan 9, 2015
    Configuration menu
    Copy the full SHA
    dd33c03 View commit details
    Browse the repository at this point in the history
  2. kbuild: do not add $(call ...) to invoke cc-version or cc-fullversion

    The macros cc-version, cc-fullversion and ld-version take no argument.
    It is not necessary to add $(call ...) to invoke them.
    
    Signed-off-by: Masahiro Yamada <[email protected]>
    Acked-by: Helge Deller <[email protected]> [parisc]
    Signed-off-by: Michal Marek <[email protected]>
    masahir0y authored and michal42 committed Jan 9, 2015
    Configuration menu
    Copy the full SHA
    665d92e View commit details
    Browse the repository at this point in the history
  3. kbuild,gcov: remove unnecessary workaround

    Since commit 371fdc7 (kbuild: collect shorthands into
    scripts/Kbuild.include), scripts/Makefile.clean includes
    scripts/Kbuild.include.
    
    The workaround and the comment block in kernel/gcov/Makefile
    are no longer necessary.
    
    Signed-off-by: Masahiro Yamada <[email protected]>
    Cc: Peter Oberparleiter <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    masahir0y authored and michal42 committed Jan 9, 2015
    Configuration menu
    Copy the full SHA
    842857d View commit details
    Browse the repository at this point in the history
  4. kbuild,gcov: simplify kernel/gcov/Makefile

    Kbuild descends into kernel/gcov/ directory only when
    CONFIG_GCOV_KERNEL is enabled. (See kernel/Makefile)
    
    CONFIG_GCOV_KERNEL check can be omitted in kernel/gcov/Makefile.
    
    Signed-off-by: Masahiro Yamada <[email protected]>
    Cc: Peter Oberparleiter <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    masahir0y authored and michal42 committed Jan 9, 2015
    Configuration menu
    Copy the full SHA
    3df8094 View commit details
    Browse the repository at this point in the history
  5. kbuild: allow cc-ifversion to have the argument for false condition

    The macro "try-run" can have an argument for each of true and false
    cases.  Having an argument for the false case of cc-ifversion (and
    ld-ifversion) would be useful too.
    
    Signed-off-by: Masahiro Yamada <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    masahir0y authored and michal42 committed Jan 9, 2015
    Configuration menu
    Copy the full SHA
    6dcb4e5 View commit details
    Browse the repository at this point in the history
  6. kbuild,gcov: simplify kernel/gcov/Makefile more

    CONFIG_GCOV_FORMAT_3_4 / _4_7 / _AUTODETECT are exclusive.
    Compare the CC version only when _AUTODETECT is enabled.
    
    This change should have no impact.
    
    Signed-off-by: Masahiro Yamada <[email protected]>
    Cc: Peter Oberparleiter <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    masahir0y authored and michal42 committed Jan 9, 2015
    Configuration menu
    Copy the full SHA
    a75f8b8 View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2015

  1. btrfs: fix leak of path in btrfs_find_item

    If btrfs_find_item is called with NULL path it allocates one locally but
    does not free it. Affected paths are inserting an orphan item for a file
    and for a subvol root.
    
    Move the path allocation to the callers.
    
    CC: <[email protected]> # 3.14+
    Fixes: 3f870c2 ("btrfs: expand btrfs_find_item() to include find_orphan_item functionality")
    Signed-off-by: David Sterba <[email protected]>
    kdave committed Jan 14, 2015
    Configuration menu
    Copy the full SHA
    381cf65 View commit details
    Browse the repository at this point in the history
  2. btrfs: cleanup, remove inode_item_info helper

    It's only a simple wrapper around btrfs_find_item, the locally defined
    key is not used.
    
    Signed-off-by: David Sterba <[email protected]>
    kdave committed Jan 14, 2015
    Configuration menu
    Copy the full SHA
    14692cc View commit details
    Browse the repository at this point in the history
  3. btrfs: cleanup, remove inode_ref_info helper

    A simple wrapper around btrfs_find_item.
    
    Signed-off-by: David Sterba <[email protected]>
    kdave committed Jan 14, 2015
    Configuration menu
    Copy the full SHA
    c234a24 View commit details
    Browse the repository at this point in the history
  4. btrfs: simplify insert_orphan_item

    We can search and add the orphan item in one go,
    btrfs_insert_orphan_item will find out if the item already exists.
    
    Signed-off-by: David Sterba <[email protected]>
    kdave committed Jan 14, 2015
    Configuration menu
    Copy the full SHA
    9c4f61f View commit details
    Browse the repository at this point in the history
  5. btrfs: expand btrfs_find_item if found_key is NULL

    If the found_key is NULL, then btrfs_find_item becomes a verbose wrapper
    for simple btrfs_search_slot.
    
    After we've removed all such callers, passing a NULL key is not valid
    anymore.
    
    Signed-off-by: David Sterba <[email protected]>
    kdave committed Jan 14, 2015
    Configuration menu
    Copy the full SHA
    1d4c08e View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2015

  1. Thermal/int340x: Add common thermal zone handler

    Most of the processing for each int340x driver to add a thermal zone
    is very similar and every driver has to duplicate code.
    Created a common module, which exports API to add and remove zones.
    In this way, we not only avoid duplicate code but also helps in
    bug fixes and enhancements.
    If for some driver default processing for thermal zone callback is
    not enough they can overide individual callback.
    The code for this driver is primarily copied from int3402_thermal.c.
    
    Signed-off-by: Srinivas Pandruvada <[email protected]>
    Signed-off-by: Zhang Rui <[email protected]>
    spandruvada authored and zhang-rui committed Jan 20, 2015
    Configuration menu
    Copy the full SHA
    5fbf7f2 View commit details
    Browse the repository at this point in the history
  2. Thermal/int340x/int3402: Use int340x thermal API

    Using APIs from int340x thermal zone module to add and remove thermal
    zones.
    
    Signed-off-by: Srinivas Pandruvada <[email protected]>
    Signed-off-by: Zhang Rui <[email protected]>
    spandruvada authored and zhang-rui committed Jan 20, 2015
    Configuration menu
    Copy the full SHA
    820cdeb View commit details
    Browse the repository at this point in the history
  3. Thermal/int340x/int3403: Use int340x thermal API

    Using APIs from int340x thermal zone module to add and remove thermal
    zones.
    
    Signed-off-by: Srinivas Pandruvada <[email protected]>
    Signed-off-by: Zhang Rui <[email protected]>
    spandruvada authored and zhang-rui committed Jan 20, 2015
    Configuration menu
    Copy the full SHA
    593df40 View commit details
    Browse the repository at this point in the history
  4. Thermal/int340x/processor_thermal: Add thermal zone support

    Added thermal zones for processor thermal using APIs provided by
    int340x thermal zone module.
    Like other INT340x devices, processor thermal device can also contain
    trip points and way to get temperature. On some platform there is
    no ACPI _TMP method, in those platform using IA64 architecture MSRs to
    get temperature.
    
    Signed-off-by: Srinivas Pandruvada <[email protected]>
    Signed-off-by: Zhang Rui <[email protected]>
    spandruvada authored and zhang-rui committed Jan 20, 2015
    Configuration menu
    Copy the full SHA
    1c55be0 View commit details
    Browse the repository at this point in the history
  5. Thermal/int340x/int3402: Provide notification support

    This driver supports programmable trips, but didn't register
    notification handler to receive threshold violation notification.
    
    Signed-off-by: Srinivas Pandruvada <[email protected]>
    Signed-off-by: Zhang Rui <[email protected]>
    spandruvada authored and zhang-rui committed Jan 20, 2015
    Configuration menu
    Copy the full SHA
    acebf7e View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2015

  1. thermal: of: Enable thermal_zoneX when sensor is correctly added

    Up till now the thermal_zone mode was by default "disabled". With this
    patch the default behavior was changed to "enable".
    
    One can read the mode at:
    /sys/class/thermal/thermal_zone0/mode
    
    Tested-by: Javi Merino <[email protected]>
    Reported-by: Abhilash Kesavan <[email protected]>
    Signed-off-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Lukasz Majewski authored and Eduardo Valentin committed Jan 21, 2015
    Configuration menu
    Copy the full SHA
    528012c View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2015

  1. Btrfs: change how we track dirty roots

    I've been overloading root->dirty_list to keep track of dirty roots and which
    roots need to have their commit roots switched at transaction commit time.  This
    could cause us to lose an update to the root which could corrupt the file
    system.  To fix this use a state bit to know if the root is dirty, and if it
    isn't set we go ahead and move the root to the dirty list.  This way if we
    re-dirty the root after adding it to the switch_commit list we make sure to
    update it.  This also makes it so that the extent root is always the last root
    on the dirty list to try and keep the amount of churn down at this point in the
    commit.  Thanks,
    
    Signed-off-by: Josef Bacik <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    Josef Bacik authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    e7070be View commit details
    Browse the repository at this point in the history
  2. Btrfs: track dirty block groups on their own list

    Currently any time we try to update the block groups on disk we will walk _all_
    block groups and check for the ->dirty flag to see if it is set.  This function
    can get called several times during a commit.  So if you have several terabytes
    of data you will be a very sad panda as we will loop through _all_ of the block
    groups several times, which makes the commit take a while which slows down the
    rest of the file system operations.
    
    This patch introduces a dirty list for the block groups that we get added to
    when we dirty the block group for the first time.  Then we simply update any
    block groups that have been dirtied since the last time we called
    btrfs_write_dirty_block_groups.  This allows us to clean up how we write the
    free space cache out so it is much cleaner.  Thanks,
    
    Signed-off-by: Josef Bacik <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    Josef Bacik authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    ce93ec5 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'fix/find-item-path-leak' of git://git.kernel.org/pub/sc…

    …m/linux/kernel/git/kdave/linux into for-linus
    masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    d354183 View commit details
    Browse the repository at this point in the history
  4. Merge branch 'cleanup/blocksize-diet-part2' of git://git.kernel.org/p…

    …ub/scm/linux/kernel/git/kdave/linux into for-linus
    masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    57bbddd View commit details
    Browse the repository at this point in the history
  5. Btrfs: fix setup_leaf_for_split() to avoid leaf corruption

    We were incorrectly detecting when the target key didn't exist anymore
    after releasing the path and re-searching the tree. This could make
    us split or duplicate (btrfs_split_item() and btrfs_duplicate_item()
    are its only callers at the moment) an item when we should not.
    
    For the case of duplicating an item, we currently only duplicate
    checksum items (csum tree) and file extent items (fs/subvol trees).
    For the checksum items we end up overriding the item completely,
    but for file extent items we update only some of their fields in
    the copy (done in __btrfs_drop_extents), which means we can end up
    having a logical corruption for some values.
    
    Also for the case where we duplicate a file extent item it will make
    us produce a leaf with a wrong key order, as btrfs_duplicate_item()
    advances us to the next slot and then its caller sets a smaller key
    on the new item at that slot (like in __btrfs_drop_extents() e.g.).
    Alternatively if the tree search in setup_leaf_for_split() leaves
    with path->slots[0] == btrfs_header_nritems(path->nodes[0]), we end
    up accessing beyond the leaf's end (when we check if the item's size
    has changed) and make our caller insert an item at the invalid slot
    btrfs_header_nritems(path->nodes[0]) + 1, causing an invalid memory
    access if the leaf is full or nearly full.
    
    This issue has been present since the introduction of this function
    in 2009:
    
        Btrfs: Add btrfs_duplicate_item
        commit ad48fd7
    
    Signed-off-by: Filipe Manana <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    fdmanana authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    a8df6fe View commit details
    Browse the repository at this point in the history
  6. btrfs: update message levels for errors

    Several messages that point to some internal problem, level INFO is
    wrong here.
    
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    kdave authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    68b663d View commit details
    Browse the repository at this point in the history
  7. btrfs: update message levels during failed mount

    All error conditions from open_ctree shall be ERR. Warning would
    suggest that something's wrong and we can continue.
    
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    kdave authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    aa8ee31 View commit details
    Browse the repository at this point in the history
  8. btrfs: update message levels after checksum errors

    The errors are worth noting and might get missed with INFO level.
    
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    kdave authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    f0954c6 View commit details
    Browse the repository at this point in the history
  9. btrfs: set proper message level for skinny metadata

    This has been confusing people for too long, the message is really just
    informative.
    
    CC: <[email protected]> # 3.10+
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    kdave authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    5efa049 View commit details
    Browse the repository at this point in the history
  10. btrfs: switch extent_state state to unsigned

    Currently there's a 4B hole in the structure between refs and state and there
    are only 16 bits used so we can make it unsigned. This will get a better
    packing and may save some stack space for local variables.
    
    The size of extent_state gets reduced by 8B and there are usually a lot
    of slab objects.
    
    struct extent_state {
    	u64                        start;                /*     0     8 */
    	u64                        end;                  /*     8     8 */
    	struct rb_node             rb_node;              /*    16    24 */
    	wait_queue_head_t          wq;                   /*    40    24 */
    	/* --- cacheline 1 boundary (64 bytes) --- */
    	atomic_t                   refs;                 /*    64     4 */
    
    	/* XXX 4 bytes hole, try to pack */
    
    	long unsigned int          state;                /*    72     8 */
    	u64                        private;              /*    80     8 */
    
    	/* size: 88, cachelines: 2, members: 7 */
    	/* sum members: 84, holes: 1, sum holes: 4 */
    	/* last cacheline: 24 bytes */
    };
    
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    kdave authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    9ee49a0 View commit details
    Browse the repository at this point in the history
  11. btrfs: remove a no-op unfreeze superbock callback

    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    kdave authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    730a78c View commit details
    Browse the repository at this point in the history
  12. Btrfs: lookup for block group only if needed when freeing a tree block

    Very often our extent buffer's header generation doesn't match the current
    transaction's id or it is also referenced by other trees (snapshots), so
    we don't need the corresponding block group cache object. Therefore only
    search for it if we are going to use it, so we avoid an unnecessary search
    in the block groups rbtree (and acquiring and releasing its spinlock).
    
    Freeing a tree block is performed when COWing or deleting a node/leaf,
    which implies we are holding the node/leaf's parent node lock, therefore
    reducing the amount of time spent when freeing a tree block helps reducing
    the amount of time we are holding the parent node's lock.
    
    For example, for a run of xfstests/generic/083, the block group cache
    object was needed only 682 times for a total of 226691 calls to free
    a tree block.
    
    Signed-off-by: Filipe Manana <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    fdmanana authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    6219872 View commit details
    Browse the repository at this point in the history
  13. Btrfs: fix directory inconsistency after fsync log replay

    If we have an inode (file) with a link count greater than 1, remove
    one of its hard links, fsync the inode, power fail/crash and then
    replay the fsync log on the next mount, we end up getting the parent
    directory's metadata inconsistent - its i_size still reflects the
    deleted hard link and has dangling index entries (with no matching
    inode reference entries). This prevents the directory from ever being
    deletable, as its i_size can never decrease to BTRFS_EMPTY_DIR_SIZE
    even if all of its children inodes are deleted, and the dangling index
    entries can never be removed (as they point to an inode that does not
    exist anymore).
    
    This is easy to reproduce with the following excerpt from the test case
    for xfstests that I just made:
    
        _scratch_mkfs >> $seqres.full 2>&1
    
        _init_flakey
        _mount_flakey
    
        # Create a test file with 2 hard links in the same directory.
        mkdir -p $SCRATCH_MNT/a/b
        echo "hello world" > $SCRATCH_MNT/a/b/foo
        ln $SCRATCH_MNT/a/b/foo $SCRATCH_MNT/a/b/bar
    
        # Make sure all metadata and data are durably persisted.
        sync
    
        # Now remove one of the hard links and fsync the inode.
        rm -f $SCRATCH_MNT/a/b/bar
        $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/a/b/foo
    
        # Simulate a crash/power loss. This makes sure the next mount
        # will see an fsync log and will replay that log.
    
        _load_flakey_table $FLAKEY_DROP_WRITES
        _unmount_flakey
    
        _load_flakey_table $FLAKEY_ALLOW_WRITES
        _mount_flakey
    
        # Remove the last hard link of the file and attempt to remove its parent
        # directory - this failed in btrfs because the fsync log and replay code
        # didn't decrement the parent directory's i_size and left dangling directory
        # index entries - this made the btrfs rmdir implementation always fail with
        # the error -ENOTEMPTY.
        #
        # The dangling directory index entries were visible to user space, but it was
        # impossible to do anything on them (unlink, open, read, write, stat, etc)
        # because the inode they pointed to did not exist anymore.
        #
        # The parent directory's metadata inconsistency (stale index entries) was
        # also detected by btrfs' fsck tool, which is run automatically by the fstests
        # framework when the test finishes. The error message reported by fsck was:
        #
        # root 5 inode 259 errors 2001, no inode item, link count wrong
        #   unresolved ref dir 258 index 3 namelen 3 name bar filetype 1 errors 4, no inode ref
        #
        rm -f $SCRATCH_MNT/a/b/*
        rmdir $SCRATCH_MNT/a/b
        rmdir $SCRATCH_MNT/a
    
    To fix this just make sure that after an unlink, if the inode is fsync'ed,
    he parent inode is fully logged in the fsync log.
    
    A test case for xfstests follows soon.
    
    Signed-off-by: Filipe Manana <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    fdmanana authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    d36808e View commit details
    Browse the repository at this point in the history
  14. Btrfs: fix fsync when extend references are added to an inode

    If we added an extended reference to an inode and fsync'ed it, the log
    replay code would make our inode have an incorrect link count, which
    was lower then the expected/correct count.
    This resulted in stale directory index entries after deleting some of
    the hard links, and any access to the dangling directory entries resulted
    in -ESTALE errors because the entries pointed to inode items that don't
    exist anymore.
    
    This is easy to reproduce with the test case I made for xfstests, and
    the bulk of that test is:
    
        _scratch_mkfs "-O extref" >> $seqres.full 2>&1
        _init_flakey
        _mount_flakey
    
        # Create a test file with 3001 hard links. This number is large enough to
        # make btrfs start using extrefs at some point even if the fs has the maximum
        # possible leaf/node size (64Kb).
        echo "hello world" > $SCRATCH_MNT/foo
        for i in `seq 1 3000`; do
            ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_`printf "%04d" $i`
        done
    
        # Make sure all metadata and data are durably persisted.
        sync
    
        # Add one more link to the inode that ends up being a btrfs extref and fsync
        # the inode.
        ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_3001
        $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
    
        # Simulate a crash/power loss. This makes sure the next mount
        # will see an fsync log and will replay that log.
    
        _load_flakey_table $FLAKEY_DROP_WRITES
        _unmount_flakey
    
        _load_flakey_table $FLAKEY_ALLOW_WRITES
        _mount_flakey
    
        # Now after the fsync log replay btrfs left our inode with a wrong link count N,
        # which was smaller than the correct link count M (N < M).
        # So after removing N hard links, the remaining M - N directory entries were
        # still visible to user space but it was impossible to do anything with them
        # because they pointed to an inode that didn't exist anymore. This resulted in
        # stale file handle errors (-ESTALE) when accessing those dentries for example.
        #
        # So remove all hard links except the first one and then attempt to read the
        # file, to verify we don't get an -ESTALE error when accessing the inodel
        #
        # The btrfs fsck tool also detected the incorrect inode link count and it
        # reported an error message like the following:
        #
        # root 5 inode 257 errors 2001, no inode item, link count wrong
        #   unresolved ref dir 256 index 2978 namelen 13 name foo_link_2976 filetype 1 errors 4, no inode ref
        #
        # The fstests framework automatically calls fsck after a test is run, so we
        # don't need to call fsck explicitly here.
    
        rm -f $SCRATCH_MNT/foo_link_*
        cat $SCRATCH_MNT/foo
    
        status=0
        exit
    
    So make sure an fsync always flushes the delayed inode item, so that the
    fsync log contains it (needed in order to trigger the link count fixup
    code) and fix the extref counting function, which always return -ENOENT
    to its caller (and made it assume there were always 0 extrefs).
    
    This issue has been present since the introduction of the extrefs feature
    (2012).
    
    A test case for xfstests follows soon.
    
    Signed-off-by: Filipe Manana <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    fdmanana authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    2c2c452 View commit details
    Browse the repository at this point in the history
  15. Btrfs: fix fsync log replay for inodes with a mix of regular refs and…

    … extrefs
    
    If we have an inode with a large number of hard links, some of which may
    be extrefs, turn a regular ref into an extref, fsync the inode and then
    replay the fsync log (after a crash/reboot), we can endup with an fsync
    log that makes the replay code always fail with -EOVERFLOW when processing
    the inode's references.
    
    This is easy to reproduce with the test case I made for xfstests. Its steps
    are the following:
    
       _scratch_mkfs "-O extref" >> $seqres.full 2>&1
       _init_flakey
       _mount_flakey
    
       # Create a test file with 3001 hard links. This number is large enough to
       # make btrfs start using extrefs at some point even if the fs has the maximum
       # possible leaf/node size (64Kb).
       echo "hello world" > $SCRATCH_MNT/foo
       for i in `seq 1 3000`; do
           ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_`printf "%04d" $i`
       done
    
       # Make sure all metadata and data are durably persisted.
       sync
    
       # Now remove one link, add a new one with a new name, add another new one with
       # the same name as the one we just removed and fsync the inode.
       rm -f $SCRATCH_MNT/foo_link_0001
       ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_3001
       ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_0001
       rm -f $SCRATCH_MNT/foo_link_0002
       ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_3002
       ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link_3003
       $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
    
       # Simulate a crash/power loss. This makes sure the next mount
       # will see an fsync log and will replay that log.
    
       _load_flakey_table $FLAKEY_DROP_WRITES
       _unmount_flakey
    
       _load_flakey_table $FLAKEY_ALLOW_WRITES
       _mount_flakey
    
       # Check that the number of hard links is correct, we are able to remove all
       # the hard links and read the file's data. This is just to verify we don't
       # get stale file handle errors (due to dangling directory index entries that
       # point to inodes that no longer exist).
       echo "Link count: $(stat --format=%h $SCRATCH_MNT/foo)"
       [ -f $SCRATCH_MNT/foo ] || echo "Link foo is missing"
       for ((i = 1; i <= 3003; i++)); do
           name=foo_link_`printf "%04d" $i`
           if [ $i -eq 2 ]; then
               [ -f $SCRATCH_MNT/$name ] && echo "Link $name found"
           else
               [ -f $SCRATCH_MNT/$name ] || echo "Link $name is missing"
           fi
       done
       rm -f $SCRATCH_MNT/foo_link_*
       cat $SCRATCH_MNT/foo
       rm -f $SCRATCH_MNT/foo
    
       status=0
       exit
    
    The fix is simply to correct the overflow condition when overwriting a
    reference item because it was wrong, trying to increase the item in the
    fs/subvol tree by an impossible amount. Also ensure that we don't insert
    one normal ref and one ext ref for the same dentry - this happened because
    processing a dir index entry from the parent in the log happened when
    the normal ref item was full, which made the logic insert an extref and
    later when the normal ref had enough room, it would be inserted again
    when processing the ref item from the child inode in the log.
    
    This issue has been present since the introduction of the extrefs feature
    (2012).
    
    A test case for xfstests follows soon. This test only passes if the previous
    patch titled "Btrfs: fix fsync when extend references are added to an inode"
    is applied too.
    
    Signed-off-by: Filipe Manana <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    fdmanana authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    df8d116 View commit details
    Browse the repository at this point in the history
  16. Btrfs: fix a out-of-bound access of raid_map

    We add the number of stripes on target devices into bbio->num_stripes
    if we are under device replacement, and we just sort the raid_map of
    those stripes that not on the target devices, so if when we need
    real raid_map, we need skip the stripes on the target devices.
    
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    e34c330 View commit details
    Browse the repository at this point in the history
  17. Btrfs: sort raid_map before adding tgtdev stripes

    It can avoid complex calculation of real stripes in sort,
    moreover, we can clean up code of sorting tgtdev_map because it
    will be in order initially.
    
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    cc7539e View commit details
    Browse the repository at this point in the history
  18. Btrfs: Make raid_map array be inlined in btrfs_bio structure

    It can make code more simple and clear, we need not care about
    free bbio and raid_map together.
    
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    8e5cfb5 View commit details
    Browse the repository at this point in the history
  19. Btrfs: add ref_count and free function for btrfs_bio

    1: ref_count is simple than current RBIO_HOLD_BBIO_MAP_BIT flag
       to keep btrfs_bio's memory in raid56 recovery implement.
    2: free function for bbio will make code clean and flexible, plus
       forced data type checking in compile.
    
    Changelog v1->v2:
     Rename following by David Sterba's suggestion:
     put_btrfs_bio() -> btrfs_put_bio()
     get_btrfs_bio() -> btrfs_get_bio()
     bbio->ref_count -> bbio->refs
    
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    6e9606d View commit details
    Browse the repository at this point in the history
  20. Btrfs: Fix a jump typo of nodatasum_case to avoid wrong WARN_ON()

    if (sctx->is_dev_replace && !is_metadata && !have_csum) {
        ...
        goto nodatasum_case;
    }
    ...
    nodatasum_case:
        WARN_ON(sctx->is_dev_replace);
    
    In above code, nodatasum_case marker should be moved after
    WARN_ON().
    
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    b25c94c View commit details
    Browse the repository at this point in the history
  21. Btrfs: Remove noneed force_write in scrub_write_block_to_dev_replace

    It is always 1 in this place, because !1 case was already jumped
    out in previous code.
    
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    114ab50 View commit details
    Browse the repository at this point in the history
  22. Btrfs: Cleanup btrfs_bio_counter_inc_blocked()

    1: Remove no-need DEFINE_WAIT(wait)
    2: Add likely() for BTRFS_FS_STATE_DEV_REPLACING condition
    3: Use while loop instead of goto
    
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    09dd7a0 View commit details
    Browse the repository at this point in the history
  23. Btrfs: btrfs_rm_dev_replace_blocked(): Use wait_event()

    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    7653947 View commit details
    Browse the repository at this point in the history
  24. Btrfs: Break loop when reach BTRFS_MAX_MIRRORS in scrub_setup_recheck…

    …_block()
    
    Use break instead of useless loop should be more suitable in this
    case.
    
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    dc5f7a3 View commit details
    Browse the repository at this point in the history
  25. Btrfs: Separate finding-right-mirror and writing-to-target's process …

    …in scrub_handle_errored_block()
    
    In corrent code, code of finding-right-mirror and writing-to-target
    are mixed in logic, if we find a right mirror but failed in writing
    to target, it will treat as "hadn't found right block", and fill the
    target with sblock_bad.
    
    Actually, "failed in writing to target" does not mean "source
    block is wrong", this patch separate above two condition in logic,
    and do some cleanup to make code clean.
    
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    8d6738c View commit details
    Browse the repository at this point in the history
  26. Btrfs: Combine per-page recover in dev-replace and scrub

    The code are similar, combine them to make code clean and easy to maintenance.
    Some lost condition are also completed with benefit of this combination.
    
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    b968fed View commit details
    Browse the repository at this point in the history
  27. Btrfs: Simplify scrub_setup_recheck_block()'s argument

    scrub_setup_recheck_block() have many arguments but most of them
    can be get from one of them, we can remove them to make code clean.
    Some other cleanup for that function also included in this patch.
    
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    be50a8d View commit details
    Browse the repository at this point in the history
  28. Btrfs: Include map_type in raid_bio

    Corrent code use many kinds of "clever" way to determine operation
    target's raid type, as:
      raid_map != NULL
      or
      raid_map[MAX_NR] == RAID[56]_Q_STRIPE
    
    To make code easy to maintenance, this patch put raid type into
    bbio, and we can always get raid type from bbio with a "stupid"
    way.
    
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    10f1190 View commit details
    Browse the repository at this point in the history
  29. Btrfs: Introduce BTRFS_BLOCK_GROUP_RAID56_MASK to check raid56 simply

    So we can check raid56 with:
     (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK)
    instead of long:
     (map->type & (BTRFS_BLOCK_GROUP_RAID5 | BTRFS_BLOCK_GROUP_RAID6))
    
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Miao Xie <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    ffe2d20 View commit details
    Browse the repository at this point in the history
  30. Rename all ref_count to refs in struct

    refs is better than ref_count to record a struct's ref count.
    
    Signed-off-by: Zhao Lei <[email protected]>
    Suggested-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    5701934 View commit details
    Browse the repository at this point in the history
  31. Btrfs: cleanup unused run_most

    "run_most" is not used anymore.
    
    Signed-off-by: Liu Bo <[email protected]>
    Reviewed-by: Satoru Takeuchi <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    Liu Bo authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    26455d3 View commit details
    Browse the repository at this point in the history
  32. btrfs: qgroup: move WARN_ON() to the correct location.

    In function qgroup_excl_accounting(), we need to WARN when
    qg->excl is less than what we want to free, same to child
    and parents. But currently, for parent qgroup, the WARN_ON()
    is located after freeing qg->excl. It will WARN out even we
    free it normally.
    
    This patch move this WARN_ON() before freeing qg->excl.
    
    Signed-off-by: Dongsheng Yang <[email protected]>
    Reviewed-by: Satoru Takeuchi <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    Yang Dongsheng authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    0ee13fe View commit details
    Browse the repository at this point in the history
  33. Btrfs: fix unused members in struct btrfs_root

    There isn't any real use of following members of struct btrfs_root
    so delete them.
    
    struct kobject root_kobj;
    struct completion kobj_unregister;
    
    Signed-off-by: Anand Jain <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    asj authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    78f55e5 View commit details
    Browse the repository at this point in the history
  34. Btrfs: insert_new_root: Fix lock type of the extent buffer.

    btrfs_alloc_tree_block() returns an extent buffer on which a blocked lock has
    been taken. Hence assign the appropriate value to path->locks[level].
    
    Signed-off-by: Chandan Rajendra <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    chandan authored and masoncl committed Jan 22, 2015
    Configuration menu
    Copy the full SHA
    95449a1 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2015

  1. toshiba_acpi: Add support for USB Sleep and Charge function

    Newer Toshiba models now come with a feature called Sleep and Charge,
    where the computer USB ports remain powered when the computer is
    asleep or turned off.
    
    This patch adds support to such feature, creating a sysfs entry
    called "usb_sleep_charge" to set the desired charging mode or to
    disable it.
    
    The sysfs entry accepts three parameters, 0, 1 and 2, beign disabled,
    alternate and auto respectively.
    
    The auto mode stands for USB conformant devices (which most are), and
    the alternate mode stands for those non USB conformant devices that
    require more power.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Jan 23, 2015
    Configuration menu
    Copy the full SHA
    e26ffe5 View commit details
    Browse the repository at this point in the history
  2. toshiba_acpi: Add support for USB Sleep functions under battery

    Toshiba laptops supporting USB Sleep and Charge also come with a
    feature called "USB functions under battery", which what it does when
    enabled, is allows the USB Sleep functions when the computer is under
    battery power.
    
    This patch adds support to that function, creating a sysfs entry
    named "sleep_functions_on_battery", accepting values from 0-100,
    where zero disables the function and 1-100 sets the battery level at
    which point the USB Sleep functions will be disabled, and printing
    the current state of the functon and also the battery level currently
    set.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Jan 23, 2015
    Configuration menu
    Copy the full SHA
    182bcaa View commit details
    Browse the repository at this point in the history
  3. toshiba_acpi: Add support for USB Rapid Charge

    Newer Toshiba laptops equipped with USB 3.0 ports now have the
    functionality of rapid charging devices connected to their USB hubs.
    
    This patch adds support to use such feature by creating a sysfs entry
    named "usb_rapid_charge", accepting only two values, 0 to disable and
    1 to enable, however, the machine needs a restart everytime the
    function is toggled.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Jan 23, 2015
    Configuration menu
    Copy the full SHA
    bb3fe01 View commit details
    Browse the repository at this point in the history
  4. toshiba_acpi: Add support for USB Sleep and Music

    Newer Toshiba laptops now come with a feature called USB Sleep and
    Music, where the laptop speakers remain powered and the line-in jack
    is used to connect an external device to use the laptop speakers when
    the computer is asleep or turned off.
    
    This patchs adds support to such feature, by creating a sysfs entry
    named "usb_sleep_music", accepting only two values, 0 to disable and
    1 to enable.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Jan 23, 2015
    Configuration menu
    Copy the full SHA
    172ce0a View commit details
    Browse the repository at this point in the history
  5. samsung-laptop: Add use_native_backlight quirk, and enable it on some…

    … models
    
    Since kernel 3.14 the backlight control has been broken on various Samsung
    Atom based netbooks. This has been bisected and this problem happens since
    commit b35684b ("drm/i915: do full backlight setup at enable time")
    
    This has been reported and discussed in detail here:
    http://lists.freedesktop.org/archives/intel-gfx/2014-July/049395.html
    
    Unfortunately no-one has been able to fix this. This only affects Samsung
    Atom netbooks, and the Linux kernel and the BIOS of those laptops have never
    worked well together. All affected laptops already have a quirk to avoid using
    the standard acpi-video interface and instead use the samsung specific SABI
    interface which samsung-laptop uses. It seems that recent fixes to the i915
    driver have also broken backlight control through the SABI interface.
    
    The intel_backlight driver OTOH works fine, and also allows for finer grained
    backlight control. So add a new use_native_backlight quirk, and replace the
    broken_acpi_video quirk with this quirk for affected models. This new quirk
    disables acpi-video as before and also stops samsung-laptop from registering
    the SABI based samsung_laptop backlight interface, leaving only the working
    intel_backlight interface.
    
    This commit enables this new quirk for 3 models which are known to be affected,
    chances are that it needs to be used on other models too.
    
    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1094948 # N145P
    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1115713 # N250P
    Reported-by: Bertrik Sikken <[email protected]> # N150P
    Cc: [email protected] # 3.16
    Signed-off-by: Hans de Goede <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    jwrdegoede authored and dvhart committed Jan 23, 2015
    Configuration menu
    Copy the full SHA
    4690555 View commit details
    Browse the repository at this point in the history
  6. fujitsu-laptop: use FB_BLANK_* constants

    Replace the magic numbers in fujitsu-laptop.c by the appropriate FB_BLANK
    constants, as indicated by the comment for backlight_properties.power in
    include/linux/backlight.h.
    
    Signed-off-by: Michael Karcher <[email protected]>
    Acked-by: Jonathan Woithe <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Michael Karcher authored and dvhart committed Jan 23, 2015
    Configuration menu
    Copy the full SHA
    e8549e2 View commit details
    Browse the repository at this point in the history
  7. asus-laptop: Fix is_visible return value

    With a Lucid platform, asus_sysfs_is_visible() returned a boolean for
    ls_switch and ls_level attributes.
    
    Signed-off-by: Vivien Didelot <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    vivien authored and dvhart committed Jan 23, 2015
    Configuration menu
    Copy the full SHA
    03070e7 View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2015

  1. thermal: exynos: cosmetic: Correct comment format

    Signed-off-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Lukasz Majewski authored and Eduardo Valentin committed Jan 24, 2015
    Configuration menu
    Copy the full SHA
    afae144 View commit details
    Browse the repository at this point in the history
  2. thermal: exynos: Provide thermal_exynos.h file to be included in devi…

    …ce tree files
    
    This patch is a preparatory patch to be able to read Exynos thermal
    configuration from the device tree.
    
    It turned out that DTC is not able to interpret enums properly and hence
    it is necessary to #define those values explicitly.
    
    For this reason the ./include/dt-bindings/thermal/thermal_exynos.h file
    has been introduced.
    
    Signed-off-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Lukasz Majewski authored and Eduardo Valentin committed Jan 24, 2015
    Configuration menu
    Copy the full SHA
    f5576e3 View commit details
    Browse the repository at this point in the history
  3. thermal: exynos: Modify exynos thermal code to use device tree for cp…

    …u cooling configuration
    
    Up till now exynos_tmu_data.c was used for storing CPU cooling configuration
    data. Now the Exynos thermal core code uses device tree to get this data.
    For this purpose generic thermal code for configuring CPU cooling was
    used.
    
    Signed-off-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Lukasz Majewski authored and Eduardo Valentin committed Jan 24, 2015
    Configuration menu
    Copy the full SHA
    1fe391b View commit details
    Browse the repository at this point in the history
  4. cpufreq: exynos: Use device tree to determine if cpufreq cooling shou…

    …ld be registered
    
    With thermal subsystem rework it is necessary to tune current cpufreq code
    to use cpu frequency change as a potential cooling device.
    
    Now the cpu cooling device is registered only when proper nodes and properties
    are available in device tree. Lack of them, however, will not prevent
    cpufreq for normal operation.
    
    Signed-off-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Lukasz Majewski authored and Eduardo Valentin committed Jan 24, 2015
    Configuration menu
    Copy the full SHA
    e725d26 View commit details
    Browse the repository at this point in the history
  5. dts: Documentation: Extending documentation entry for exynos-thermal

    Properties necessary for providing Exynos thermal configuration via device
    tree.
    
    Signed-off-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Lukasz Majewski authored and Eduardo Valentin committed Jan 24, 2015
    Configuration menu
    Copy the full SHA
    7e20525 View commit details
    Browse the repository at this point in the history
  6. dts: Documentation: Update exynos-thermal.txt example for Exynos5440

    Updating exynos-thermal.txt documentation entry for Exynos5440
    
    Signed-off-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Lukasz Majewski authored and Eduardo Valentin committed Jan 24, 2015
    Configuration menu
    Copy the full SHA
    d29f0a1 View commit details
    Browse the repository at this point in the history
  7. thermal: samsung: core: Exynos TMU rework to use device tree for conf…

    …iguration
    
    This patch brings support for providing configuration via device tree.
    Previously this data has been hardcoded in the exynos_tmu_data.c file.
    Such approach was not scalable and very often required copying the whole
    data.
    
    Signed-off-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Lukasz Majewski authored and Eduardo Valentin committed Jan 24, 2015
    Configuration menu
    Copy the full SHA
    3b6a1a8 View commit details
    Browse the repository at this point in the history
  8. thermal: exynos: Remove exynos_thermal_common.[c|h] files

    After defining all necessary Exynos data in the device tree and heavy
    reusage of the of-thermal.c those files can be removed.
    
    Signed-off-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Lukasz Majewski authored and Eduardo Valentin committed Jan 24, 2015
    Configuration menu
    Copy the full SHA
    1fd2273 View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2015

  1. thermal: rockchip: make temperature reporting much more accurate

    In general, the kernel should report temperature readings exactly as
    reported by the hardware. The cpu / gpu thermal driver works in 5 degree
    increments,but we ought to do more accurate. The temperature will do
    linear interpolation between the entries in the table.
    
    Test= $md5sum /dev/zero &
    $while true; do grep "" /sys/class/thermal/thermal_zone[1-2]/temp;
    sleep .5; done
    
    e.g. We can get the result as follows:
        /sys/class/thermal/thermal_zone1/temp:39994
        /sys/class/thermal/thermal_zone2/temp:39086
        /sys/class/thermal/thermal_zone1/temp:39994
        /sys/class/thermal/thermal_zone2/temp:39540
        /sys/class/thermal/thermal_zone1/temp:39540
        /sys/class/thermal/thermal_zone2/temp:39540
        /sys/class/thermal/thermal_zone1/temp:39540
        /sys/class/thermal/thermal_zone2/temp:39994
    
    Reviewed-by: Dmitry Torokhov <[email protected]>
    Reviewed-by: Daniel Kurtz <[email protected]>
    Signed-off-by: Caesar Wang <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Caesar-github authored and Eduardo Valentin committed Jan 25, 2015
    Configuration menu
    Copy the full SHA
    1e9a1ae View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2015

  1. thermal: exynos: Remove exynos_tmu_data.c file

    Data already present in the exynos_tmu_data.c file has been moved to the
    appropriate device tree files.
    
    Signed-off-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Lukasz Majewski authored and Eduardo Valentin committed Jan 26, 2015
    Configuration menu
    Copy the full SHA
    1024cf8 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2015

  1. thermal: Kconfig: Remove config for not used EXYNOS_THERMAL_CORE

    After removing exynos_thermal_common.[c|h] files the CONFIG_EXYNOS_THERMA_CORE
    is not needed anymore.
    This patch removes this entry from Kconfig.
    
    Reported-by: Paul Bolle <[email protected]>
    Signed-off-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Lukasz Majewski authored and Eduardo Valentin committed Jan 27, 2015
    Configuration menu
    Copy the full SHA
    d3a5247 View commit details
    Browse the repository at this point in the history
  2. kconfig: use va_end to match corresponding va_start

    Although on some systems va_end is a no-op, it is good practice
    to use va_end, especially since the manual states:
    
    "Each invocation of va_start() must be matched by a corresponding
    invocation of va_end() in the same function."
    
    Signed-off-by: Colin Ian King <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    Colin Ian King authored and michal42 committed Jan 27, 2015
    Configuration menu
    Copy the full SHA
    b6a2ab2 View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2015

  1. thermal: exynos: Correct sanity check at exynos_report_trigger() func…

    …tion
    
    Up till now, by mistake, wrong variable was tested against being NULL.
    Since exynos_report_trigger() is always called with valid p pointer,
    it is only necessary to check if a valid thermal zone device is passed.
    
    Reported-by: Dan Carpenter <[email protected]>
    Signed-off-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Lukasz Majewski authored and Eduardo Valentin committed Jan 28, 2015
    Configuration menu
    Copy the full SHA
    eccb601 View commit details
    Browse the repository at this point in the history
  2. thermal: Fix examples in DT documentation

    There are various issues with the examples in this documentation, some
    of the DT labels are invalid and one of the macro THERMAL_NO_LIMITS
    referenced is not available as well.
    
    This patch attempts to fix such errors in the documentation.
    
    Signed-off-by: Srinivas Kandagatla <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Srinivas-Kandagatla authored and Eduardo Valentin committed Jan 28, 2015
    Configuration menu
    Copy the full SHA
    252454f View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2015

  1. thermal: Intel SoC DTS: Add Braswell support

    Added Intel Braswell CPU id for SOC DTS. Since this doesn't support
    APIC IRQ, the driver is modified to have capability to not register
    any modifiable trips.
    
    Signed-off-by: Srinivas Pandruvada <[email protected]>
    Signed-off-by: Zhang Rui <[email protected]>
    spandruvada authored and zhang-rui committed Jan 29, 2015
    Configuration menu
    Copy the full SHA
    6c355fa View commit details
    Browse the repository at this point in the history
  2. intel_scu_ipc: fix indentation in few places

    While here, do couple of amendments:
     - move platform variable to the function where it's used
     - define intel_scu_ipc_check_status() static
    
    Signed-off-by: Andy Shevchenko <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    andy-shev authored and dvhart committed Jan 29, 2015
    Configuration menu
    Copy the full SHA
    7c2e3c7 View commit details
    Browse the repository at this point in the history
  3. intel_scu_ipc: move error check out of the loop

    This is small performance optimization of the busy_loop().
    
    While here, use BIT() macro instead of plain integers when check the status.
    
    Signed-off-by: Andy Shevchenko <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    andy-shev authored and dvhart committed Jan 29, 2015
    Configuration menu
    Copy the full SHA
    f0295a3 View commit details
    Browse the repository at this point in the history
  4. intel_scu_ipc: Read resources from PCI configuration

    Read the resources from PCI BAR0 instead of using hardcoded values.
    
    Signed-off-by: Andy Shevchenko <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    andy-shev authored and dvhart committed Jan 29, 2015
    Configuration menu
    Copy the full SHA
    32d0e4a View commit details
    Browse the repository at this point in the history
  5. asus-laptop: use DEVICE_ATTR_xx macros

    Use DEVICE_ATTR_{RO,WO,RW} macros to simplify sysfs attributes
    declaration.
    
    To declare a "foo" attribute, DEVICE_ATTR_RW() requires foo_show() and
    foo_store(), so rename a few functions to satisfy this requirement.
    
    Also put the macro below each related show/store functions for clarity.
    
    Signed-off-by: Vivien Didelot <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    vivien authored and dvhart committed Jan 29, 2015
    Configuration menu
    Copy the full SHA
    ed52ccb View commit details
    Browse the repository at this point in the history
  6. toshiba_acpi: Add a check for TOS_NOT_SUPPORTED in the sci_open function

    This was "toshiba_acpi: Change sci_open function return value"
    
    Some Toshiba laptops have "poorly implemented" SCI calls on their
    BIOSes and are not checking for sci_{open, close} calls, therefore,
    the sci_open function is failing and making some of the supported
    features unavailable (kbd backlight, touchpad, illumination, etc.).
    
    This patch checks whether we receive TOS_NOT_SUPPORTED and returns
    1, making the supported features work on such laptops.
    
    In the case that some laptops really do not support the SCI, all the
    SCI dependent functions check for TOS_NOT_SUPPORTED, and thus, not
    registering support for the queried feature.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Jan 29, 2015
    Configuration menu
    Copy the full SHA
    fa46573 View commit details
    Browse the repository at this point in the history
  7. ACPI / LPAT: Common table processing functions

    Since LPAT table processing is also required for other thermal drivers,
    moved LPAT table related functions from intel PMIC driver (intel_pmic.c)
    to a stand alonge module with exported interfaces.
    In this way there will be no code duplication.
    
    Signed-off-by: Srinivas Pandruvada <[email protected]>
    Signed-off-by: Zhang Rui <[email protected]>
    spandruvada authored and zhang-rui committed Jan 29, 2015
    Configuration menu
    Copy the full SHA
    c55d628 View commit details
    Browse the repository at this point in the history
  8. ACPI / PMIC: Use common LPAT table handling functions

    The LPAT table processing functions from this modules are moved to a
    standalone module with exported interface functions.
    Using new interface functions in this module.
    
    Signed-off-by: Srinivas Pandruvada <[email protected]>
    Signed-off-by: Zhang Rui <[email protected]>
    spandruvada authored and zhang-rui committed Jan 29, 2015
    Configuration menu
    Copy the full SHA
    ac586e2 View commit details
    Browse the repository at this point in the history
  9. Thermal/int340x: LPAT conversion for temperature

    When LPAT table is present, we need to convert raw temperature to
    real temp using LPAT.
    
    Signed-off-by: Srinivas Pandruvada <[email protected]>
    Signed-off-by: Zhang Rui <[email protected]>
    spandruvada authored and zhang-rui committed Jan 29, 2015
    Configuration menu
    Copy the full SHA
    317d9dd View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2015

  1. Configuration menu
    Copy the full SHA
    8cb6850 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2015

  1. cpufreq: exynos: allow modular build

    The exynos cpufreq driver code recently gained a dependency on the
    cooling code, which may be a loadable module. This breaks an ARM
    allmodconfig build:
    
    drivers/built-in.o: In function `exynos_cpufreq_probe':
    :(.text+0x1748e8): undefined reference to `of_cpufreq_cooling_register'
    
    To avoid this problem, change cpufreq Kconfig to allow the drivers
    to be loadable modules as well and enforce a dependency on the
    thermal module.
    
    This change, in order to allow module builds on this cpufreq
    driver, properly constructs the driver into a single module,
    instead of several modules. The change also keeps the proper
    platform dependency, and therefore, it wont load in platforms
    that are not supposed to be loaded. The user will be able to
    build the support for all platforms, or select which platforms
    (s)he wants (as originally), except that now it can be a module,
    instead.
    
    Besides, it will still keep the driver only on those configs
    that expect it to be on. And it won't compile/load on platforms
    that it is not supposed to. It brings the config ARM_EXYNOS_CPU_FREQ_BOOST_SW
    closer to this driver, so it looks better in the menuconfig.
    
    We intentionally change ARM_EXYNOS5440_CPUFREQ to be tristate too, to
    avoid future troubles.
    
    Cc: Viresh Kumar <[email protected]>
    Cc: Kukjin Kim <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Fixes: e725d26 ("cpufreq: exynos: Use device tree to determine if cpufreq cooling should be registered")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    arndb authored and Eduardo Valentin committed Jan 31, 2015
    Configuration menu
    Copy the full SHA
    8b2b4a4 View commit details
    Browse the repository at this point in the history
  2. dts: Documentation: Add documentation for Exynos7 SoC thermal bindings

    Add documentation for exynos7 thermal bindings including compatible
    name and special clock properties.
    
    Acked-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Abhilash Kesavan <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Abhilash Kesavan authored and Eduardo Valentin committed Jan 31, 2015
    Configuration menu
    Copy the full SHA
    14ccc17 View commit details
    Browse the repository at this point in the history
  3. thermal: exynos: Add TMU support for Exynos7 SoC

    Add registers, bit fields and compatible strings for Exynos7 TMU
    (Thermal Management Unit). Following are a few of the differences
    in the Exynos7 TMU from earlier SoCs:
            - 8 trigger levels
            - Different bit offsets and more registers for the rising
            and falling thresholds.
            - New power down detection bit in the TMU_CONTROL register
            which does not update the CURRENT_TEMP0 when tmu power down
            is detected.
            - Change in bit offset for the NEXT_DATA field of EMUL_CON
            register. EMUL_CON register address has also changed.
            - INTSTAT and INTCLEAR registers present in earlier SoCs
            have been combined into one INTPEND register. The register
            address for INTCLEAR and INTPEND is also different.
            - Since there are 8 rising/falling interrupts as against
            at most 4 in earlier SoCs the INTEN bit offsets are different.
            - Multiple probe support which is handled by a TMU_CONTROL1
            register (No support for this in the current patch).
    
    This patch adds special clock support required only for Exynos7. It
    also updates the "code_to_temp" prototype as Exynos7 has 9 bit
    code-temp mapping.
    
    Acked-by: Lukasz Majewski <[email protected]>
    Tested-by: Lukasz Majewski <[email protected]>
    Signed-off-by: Abhilash Kesavan <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Abhilash Kesavan authored and Eduardo Valentin committed Jan 31, 2015
    Configuration menu
    Copy the full SHA
    6c24739 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2015

  1. btrfs: kill btrfs_inode_*time helpers

    They just opencode taking address of the timespec member.
    
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    kdave authored and masoncl committed Feb 3, 2015
    Configuration menu
    Copy the full SHA
    a937b97 View commit details
    Browse the repository at this point in the history
  2. Btrfs: Add code to support file creation time

    This patch adds a new member to the 'struct btrfs_inode' structure to hold
    the file creation time.
    
    Signed-off-by: chandan <[email protected]>
    [refreshed, removed btrfs_inode_otime]
    Signed-off-by: David Sterba <[email protected]>
    
    Signed-off-by: Chris Mason <[email protected]>
    chandanr authored and masoncl committed Feb 3, 2015
    Configuration menu
    Copy the full SHA
    9cc97d6 View commit details
    Browse the repository at this point in the history
  3. btrfs: more superblock checks, lower bounds on devices and sectorsize…

    …/nodesize
    
    I received a few crafted images from Jiri, all got through the recently
    added superblock checks. The lower bounds checks for num_devices and
    sector/node -sizes were missing and caused a crash during mount.
    
    Tools for symbolic code execution were used to prepare the images
    contents.
    
    Reported-by: Jiri Slaby <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    kdave authored and masoncl committed Feb 3, 2015
    Configuration menu
    Copy the full SHA
    75d6ad3 View commit details
    Browse the repository at this point in the history
  4. btrfs: add checks for sys_chunk_array sizes

    Verify that possible minimum and maximum size is set, validity of
    contents is checked in btrfs_read_sys_array.
    
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    kdave authored and masoncl committed Feb 3, 2015
    Configuration menu
    Copy the full SHA
    ce7fca5 View commit details
    Browse the repository at this point in the history
  5. btrfs: cleanup, rename a few variables in btrfs_read_sys_array

    There's a pointer to buffer, integer offset and offset passed as
    pointer, try to find matching names for them.
    
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    kdave authored and masoncl committed Feb 3, 2015
    Configuration menu
    Copy the full SHA
    1ffb22c View commit details
    Browse the repository at this point in the history
  6. btrfs: add more checks to btrfs_read_sys_array

    Verify that the sys_array has enough bytes to read the next item.
    
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    kdave authored and masoncl committed Feb 3, 2015
    Configuration menu
    Copy the full SHA
    e3540ea View commit details
    Browse the repository at this point in the history
  7. Btrfs: fix race between transaction commit and empty block group removal

    Committing a transaction can race with automatic removal of empty block
    groups (cleaner kthread), leading to a BUG_ON() in the transaction
    commit code while running btrfs_finish_extent_commit(). The following
    sequence diagram shows how it can happen:
    
               CPU 1                                       CPU 2
    
    btrfs_commit_transaction()
      fs_info->running_transaction = NULL
      btrfs_finish_extent_commit()
        find_first_extent_bit()
          -> found range for block group X
             in fs_info->freed_extents[]
    
                                                   btrfs_delete_unused_bgs()
                                                     -> found block group X
    
                                                     Removed block group X's range
                                                     from fs_info->freed_extents[]
    
                                                     btrfs_remove_chunk()
                                                        btrfs_remove_block_group(bg X)
    
        unpin_extent_range(bg X range)
           btrfs_lookup_block_group(bg X)
              -> returns NULL
                -> BUG_ON()
    
    The trace that results from the BUG_ON() is:
    
    [48665.187808] ------------[ cut here ]------------
    [48665.188032] kernel BUG at fs/btrfs/extent-tree.c:5675!
    [48665.188032] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
    [48665.188032] Modules linked in: dm_flakey dm_mod crc32c_generic btrfs xor raid6_pq nfsd auth_rpcgss oid_registry nfs_acl nfs lockd grace fscache sunrpc loop parport_pc evdev microcode
    [48665.197388] CPU: 2 PID: 31211 Comm: kworker/u32:16 Tainted: G        W      3.19.0-rc5-btrfs-next-4+ #1
    [48665.197388] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014
    [48665.197388] Workqueue: events_unbound btrfs_async_reclaim_metadata_space [btrfs]
    [48665.197388] task: ffff880222011810 ti: ffff8801b56a4000 task.ti: ffff8801b56a4000
    [48665.197388] RIP: 0010:[<ffffffffa0350d05>]  [<ffffffffa0350d05>] unpin_extent_range+0x6a/0x1ba [btrfs]
    [48665.197388] RSP: 0018:ffff8801b56a7b88  EFLAGS: 00010246
    [48665.197388] RAX: 0000000000000000 RBX: ffff8802143a6000 RCX: ffff8802220120c8
    [48665.197388] RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff8800a3c140b0
    [48665.197388] RBP: ffff8801b56a7bd8 R08: 0000000000000003 R09: 0000000000000000
    [48665.197388] R10: 0000000000000000 R11: 000000000000bbac R12: 0000000012e8e000
    [48665.197388] R13: ffff8800a3c14000 R14: 0000000000000000 R15: 0000000000000000
    [48665.197388] FS:  0000000000000000(0000) GS:ffff88023ec40000(0000) knlGS:0000000000000000
    [48665.197388] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    [48665.197388] CR2: 00007f065e42f270 CR3: 0000000206f70000 CR4: 00000000000006e0
    [48665.197388] Stack:
    [48665.197388]  ffff8801b56a7bd8 0000000012ea0000 01ff8800a3c14138 0000000012e9ffff
    [48665.197388]  ffff880141df3dd8 ffff8802143a6000 ffff8800a3c14138 ffff880141df3df0
    [48665.197388]  ffff880141df3dd8 0000000000000000 ffff8801b56a7c08 ffffffffa0354227
    [48665.197388] Call Trace:
    [48665.197388]  [<ffffffffa0354227>] btrfs_finish_extent_commit+0xb0/0xd9 [btrfs]
    [48665.197388]  [<ffffffffa0366b4b>] btrfs_commit_transaction+0x791/0x92c [btrfs]
    [48665.197388]  [<ffffffffa0352432>] flush_space+0x43d/0x452 [btrfs]
    [48665.197388]  [<ffffffff814295c3>] ? _raw_spin_unlock+0x28/0x33
    [48665.197388]  [<ffffffffa035255f>] btrfs_async_reclaim_metadata_space+0x118/0x164 [btrfs]
    [48665.197388]  [<ffffffff81059917>] ? process_one_work+0x14b/0x3ab
    [48665.197388]  [<ffffffff810599ac>] process_one_work+0x1e0/0x3ab
    [48665.197388]  [<ffffffff81079fa9>] ? trace_hardirqs_off+0xd/0xf
    [48665.197388]  [<ffffffff8105a55b>] worker_thread+0x210/0x2d0
    [48665.197388]  [<ffffffff8105a34b>] ? rescuer_thread+0x2c3/0x2c3
    [48665.197388]  [<ffffffff8105e5c0>] kthread+0xef/0xf7
    [48665.197388]  [<ffffffff81429682>] ? _raw_spin_unlock_irq+0x2d/0x39
    [48665.197388]  [<ffffffff8105e4d1>] ? __kthread_parkme+0xad/0xad
    [48665.197388]  [<ffffffff81429dec>] ret_from_fork+0x7c/0xb0
    [48665.197388]  [<ffffffff8105e4d1>] ? __kthread_parkme+0xad/0xad
    [48665.197388] Code: 85 f6 74 14 49 8b 06 49 03 46 09 49 39 c4 72 1d 4c 89 f7 e8 83 ec ff ff 4c 89 e6 4c 89 ef e8 1e f1 ff ff 48 85 c0 49 89 c6 75 02 <0f> 0b 49 8b 1e 49 03 5e 09 48 8b
    [48665.197388] RIP  [<ffffffffa0350d05>] unpin_extent_range+0x6a/0x1ba [btrfs]
    [48665.197388]  RSP <ffff8801b56a7b88>
    [48665.272246] ---[ end trace b9c6ab9957521376 ]---
    
    Fix this by ensuring that unpining the block group's range in
    btrfs_finish_extent_commit() is done in a synchronized fashion
    with removing the block group's range from freed_extents[]
    in btrfs_delete_unused_bgs()
    
    This race got introduced with the change:
    
        Btrfs: remove empty block groups automatically
        commit 47ab2a6
    
    Signed-off-by: Filipe Manana <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    fdmanana authored and masoncl committed Feb 3, 2015
    Configuration menu
    Copy the full SHA
    d4b450c View commit details
    Browse the repository at this point in the history
  8. Btrfs: add missing cleanup on sysfs init failure

    If we failed during initialization of sysfs, we weren't unregistering the
    top level btrfs sysfs entry nor the debugfs stuff.
    Not unregistering the top level sysfs entry makes future attempts to reload
    the btrfs module impossible and the following is reported in dmesg:
    
    [ 2246.451296] WARNING: CPU: 3 PID: 10999 at fs/sysfs/dir.c:486 sysfs_warn_dup+0x91/0xb0()
    [ 2246.451298] sysfs: cannot create duplicate filename '/fs/btrfs'
    [ 2246.451298] Modules linked in: btrfs(+) raid6_pq xor bnep rfcomm bluetooth binfmt_misc nfsd auth_rpcgss oid_registry nfs_acl nfs lockd fscache sunrpc parport_pc parport psmouse serio_raw pcspkr evbug i2c_piix4 e1000 floppy [last unloaded: btrfs]
    [ 2246.451310] CPU: 3 PID: 10999 Comm: modprobe Tainted: G        W    3.13.0-fdm-btrfs-next-24+ #7
    [ 2246.451311] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
    [ 2246.451312]  0000000000000009 ffff8800d353fa08 ffffffff816f1da6 0000000000000410
    [ 2246.451314]  ffff8800d353fa58 ffff8800d353fa48 ffffffff8104a32c ffff88020821a290
    [ 2246.451316]  ffff88020821a290 ffff88020821a290 ffff8802148f0000 ffff8800d353fb80
    [ 2246.451318] Call Trace:
    [ 2246.451322]  [<ffffffff816f1da6>] dump_stack+0x4e/0x68
    [ 2246.451324]  [<ffffffff8104a32c>] warn_slowpath_common+0x8c/0xc0
    [ 2246.451325]  [<ffffffff8104a416>] warn_slowpath_fmt+0x46/0x50
    [ 2246.451328]  [<ffffffff81367dc5>] ? strlcat+0x65/0x90
    (....)
    
    This fixes the following change:
    
        btrfs: add simple debugfs interface
        commit 1bae309
    
    Signed-off-by: Filipe Manana <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    fdmanana authored and masoncl committed Feb 3, 2015
    Configuration menu
    Copy the full SHA
    001a648 View commit details
    Browse the repository at this point in the history
  9. Btrfs: fix scrub race leading to use-after-free

    While running a scrub on a kernel with CONFIG_DEBUG_PAGEALLOC=y, I got
    the following trace:
    
    [68127.807663] BUG: unable to handle kernel paging request at ffff8803f8947a50
    [68127.807663] IP: [<ffffffff8107da31>] do_raw_spin_lock+0x94/0x122
    [68127.807663] PGD 3003067 PUD 43e1f5067 PMD 43e030067 PTE 80000003f8947060
    [68127.807663] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
    [68127.807663] Modules linked in: dm_flakey dm_mod crc32c_generic btrfs xor raid6_pq nfsd auth_rpcgss oid_registry nfs_acl nfs lockd grace fscache sunrpc loop parport_pc processor parpo
    [68127.807663] CPU: 2 PID: 3081 Comm: kworker/u8:5 Not tainted 3.18.0-rc6-btrfs-next-3+ #4
    [68127.807663] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014
    [68127.807663] Workqueue: btrfs-btrfs-scrub btrfs_scrub_helper [btrfs]
    [68127.807663] task: ffff880101fc5250 ti: ffff8803f097c000 task.ti: ffff8803f097c000
    [68127.807663] RIP: 0010:[<ffffffff8107da31>]  [<ffffffff8107da31>] do_raw_spin_lock+0x94/0x122
    [68127.807663] RSP: 0018:ffff8803f097fbb8  EFLAGS: 00010093
    [68127.807663] RAX: 0000000028dd386c RBX: ffff8803f8947a50 RCX: 0000000028dd3854
    [68127.807663] RDX: 0000000000000018 RSI: 0000000000000002 RDI: 0000000000000001
    [68127.807663] RBP: ffff8803f097fbd8 R08: 0000000000000004 R09: 0000000000000001
    [68127.807663] R10: ffff880102620980 R11: ffff8801f3e8c900 R12: 000000000001d390
    [68127.807663] R13: 00000000cabd13c8 R14: ffff8803f8947800 R15: ffff88037c574f00
    [68127.807663] FS:  0000000000000000(0000) GS:ffff88043dd00000(0000) knlGS:0000000000000000
    [68127.807663] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    [68127.807663] CR2: ffff8803f8947a50 CR3: 00000000b6481000 CR4: 00000000000006e0
    [68127.807663] Stack:
    [68127.807663]  ffffffff823942a8 ffff8803f8947a50 ffff8802a3416f80 0000000000000000
    [68127.807663]  ffff8803f097fc18 ffffffff8141e7c0 ffffffff81072948 000000000034f314
    [68127.807663]  ffff8803f097fc08 0000000000000292 ffff8803f097fc48 ffff8803f8947a50
    [68127.807663] Call Trace:
    [68127.807663]  [<ffffffff8141e7c0>] _raw_spin_lock_irqsave+0x4b/0x55
    [68127.807663]  [<ffffffff81072948>] ? __wake_up+0x22/0x4b
    [68127.807663]  [<ffffffff81072948>] __wake_up+0x22/0x4b
    [68127.807663]  [<ffffffffa0392327>] scrub_pending_bio_dec+0x32/0x36 [btrfs]
    [68127.807663]  [<ffffffffa0395e70>] scrub_bio_end_io_worker+0x5a3/0x5c9 [btrfs]
    [68127.807663]  [<ffffffff810e0c7c>] ? time_hardirqs_off+0x15/0x28
    [68127.807663]  [<ffffffff81078106>] ? trace_hardirqs_off_caller+0x4c/0xb9
    [68127.807663]  [<ffffffffa0372a7c>] normal_work_helper+0xf1/0x238 [btrfs]
    [68127.807663]  [<ffffffffa0372d3d>] btrfs_scrub_helper+0x12/0x14 [btrfs]
    [68127.807663]  [<ffffffff810582d2>] process_one_work+0x1e4/0x3b6
    [68127.807663]  [<ffffffff81078180>] ? trace_hardirqs_off+0xd/0xf
    [68127.807663]  [<ffffffff81058dc9>] worker_thread+0x1fb/0x2a8
    [68127.807663]  [<ffffffff81058bce>] ? rescuer_thread+0x219/0x219
    [68127.807663]  [<ffffffff8105cd75>] kthread+0xdb/0xe3
    [68127.807663]  [<ffffffff8105cc9a>] ? __kthread_parkme+0x67/0x67
    [68127.807663]  [<ffffffff8141f1ec>] ret_from_fork+0x7c/0xb0
    [68127.807663]  [<ffffffff8105cc9a>] ? __kthread_parkme+0x67/0x67
    [68127.807663] Code: 39 c2 75 14 8d 8a 00 00 01 00 89 d0 f0 0f b1 0b 39 d0 0f 84 81 00 00 00 4c 69 2d 27 86 99 00 fa 00 00 00 45 31 e4 4d 39 ec 74 2b <8b> 13 89 d0 c1 e8 10 66 39 c2 75
    [68127.807663] RIP  [<ffffffff8107da31>] do_raw_spin_lock+0x94/0x122
    [68127.807663]  RSP <ffff8803f097fbb8>
    [68127.807663] CR2: ffff8803f8947a50
    [68127.807663] ---[ end trace d7045aac00a66cd8 ]---
    
    This is due to a race that can happen in a very tiny time window and is
    illustrated by the following sequence diagram:
    
             CPU 1                                                     CPU 2
    
                                                                    btrfs_scrub_dev()
    scrub_bio_end_io_worker()
       scrub_pending_bio_dec()
           atomic_dec(&sctx->bios_in_flight)
                                                                       wait sctx->bios_in_flight == 0
                                                                       wait sctx->workers_pending == 0
                                                                       mutex_lock(&fs_info->scrub_lock)
                                                                       (...)
                                                                       mutex_lock(&fs_info->scrub_lock)
                                                                       scrub_free_ctx(sctx)
                                                                          kfree(sctx)
           wake_up(&sctx->list_wait)
              __wake_up()
                  spin_lock_irqsave(&sctx->list_wait->lock, flags)
    
    Another variation of this scenario that results in the same use-after-free
    issue is:
    
             CPU 1                                                     CPU 2
    
                                                                    btrfs_scrub_dev()
                                                                       wait sctx->bios_in_flight == 0
    scrub_bio_end_io_worker()
       scrub_pending_bio_dec()
           __wake_up(&sctx->list_wait)
              spin_lock_irqsave(&sctx->list_wait->lock, flags)
              default_wake_function()
                  wake up task at CPU 2
                                                                       wait sctx->workers_pending == 0
                                                                       mutex_lock(&fs_info->scrub_lock)
                                                                       (...)
                                                                       mutex_lock(&fs_info->scrub_lock)
                                                                       scrub_free_ctx(sctx)
                                                                          kfree(sctx)
              spin_unlock_irqrestore(&sctx->list_wait->lock, flags)
    
    Fix this by holding the scrub lock while doing the wakeup.
    
    This isn't a recent regression, the issue as been around since the scrub
    feature was added (2011, commit a2de733).
    
    Signed-off-by: Filipe Manana <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    fdmanana authored and masoncl committed Feb 3, 2015
    Configuration menu
    Copy the full SHA
    de554a4 View commit details
    Browse the repository at this point in the history
  10. btrfs: clear bio reference after submit_one_bio()

    After submit_one_bio(), `bio' can go away. However submit_extent_page()
    leave `bio' referable if submit_one_bio() failed (e.g. -ENOMEM on OOM).
    It will cause invalid paging request when submit_extent_page() is called
    next time.
    
    I reproduced ENOMEM case with the following script (need
    CONFIG_FAIL_PAGE_ALLOC, and CONFIG_FAULT_INJECTION_DEBUG_FS).
    
      #!/bin/bash
    
      dmesgout=dmesg.txt
      start=100000
      end=300000
      step=1000
    
      # btrfs options
      device=/dev/vdb1
      directory=/mnt/btrfs
    
      # fault-injection options
      percent=100
      times=3
    
      mkdir -p $directory || exit 1
      mount -o compress $device $directory || exit 1
    
      rm -f $directory/file || exit 1
      dd if=/dev/zero of=$directory/file bs=1M count=512 || exit 1
    
      for interval in `seq $start $step $end`; do
              dmesg -C
              echo 1 > /proc/sys/vm/drop_caches
              sync
              export FAILCMD_TYPE=fail_page_alloc
              ./failcmd.sh -p $percent -t $times -i $interval \
                      --ignore-gfp-highmem=N --ignore-gfp-wait=N --min-order=0 \
                      -- \
                      cat $directory/file > /dev/null
              dmesg > ${dmesgout}
              if grep -q BUG: ${dmesgout}; then
                      cat ${dmesgout}
                      exit 1
              fi
      done
    
      umount $directory
      exit 0
    
    Signed-off-by: Naohiro Aota <[email protected]>
    Tested-by: Satoru Takeuchi <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    naota authored and masoncl committed Feb 3, 2015
    Configuration menu
    Copy the full SHA
    289454a View commit details
    Browse the repository at this point in the history
  11. btrfs: delete chunk allocation attemp when setting block group ro

    Below test will fail currently:
          mkfs.ext4 -F /dev/sda
          btrfs-convert /dev/sda
          mount /dev/sda /mnt
          btrfs device add -f /dev/sdb /mnt
          btrfs balance start -v -dconvert=raid1 -mconvert=raid1 /mnt
    
    The reason is there are some block groups with usage 0, but the whole
    disk hasn't free space to allocate new chunk, so we even can't set such
    block group readonly. This patch deletes the chunk allocation when
    setting block group ro. For META, we already have reserve. But for
    SYSTEM, we don't have, so the check_system_chunk is still required.
    
    Signed-off-by: Shaohua Li <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    shligit authored and masoncl committed Feb 3, 2015
    Configuration menu
    Copy the full SHA
    2f08108 View commit details
    Browse the repository at this point in the history
  12. btrfs: cleanup init for list in free-space-cache

    o removed an unecessary INIT_LIST_HEAD after LIST_HEAD
    
    o merge a declare & INIT_LIST_HEAD pair into one LIST_HEAD
    
    Signed-off-by: Gui Hecheng <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    Gui Hecheng authored and masoncl committed Feb 3, 2015
    Configuration menu
    Copy the full SHA
    b76808f View commit details
    Browse the repository at this point in the history
  13. Btrfs: Remove unnecessary placeholder in btrfs_err_code

    "notused" is not necessary. Set 1 to the first entry is enough.
    
    Signed-off-by: Takeuchi Satoru <[email protected]
    Cc: Gui Hecheng <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    Satoru Takeuchi authored and masoncl committed Feb 3, 2015
    Configuration menu
    Copy the full SHA
    eb710b1 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2015

  1. thermal: int340x: fix sparse warning

    this patch fixes following sparse warning:
    
    processor_thermal_device.c:188:6: warning: symbol 'proc_thermal_remove' was not declared. Should it be static?
    
    Signed-off-by: Lad, Prabhakar <[email protected]>
    Signed-off-by: Zhang Rui <[email protected]>
    prabhakarlad authored and zhang-rui committed Feb 6, 2015
    Configuration menu
    Copy the full SHA
    4aa971b View commit details
    Browse the repository at this point in the history
  2. thermal: step_wise: spelling fixes

    Signed-off-by: Brian Norris <[email protected]>
    Signed-off-by: Zhang Rui <[email protected]>
    computersforpeace authored and zhang-rui committed Feb 6, 2015
    Configuration menu
    Copy the full SHA
    56b613e View commit details
    Browse the repository at this point in the history
  3. Thermal/int340x_thermal: remove unused uuids.

    Signed-off-by: Zhang Rui <[email protected]>
    zhang-rui committed Feb 6, 2015
    Configuration menu
    Copy the full SHA
    31908f4 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2015

  1. samsung-laptop: enable better lid handling

    Some Samsung laptops with SABI3 delay the sleep for 10 seconds after
    the lid is closed and do not wake up from sleep after the lid is opened.
    A SABI command is needed to enable the better behavior.
    
    Command = 0x6e, d0 = 0x81 enables this behavior. Returns d0 = 0x01.
    Command = 0x6e, d0 = 0x80 disables this behavior. Returns d0 = 0x00.
    
    Command = 0x6d and any d0 queries the state. This returns:
    d0 = 0x00000*01, d1 = 0x00, d2 = 0x00, d3 = 0x0* when it is enabled.
    d0 = 0x00000*00, d1 = 0x00, d2 = 0x00, d3 = 0x0* when it is disabled.
    Where * is 0 - laptop has never slept or hibernated after switch on,
               1 - laptop has hibernated just before,
               2 - laptop has slept just before.
    
    Patch addresses bug https://bugzilla.kernel.org/show_bug.cgi?id=75901 .
    It adds a sysfs attribute lid_handling with a description and also an
    addition to the quirks structure to enable the mode by default.
    
    A user with another laptop in the bug report says that "power button has
    to be pressed twice to wake the machine" when he or she enabled the mode
    manually using the SABI command. Therefore, it is enabled by default
    only for the single laptop that I have tested.
    
    Signed-off-by: Julijonas Kikutis <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    julijonas authored and dvhart committed Feb 7, 2015
    Configuration menu
    Copy the full SHA
    b0dcaf4 View commit details
    Browse the repository at this point in the history
  2. samsung-laptop: Fix sparse integer as NULL warning

    Fix the following sparse warning:
    
    samsung-laptop.c:1365:52: warning: Using plain integer as NULL pointer
    
    Signed-off-by: Lad, Prabhakar <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    prabhakarlad authored and dvhart committed Feb 7, 2015
    Configuration menu
    Copy the full SHA
    4e7f09a View commit details
    Browse the repository at this point in the history
  3. samsung-laptop.c: Prefer kstrtoint over single variable sscanf

    Replace existing usage of single variable sscanf with kstrtoint for
    consistency with checkpatch warnings against such usage.
    
    Signed-off-by: Darren Hart <[email protected]>
    dvhart committed Feb 7, 2015
    Configuration menu
    Copy the full SHA
    802cf2e View commit details
    Browse the repository at this point in the history
  4. thinkpad_acpi.c: Fix sparse warning (make undeclared var static)

    Fix the following sparse warning:
    
    thinkpad_acpi.c:3459:11: warning: symbol 'adaptive_keyboard_modes' was not declared. Should it be static?
    
    Signed-off-by: Lad, Prabhakar <[email protected]>
    Acked-by: Henrique de Moraes Holschuh <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    prabhakarlad authored and dvhart committed Feb 7, 2015
    Configuration menu
    Copy the full SHA
    b201a47 View commit details
    Browse the repository at this point in the history
  5. Sony-laptop: Fix sparse warning (make undeclared var static)

    Fix the following sparse warning:
    
    sony-laptop.c:1035:29: warning: symbol 'sony_bl_props' was not declared. Should it be static?
    
    Signed-off-by: Lad, Prabhakar <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    prabhakarlad authored and dvhart committed Feb 7, 2015
    Configuration menu
    Copy the full SHA
    76fe63f View commit details
    Browse the repository at this point in the history
  6. classmate-laptop: Fix sparse warning (0 as NULL)

    Fix the following sparse warning:
    
    classmate-laptop.c:523:61: warning: Using plain integer as NULL pointer
    
    Signed-off-by: Lad, Prabhakar <[email protected]>
    Acked-by: Thadeu Lima de Souza Cascardo <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    prabhakarlad authored and dvhart committed Feb 7, 2015
    Configuration menu
    Copy the full SHA
    2a89d7c View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2015

  1. sb_edac: Fix detection on SNB machines

    d0585cd ("sb_edac: Claim a different PCI device") changed the
    probing of sb_edac to look for PCI device 0x3ca0:
    
    3f:0e.0 System peripheral: Intel Corporation Xeon E5/Core i7 Processor Home Agent (rev 07)
    00: 86 80 a0 3c 00 00 00 00 07 00 80 08 00 00 80 00
    ...
    
    but we're matching for 0x3ca8, i.e. PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TA
    in sbridge_probe() therefore the probing fails.
    
    Changing it to probe for 0x3ca0 (PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_HA0),
    .i.e., the 14.0 device, fixes the issue and driver loads successfully
    again:
    
    [ 2449.013120] EDAC DEBUG: sbridge_init:
    [ 2449.017029] EDAC sbridge: Seeking for: PCI ID 8086:3ca0
    [ 2449.022368] EDAC DEBUG: sbridge_get_onedevice: Detected 8086:3ca0
    [ 2449.028498] EDAC sbridge: Seeking for: PCI ID 8086:3ca0
    [ 2449.033768] EDAC sbridge: Seeking for: PCI ID 8086:3ca8
    [ 2449.039028] EDAC DEBUG: sbridge_get_onedevice: Detected 8086:3ca8
    [ 2449.045155] EDAC sbridge: Seeking for: PCI ID 8086:3ca8
    ...
    
    Add a debug printk while at it to be able to catch the failure in the
    future and dump driver version on successful load.
    
    Fixes: d0585cd ("sb_edac: Claim a different PCI device")
    Cc: [email protected] # 3.18
    Acked-by: Aristeu Rozanski <[email protected]>
    Cc: Tony Luck <[email protected]>
    Acked-by: Andy Lutomirski <[email protected]>
    Acked-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Borislav Petkov <[email protected]>
    suryasaimadhu committed Feb 9, 2015
    Configuration menu
    Copy the full SHA
    11249e7 View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2015

  1. toshiba_acpi: Make toshiba_eco_mode_available more robust

    Some Toshiba laptops do not come with the ECO led installed, however,
    the driver is registering support for it when it should not.
    
    This patch makes the toshiba_eco_mode_available function more robust
    in detecting ECO led capabilities, not registering the led on laptops
    that do not support it and registering the led when it really does.
    
    The ECO led function now returns 0x8e00 (Not Installed) by querying
    with in[3] = 0, whenever theres no physical LED installed, and
    returning 0x8300 (Input Data Error) when it is, however, there are
    some BIOSes that have stub function calls not returning anything and
    and the LED device was being registered too, hence the change of the
    default return value from 1 to 0.
    
    Signed-off-by: Azael Avalos <[email protected]>
    
    Minor comment update, fixed a whitespace error, s/truly/actual/.
    
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Feb 10, 2015
    Configuration menu
    Copy the full SHA
    98fc4ec View commit details
    Browse the repository at this point in the history
  2. thinkpad_acpi: unhandled hkey event

    Pressing Fn+Esc in a Lenovo Thinkpad x240 to lock the Fn keys generates
    an unhandled hkey event
    
    Signed-off-by: Xavier Naveira <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    xnaveira authored and dvhart committed Feb 10, 2015
    Configuration menu
    Copy the full SHA
    67ab624 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2015

  1. thinkpad_acpi: support new BIOS version string pattern

    Latest ThinkPad models use a new string pattern of BIOS version,
    thinkpad_acpi won't be loaded automatically without this fix.
    
    Signed-off-by: Adam Lee <[email protected]>
    
    Intentatation cleanup.
    
    Signed-off-by: Darren Hart <[email protected]>
    Adam Lee authored and dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    1b0eb5b View commit details
    Browse the repository at this point in the history
  2. toshiba_acpi: Add version entry to sysfs

    This patch adds a new entry to the sysfs, showing the version of the
    driver.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    c6c68ff View commit details
    Browse the repository at this point in the history
  3. toshiba_acpi: Add fan entry to sysfs

    This patch adds a fan entry to sysfs, enabling the user to get and
    set the fan status.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    94477d4 View commit details
    Browse the repository at this point in the history
  4. toshiba_acpi: Add support for Keyboard functions mode

    Recent Toshiba laptops that come with the new keyboard layout have
    the Special Functions (hotkeys) enabled by default, which, in order to
    access the F{1-12} keys, you need to press the FN-F{1-12} key to
    access such key.
    
    This patch adds support to toggle the Keyboard Functions operation
    mode by creating the sysfs entry "kbd_functions_keys", accepting only
    two parameters, 0 to set the "Normal Operation" mode and 1 to set the
    "Special Functions" mode, however, everytime the mode is toggled, a
    restart is needed.
    
    In the "Normal Operation" mode, the F{1-12} keys are as usual and
    the hotkeys are accessed via FN-F{1-12}.
    
    In the "Special Functions" mode, the F{1-12} keys trigger the hotkey
    and the F{1-12} keys are accessed via FN-F{1-12}.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    bae8419 View commit details
    Browse the repository at this point in the history
  5. toshiba_acpi: Add support for Panel Power ON

    Toshiba laptops come with a feature called "Panel Open - Power ON",
    which makes the laptop turn on whenever the LID is opened.
    
    This patch adds support for such feature, by creating a sysfs entry
    named "panel_power_on", accepting only two values, 0 to disable and
    1 to enable such feature, however, a reboot is needed on every mode
    change.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    35d53ce View commit details
    Browse the repository at this point in the history
  6. toshiba_acpi: Add support to enable/disable USB 3

    Toshiba laptops that come with USB 3 ports have a feature that lets
    them disable USB 3 functionality and act as a regular USB 2 port, and
    thus, saving power.
    
    This patch adds support to that feature, by creating a sysfs entry
    named "usb_three", acceptig only two parameters, 0 to disable the
    USB 3 (acting as a USB 2) and 1 to enable it, however, a reboot is
    needed everytime this is toggled.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    17fe4b3 View commit details
    Browse the repository at this point in the history
  7. toshiba_acpi: Bump version number to 0.21

    Several new features were added on previous patches, so lets bump up
    the driver version.
    
    And also, update the copyright year.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    7216d70 View commit details
    Browse the repository at this point in the history
  8. toshiba_acpi: Clean file according to coding style

    This patch simply cleans the the driver out of 2 errors and 17
    warnings according to "checkpatch -f", no functionality was changed,
    simply a cleanup.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    b516399 View commit details
    Browse the repository at this point in the history
  9. Documentation/ABI: Add file describing the sysfs entries for toshiba_…

    …acpi
    
    This patch adds a new file describing the sysfs entries for the
    toshiba_acpi driver.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    15667b2 View commit details
    Browse the repository at this point in the history
  10. toshiba_acpi: Move sysfs function and struct declarations further down

    Commit 93f8c16 ("toshiba_acpi: Support new keyboard backlight
    type") moved all the sysfs structs and function declarations further
    up in order to make use of sysfs_update_group, however,
    commit 8054690 ("toshiba_acpi: Add keyboard backlight mode
    change event") made use of that function unnecesary.
    
    This patch moves all the sysfs structs and function declarations
    further down, making the file shorther in lines and more readable.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    9bd1213 View commit details
    Browse the repository at this point in the history
  11. toshiba_acpi: Drop the toshiba_ prefix from sysfs function names

    This patch removes the toshiba_ prefix from all the sysfs function
    names and adapted the code according to coding style.
    
    Also a few functions were renamed to match the sysfs entry, as this
    patch is a preparation for the next patch to switch to
    DEVICE_ATTR_{RO, RW, WO} macros.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    9d30984 View commit details
    Browse the repository at this point in the history
  12. toshiba_acpi: Make use of DEVICE_ATTR_{RO, RW} macros

    This patch makes use of the DEVICE_ATTR_{RO, RW} macros to simplify
    sysfs attributes declarations.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Coproscefalo authored and dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    0c3c0f1 View commit details
    Browse the repository at this point in the history
  13. toshiba_acpi: Cleanup comment blocks and capitalization

    Ensure multiline comments start with /* and */ each on its own line.
    Capitalize the first word of comments.
    
    Signed-off-by: Darren Hart <[email protected]>
    dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    e0769fe View commit details
    Browse the repository at this point in the history
  14. toshiba_acpi: Cleanup GPL header

    Remove the Free Software Foundation street address paragraph and
    reference COPYING.
    
    Remove an empty TODO block.
    
    Signed-off-by: Darren Hart <[email protected]>
    dvhart committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    c57c0fa View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2015

  1. Btrfs: fix scheduler warning when syncing log

    We try to lock a mutex while the current task state is not TASK_RUNNING,
    which results in the following warning when CONFIG_DEBUG_LOCK_ALLOC=y:
    
    [30736.772501] ------------[ cut here ]------------
    [30736.774545] WARNING: CPU: 9 PID: 19972 at kernel/sched/core.c:7300 __might_sleep+0x8b/0xa8()
    [30736.783453] do not call blocking ops when !TASK_RUNNING; state=2 set at [<ffffffff8107499b>] prepare_to_wait+0x43/0x89
    [30736.786261] Modules linked in: dm_flakey dm_mod crc32c_generic btrfs xor raid6_pq nfsd auth_rpcgss oid_registry nfs_acl nfs lockd grace fscache sunrpc loop parport_pc psmouse parport pcspkr microcode serio_raw evdev processor thermal_sys i2c_piix4 i2c_core button ext4 crc16 jbd2 mbcache sg sr_mod cdrom sd_mod ata_generic virtio_scsi floppy ata_piix libata virtio_pci virtio_ring e1000 virtio scsi_mod
    [30736.794323] CPU: 9 PID: 19972 Comm: fsstress Not tainted 3.19.0-rc7-btrfs-next-5+ #1
    [30736.795821] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014
    [30736.798788]  0000000000000009 ffff88042743fbd8 ffffffff814248ed ffff88043d32f2d8
    [30736.800504]  ffff88042743fc28 ffff88042743fc18 ffffffff81045338 0000000000000001
    [30736.802131]  ffffffff81064514 ffffffff817c52d1 000000000000026d 0000000000000000
    [30736.803676] Call Trace:
    [30736.804256]  [<ffffffff814248ed>] dump_stack+0x4c/0x65
    [30736.805245]  [<ffffffff81045338>] warn_slowpath_common+0xa1/0xbb
    [30736.806360]  [<ffffffff81064514>] ? __might_sleep+0x8b/0xa8
    [30736.807391]  [<ffffffff81045398>] warn_slowpath_fmt+0x46/0x48
    [30736.808511]  [<ffffffff8107499b>] ? prepare_to_wait+0x43/0x89
    [30736.809620]  [<ffffffff8107499b>] ? prepare_to_wait+0x43/0x89
    [30736.810691]  [<ffffffff81064514>] __might_sleep+0x8b/0xa8
    [30736.811703]  [<ffffffff81426eaf>] mutex_lock_nested+0x2f/0x3a0
    [30736.812889]  [<ffffffff8107bfa1>] ? trace_hardirqs_on_caller+0x18f/0x1ab
    [30736.814138]  [<ffffffff8107bfca>] ? trace_hardirqs_on+0xd/0xf
    [30736.819878]  [<ffffffffa038cfff>] wait_for_writer.isra.12+0x91/0xaa [btrfs]
    [30736.821260]  [<ffffffff810748bd>] ? signal_pending_state+0x31/0x31
    [30736.822410]  [<ffffffffa0391f0a>] btrfs_sync_log+0x160/0x947 [btrfs]
    [30736.823574]  [<ffffffff8107bfa1>] ? trace_hardirqs_on_caller+0x18f/0x1ab
    [30736.824847]  [<ffffffff8107bfca>] ? trace_hardirqs_on+0xd/0xf
    [30736.825972]  [<ffffffffa036e555>] btrfs_sync_file+0x2b0/0x319 [btrfs]
    [30736.827684]  [<ffffffff8117901a>] vfs_fsync_range+0x21/0x23
    [30736.828932]  [<ffffffff81179038>] vfs_fsync+0x1c/0x1e
    [30736.829917]  [<ffffffff8117928b>] do_fsync+0x34/0x4e
    [30736.830862]  [<ffffffff811794b3>] SyS_fsync+0x10/0x14
    [30736.831819]  [<ffffffff8142a512>] system_call_fastpath+0x12/0x17
    [30736.832982] ---[ end trace c0b57df60d32ae5c ]---
    
    Fix this my acquiring the mutex after calling finish_wait(), which sets the
    task's state to TASK_RUNNING.
    
    Signed-off-by: Filipe Manana <[email protected]>
    Reviewed-by: Liu Bo <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    fdmanana authored and masoncl committed Feb 14, 2015
    Configuration menu
    Copy the full SHA
    575849e View commit details
    Browse the repository at this point in the history
  2. Btrfs: scrub, fix sleep in atomic context

    My previous patch "Btrfs: fix scrub race leading to use-after-free"
    introduced the possibility to sleep in an atomic context, which happens
    when the scrub_lock mutex is held at the time scrub_pending_bio_dec()
    is called - this function can be called under an atomic context.
    Chris ran into this in a debug kernel which gave the following trace:
    
    [ 1928.950319] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:621
    [ 1928.967334] in_atomic(): 1, irqs_disabled(): 0, pid: 149670, name: fsstress
    [ 1928.981324] INFO: lockdep is turned off.
    [ 1928.989244] CPU: 24 PID: 149670 Comm: fsstress Tainted: G        W     3.19.0-rc7-mason+ #41
    [ 1929.006418] Hardware name: ZTSYSTEMS Echo Ridge T4  /A9DRPF-10D, BIOS 1.07 05/10/2012
    [ 1929.022207]  ffffffff81a22cf8 ffff881076e03b78 ffffffff816b8dd9 ffff881076e03b78
    [ 1929.037267]  ffff880d8e828710 ffff881076e03ba8 ffffffff810856c4 ffff881076e03bc8
    [ 1929.052315]  0000000000000000 000000000000026d ffffffff81a22cf8 ffff881076e03bd8
    [ 1929.067381] Call Trace:
    [ 1929.072344]  <IRQ>  [<ffffffff816b8dd9>] dump_stack+0x4f/0x6e
    [ 1929.083968]  [<ffffffff810856c4>] ___might_sleep+0x174/0x230
    [ 1929.095352]  [<ffffffff810857d2>] __might_sleep+0x52/0x90
    [ 1929.106223]  [<ffffffff816bb68f>] mutex_lock_nested+0x2f/0x3b0
    [ 1929.117951]  [<ffffffff810ab37d>] ? trace_hardirqs_on+0xd/0x10
    [ 1929.129708]  [<ffffffffa05dc838>] scrub_pending_bio_dec+0x38/0x70 [btrfs]
    [ 1929.143370]  [<ffffffffa05dd0e0>] scrub_parity_bio_endio+0x50/0x70 [btrfs]
    [ 1929.157191]  [<ffffffff812fa603>] bio_endio+0x53/0xa0
    [ 1929.167382]  [<ffffffffa05f96bc>] rbio_orig_end_io+0x7c/0xa0 [btrfs]
    [ 1929.180161]  [<ffffffffa05f97ba>] raid_write_parity_end_io+0x5a/0x80 [btrfs]
    [ 1929.194318]  [<ffffffff812fa603>] bio_endio+0x53/0xa0
    [ 1929.204496]  [<ffffffff8130401b>] blk_update_request+0x1eb/0x450
    [ 1929.216569]  [<ffffffff81096e58>] ? trigger_load_balance+0x78/0x500
    [ 1929.229176]  [<ffffffff8144c74d>] scsi_end_request+0x3d/0x1f0
    [ 1929.240740]  [<ffffffff8144ccac>] scsi_io_completion+0xac/0x5b0
    [ 1929.252654]  [<ffffffff81441c50>] scsi_finish_command+0xf0/0x150
    [ 1929.264725]  [<ffffffff8144d317>] scsi_softirq_done+0x147/0x170
    [ 1929.276635]  [<ffffffff8130ace6>] blk_done_softirq+0x86/0xa0
    [ 1929.288014]  [<ffffffff8105d92e>] __do_softirq+0xde/0x600
    [ 1929.298885]  [<ffffffff8105df6d>] irq_exit+0xbd/0xd0
    (...)
    
    Fix this by using a reference count on the scrub context structure
    instead of locking the scrub_lock mutex.
    
    Signed-off-by: Filipe Manana <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    fdmanana authored and masoncl committed Feb 14, 2015
    Configuration menu
    Copy the full SHA
    f55985f View commit details
    Browse the repository at this point in the history
  3. btrfs: Fix out-of-space bug

    Btrfs will report NO_SPACE when we create and remove files for several times,
    and we can't write to filesystem until mount it again.
    
    Steps to reproduce:
     1: Create a single-dev btrfs fs with default option
     2: Write a file into it to take up most fs space
     3: Delete above file
     4: Wait about 100s to let chunk removed
     5: goto 2
    
    Script is like following:
     #!/bin/bash
    
     # Recommend 1.2G space, too large disk will make test slow
     DEV="/dev/sda16"
     MNT="/mnt/tmp"
    
     dev_size="$(lsblk -bn -o SIZE "$DEV")" || exit 2
     file_size_m=$((dev_size * 75 / 100 / 1024 / 1024))
    
     echo "Loop write ${file_size_m}M file on $((dev_size / 1024 / 1024))M dev"
    
     for ((i = 0; i < 10; i++)); do umount "$MNT" 2>/dev/null; done
     echo "mkfs $DEV"
     mkfs.btrfs -f "$DEV" >/dev/null || exit 2
     echo "mount $DEV $MNT"
     mount "$DEV" "$MNT" || exit 2
    
     for ((loop_i = 0; loop_i < 20; loop_i++)); do
         echo
         echo "loop $loop_i"
    
         echo "dd file..."
         cmd=(dd if=/dev/zero of="$MNT"/file0 bs=1M count="$file_size_m")
         "${cmd[@]}" 2>/dev/null || {
             # NO_SPACE error triggered
             echo "dd failed: ${cmd[*]}"
             exit 1
         }
    
         echo "rm file..."
         rm -f "$MNT"/file0 || exit 2
    
         for ((i = 0; i < 10; i++)); do
             df "$MNT" | tail -1
             sleep 10
         done
     done
    
    Reason:
     It is triggered by commit: 47ab2a6
     which is used to remove empty block groups automatically, but the
     reason is not in that patch. Code before works well because btrfs
     don't need to create and delete chunks so many times with high
     complexity.
     Above bug is caused by many reason, any of them can trigger it.
    
    Reason1:
     When we remove some continuous chunks but leave other chunks after,
     these disk space should be used by chunk-recreating, but in current
     code, only first create will successed.
     Fixed by Forrest Liu <[email protected]> in:
     Btrfs: fix find_free_dev_extent() malfunction in case device tree has hole
    
    Reason2:
     contains_pending_extent() return wrong value in calculation.
     Fixed by Forrest Liu <[email protected]> in:
     Btrfs: fix find_free_dev_extent() malfunction in case device tree has hole
    
    Reason3:
     btrfs_check_data_free_space() try to commit transaction and retry
     allocating chunk when the first allocating failed, but space_info->full
     is set in first allocating, and prevent second allocating in retry.
     Fixed in this patch by clear space_info->full in commit transaction.
    
     Tested for severial times by above script.
    
    Changelog v3->v4:
     use light weight int instead of atomic_t to record have_remove_bgs in
     transaction, suggested by:
     Josef Bacik <[email protected]>
    
    Changelog v2->v3:
     v2 fixed the bug by adding more commit-transaction, but we
     only need to reclaim space when we are really have no space for
     new chunk, noticed by:
     Filipe David Manana <[email protected]>
    
     Actually, our code already have this type of commit-and-retry,
     we only need to make it working with removed-bgs.
     v3 fixed the bug with above way.
    
    Changelog v1->v2:
     v1 will introduce a new bug when delete and create chunk in same disk
     space in same transaction, noticed by:
     Filipe David Manana <[email protected]>
     V2 fix this bug by commit transaction after remove block grops.
    
    Reported-by: Tsutomu Itoh <[email protected]>
    Suggested-by: Filipe David Manana <[email protected]>
    Suggested-by: Josef Bacik <[email protected]>
    Signed-off-by: Zhao Lei <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    zhaoleidd authored and masoncl committed Feb 14, 2015
    Configuration menu
    Copy the full SHA
    13212b5 View commit details
    Browse the repository at this point in the history
  4. Btrfs: only adjust outstanding_extents when we do a short write

    We have this weird dance where we always inc outstanding_extents when we do a
    O_DIRECT write, even if we allocate the entire range.  To get around this we
    also drop the metadata space if we successfully write.  This is an unnecessary
    dance, we only need to jack up outstanding_extents if we don't satisfy the
    entire range request in get_blocks_direct, otherwise we are good using our
    original reservation.  So drop the unconditional inc and the drop of the
    metadata space that we have for the unconditional inc.  Thanks,
    
    Signed-off-by: Josef Bacik <[email protected]>
    Reviewed-by: Liu Bo <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    Josef Bacik authored and masoncl committed Feb 14, 2015
    Configuration menu
    Copy the full SHA
    3e05bde View commit details
    Browse the repository at this point in the history
  5. Btrfs: don't set and clear delalloc for O_DIRECT writes

    We do this to get the space accounting, but this is just needless churn on the
    io_tree, so just drop setting/clearing delalloc and just drop the reserved data
    space when we have a successfull allocation.  Thanks,
    
    Signed-off-by: Josef Bacik <[email protected]>
    Reviewed-by: Liu Bo <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    Josef Bacik authored and masoncl committed Feb 14, 2015
    Configuration menu
    Copy the full SHA
    3266789 View commit details
    Browse the repository at this point in the history
  6. Btrfs: account for large extents with enospc

    On our gluster boxes we stream large tar balls of backups onto our fses.  With
    160gb of ram this means we get really large contiguous ranges of dirty data, but
    the way our ENOSPC stuff works is that as long as it's contiguous we only hold
    metadata reservation for one extent.  The problem is we limit our extents to
    128mb, so we'll end up with at least 800 extents so our enospc accounting is
    quite a bit lower than what we need.  To keep track of this make sure we
    increase outstanding_extents for every multiple of the max extent size so we can
    be sure to have enough reserved metadata space.  Thanks,
    
    Signed-off-by: Josef Bacik <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    Josef Bacik authored and masoncl committed Feb 14, 2015
    Configuration menu
    Copy the full SHA
    dcab6a3 View commit details
    Browse the repository at this point in the history
  7. Btrfs: fix BUG_ON in btrfs_orphan_add() when delete unused block group

    Removing large amount of block group in a transaction may encounters
    BUG_ON() in btrfs_orphan_add(). That is because btrfs_orphan_reserve_metadata()
    will grab metadata reservation from transaction handle, and
    btrfs_delete_unused_bgs() didn't reserve metadata for trnasaction handle when
    delete unused block group.
    
    The problem can be reproduce by following script
    
        mntpath=/btrfs
        loopdev=/dev/loop0
        filepath=/home/forrest/image
    
        umount $mntpath
        losetup -d $loopdev
        truncate --size 1000g $filepath
        losetup $loopdev $filepath
        mkfs.btrfs -f $loopdev
        mount $loopdev $mntpath
    
        for j in `seq 1 1 1000`; do
            fallocate -l 1g $mntpath/$j
        done
        # wait cleaner thread remove unused block group
        sleep 300
    
    The call trace that results from the BUG_ON() is:
    
    [  613.093084] ------------[ cut here ]------------
    [  613.097928] kernel BUG at fs/btrfs/inode.c:3142!
    [  613.105855] invalid opcode: 0000 [#1] SMP
    [  613.112702] Modules linked in: coretemp(E) crc32_pclmul(E) ghash_clmulni_intel(E) aesni_intel(E) snd_ens1371(E) snd_ac97_codec(E) aes_x86_64(E) lrw(E) gf128mul(E) glue_helper(E) ppdev(E) ac97_bus(E) ablk_helper(E) gameport(E) cryptd(E) snd_rawmidi(E) snd_seq_device(E) snd_pcm(E) vmw_balloon(E) snd_timer(E) snd(E) soundcore(E) serio_raw(E) vmwgfx(E) ttm(E) drm_kms_helper(E) drm(E) vmw_vmci(E) parport_pc(E) shpchp(E) i2c_piix4(E) mac_hid(E) lp(E) parport(E) btrfs(E) xor(E) raid6_pq(E) hid_generic(E) usbhid(E) hid(E) psmouse(E) ahci(E) libahci(E) e1000(E) mptspi(E) mptscsih(E) mptbase(E) floppy(E) vmw_pvscsi(E) vmxnet3(E)
    [  613.144196] CPU: 0 PID: 1480 Comm: btrfs-cleaner Tainted: G            E  3.19.0-rc7-custom #2
    [  613.148501] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013
    [  613.152694] task: ffff880035cdb1a0 ti: ffff880039cf4000 task.ti: ffff880039cf4000
    [  613.154969] RIP: 0010:[<ffffffffa01441c2>]  [<ffffffffa01441c2>] btrfs_orphan_add+0x1d2/0x1e0 [btrfs]
    [  613.157780] RSP: 0018:ffff880039cf7c48  EFLAGS: 00010286
    [  613.159560] RAX: 00000000ffffffe4 RBX: ffff88003bd981a0 RCX: ffff88003c9e4000
    [  613.161904] RDX: 0000000000002244 RSI: 0000000000040000 RDI: ffff88003c9e4138
    [  613.164264] RBP: ffff880039cf7c88 R08: 000060ffc0000850 R09: 0000000000000000
    [  613.166507] R10: ffff88003bc4b7a0 R11: ffffea0000eb6740 R12: ffff88003c9c0000
    [  613.168681] R13: ffff88003c102160 R14: ffff88003c9c0458 R15: 0000000000000001
    [  613.170932] FS:  0000000000000000(0000) GS:ffff88003f600000(0000) knlGS:0000000000000000
    [  613.173316] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  613.175227] CR2: 00007f6343537000 CR3: 0000000036329000 CR4: 00000000000407f0
    [  613.177554] Stack:
    [  613.178712]  ffff880039cf7c88 ffffffffa0182a54 ffff88003c9e4b04 ffff88003c9c7800
    [  613.181297]  ffff88003bc4b7a0 ffff88003bd981a0 ffff88003c8db200 ffff88003c2fcc60
    [  613.183782]  ffff880039cf7d18 ffffffffa012da97 ffff88003bc4b7a4 ffff88003bc4b7a0
    [  613.186171] Call Trace:
    [  613.187493]  [<ffffffffa0182a54>] ? lookup_free_space_inode+0x44/0x100 [btrfs]
    [  613.189801]  [<ffffffffa012da97>] btrfs_remove_block_group+0x137/0x740 [btrfs]
    [  613.192126]  [<ffffffffa0166912>] btrfs_remove_chunk+0x672/0x780 [btrfs]
    [  613.194267]  [<ffffffffa012e2ff>] btrfs_delete_unused_bgs+0x25f/0x280 [btrfs]
    [  613.196567]  [<ffffffffa0135e4c>] cleaner_kthread+0x12c/0x190 [btrfs]
    [  613.198687]  [<ffffffffa0135d20>] ? check_leaf+0x350/0x350 [btrfs]
    [  613.200758]  [<ffffffff8108f232>] kthread+0xd2/0xf0
    [  613.202616]  [<ffffffff8108f160>] ? kthread_create_on_node+0x180/0x180
    [  613.204738]  [<ffffffff8175dabc>] ret_from_fork+0x7c/0xb0
    [  613.206652]  [<ffffffff8108f160>] ? kthread_create_on_node+0x180/0x180
    [  613.208741] Code: ff ff 0f 1f 80 00 00 00 00 89 45 c8 3e 80 63 80 fd 48 89 df e8 d0 23 fe ff 8b 45 c8 e9 14 ff ff ff b8 f4 ff ff ff e9 12 ff ff ff <0f> 0b 66 66 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 55 48
    [  613.216562] RIP  [<ffffffffa01441c2>] btrfs_orphan_add+0x1d2/0x1e0 [btrfs]
    [  613.218828]  RSP <ffff880039cf7c48>
    [  613.220382] ---[ end trace 71073106deb8a457 ]---
    
    This patch replace btrfs_join_transaction() with btrfs_start_transaction() in
    btrfs_delete_unused_bgs() to revent BUG_ON() in btrfs_orphan_add()
    
    Signed-off-by: Forrest Liu <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    forrest1209 authored and masoncl committed Feb 14, 2015
    Configuration menu
    Copy the full SHA
    3d84be7 View commit details
    Browse the repository at this point in the history
  8. Btrfs: fix fsync data loss after adding hard link to inode

    We have a scenario where after the fsync log replay we can lose file data
    that had been previously fsync'ed if we added an hard link for our inode
    and after that we sync'ed the fsync log (for example by fsync'ing some
    other file or directory).
    
    This is because when adding an hard link we updated the inode item in the
    log tree with an i_size value of 0. At that point the new inode item was
    in memory only and a subsequent fsync log replay would not make us lose
    the file data. However if after adding the hard link we sync the log tree
    to disk, by fsync'ing some other file or directory for example, we ended
    up losing the file data after log replay, because the inode item in the
    persisted log tree had an an i_size of zero.
    
    This is easy to reproduce, and the following excerpt from my test for
    xfstests shows this:
    
      _scratch_mkfs >> $seqres.full 2>&1
      _init_flakey
      _mount_flakey
    
      # Create one file with data and fsync it.
      # This made the btrfs fsync log persist the data and the inode metadata with
      # a correct inode->i_size (4096 bytes).
      $XFS_IO_PROG -f -c "pwrite -S 0xaa -b 4K 0 4K" -c "fsync" \
           $SCRATCH_MNT/foo | _filter_xfs_io
    
      # Now add one hard link to our file. This made the btrfs code update the fsync
      # log, in memory only, with an inode metadata having a size of 0.
      ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link
    
      # Now force persistence of the fsync log to disk, for example, by fsyncing some
      # other file.
      touch $SCRATCH_MNT/bar
      $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/bar
    
      # Before a power loss or crash, we could read the 4Kb of data from our file as
      # expected.
      echo "File content before:"
      od -t x1 $SCRATCH_MNT/foo
    
      # Simulate a crash/power loss.
      _load_flakey_table $FLAKEY_DROP_WRITES
      _unmount_flakey
    
      _load_flakey_table $FLAKEY_ALLOW_WRITES
      _mount_flakey
    
      # After the fsync log replay, because the fsync log had a value of 0 for our
      # inode's i_size, we couldn't read anymore the 4Kb of data that we previously
      # wrote and fsync'ed. The size of the file became 0 after the fsync log replay.
      echo "File content after:"
      od -t x1 $SCRATCH_MNT/foo
    
    Another alternative test, that doesn't need to fsync an inode in the same
    transaction it was created, is:
    
      _scratch_mkfs >> $seqres.full 2>&1
      _init_flakey
      _mount_flakey
    
      # Create our test file with some data.
      $XFS_IO_PROG -f -c "pwrite -S 0xaa -b 8K 0 8K" \
           $SCRATCH_MNT/foo | _filter_xfs_io
    
      # Make sure the file is durably persisted.
      sync
    
      # Append some data to our file, to increase its size.
      $XFS_IO_PROG -f -c "pwrite -S 0xcc -b 4K 8K 4K" \
           $SCRATCH_MNT/foo | _filter_xfs_io
    
      # Fsync the file, so from this point on if a crash/power failure happens, our
      # new data is guaranteed to be there next time the fs is mounted.
      $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
    
      # Add one hard link to our file. This made btrfs write into the in memory fsync
      # log a special inode with generation 0 and an i_size of 0 too. Note that this
      # didn't update the inode in the fsync log on disk.
      ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link
    
      # Now make sure the in memory fsync log is durably persisted.
      # Creating and fsync'ing another file will do it.
      touch $SCRATCH_MNT/bar
      $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/bar
    
      # As expected, before the crash/power failure, we should be able to read the
      # 12Kb of file data.
      echo "File content before:"
      od -t x1 $SCRATCH_MNT/foo
    
      # Simulate a crash/power loss.
      _load_flakey_table $FLAKEY_DROP_WRITES
      _unmount_flakey
    
      _load_flakey_table $FLAKEY_ALLOW_WRITES
      _mount_flakey
    
      # After mounting the fs again, the fsync log was replayed.
      # The btrfs fsync log replay code didn't update the i_size of the persisted
      # inode because the inode item in the log had a special generation with a
      # value of 0 (and it couldn't know the correct i_size, since that inode item
      # had a 0 i_size too). This made the last 4Kb of file data inaccessible and
      # effectively lost.
      echo "File content after:"
      od -t x1 $SCRATCH_MNT/foo
    
    This isn't a new issue/regression. This problem has been around since the
    log tree code was added in 2008:
    
      Btrfs: Add a write ahead tree log to optimize synchronous operations
      (commit e02119d)
    
    Test cases for xfstests follow soon.
    
    CC: <[email protected]>
    Signed-off-by: Filipe Manana <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    fdmanana authored and masoncl committed Feb 14, 2015
    Configuration menu
    Copy the full SHA
    1a4bcf4 View commit details
    Browse the repository at this point in the history
  9. Btrfs: don't remove extents and xattrs when logging new names

    If we are recording in the tree log that an inode has new names (new hard
    links were added), we would drop items, belonging to the inode, that we
    shouldn't:
    
    1) When the flag BTRFS_INODE_COPY_EVERYTHING is set in the inode's runtime
       flags, we ended up dropping all the extent and xattr items that were
       previously logged. This was done only in memory, since logging a new
       name doesn't imply syncing the log;
    
    2) When the flag BTRFS_INODE_COPY_EVERYTHING is set in the inode's runtime
       flags, we ended up dropping all the xattr items that were previously
       logged. Like the case before, this was done only in memory because
       logging a new name doesn't imply syncing the log.
    
    This led to some surprises in scenarios such as the following:
    
    1) write some extents to an inode;
    2) fsync the inode;
    3) truncate the inode or delete/modify some of its xattrs
    4) add a new hard link for that inode
    5) fsync some other file, to force the log tree to be durably persisted
    6) power failure happens
    
    The next time the fs is mounted, the fsync log replay code is executed,
    and the resulting file doesn't have the content it had when the last fsync
    against it was performed, instead if has a content matching what it had
    when the last transaction commit happened.
    
    So change the behaviour such that when a new name is logged, only the inode
    item and reference items are processed.
    
    This is easy to reproduce with the test I just made for xfstests, whose
    main body is:
    
      _scratch_mkfs >> $seqres.full 2>&1
      _init_flakey
      _mount_flakey
    
      # Create our test file with some data.
      $XFS_IO_PROG -f -c "pwrite -S 0xaa -b 8K 0 8K" \
          $SCRATCH_MNT/foo | _filter_xfs_io
    
      # Make sure the file is durably persisted.
      sync
    
      # Append some data to our file, to increase its size.
      $XFS_IO_PROG -f -c "pwrite -S 0xcc -b 4K 8K 4K" \
          $SCRATCH_MNT/foo | _filter_xfs_io
    
      # Fsync the file, so from this point on if a crash/power failure happens, our
      # new data is guaranteed to be there next time the fs is mounted.
      $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
    
      # Now shrink our file to 5000 bytes.
      $XFS_IO_PROG -c "truncate 5000" $SCRATCH_MNT/foo
    
      # Now do an expanding truncate to a size larger than what we had when we last
      # fsync'ed our file. This is just to verify that after power failure and
      # replaying the fsync log, our file matches what it was when we last fsync'ed
      # it - 12Kb size, first 8Kb of data had a value of 0xaa and the last 4Kb of
      # data had a value of 0xcc.
      $XFS_IO_PROG -c "truncate 32K" $SCRATCH_MNT/foo
    
      # Add one hard link to our file. This made btrfs drop all of our file's
      # metadata from the fsync log, including the metadata relative to the
      # extent we just wrote and fsync'ed. This change was made only to the fsync
      # log in memory, so adding the hard link alone doesn't change the persisted
      # fsync log. This happened because the previous truncates set the runtime
      # flag BTRFS_INODE_NEEDS_FULL_SYNC in the btrfs inode structure.
      ln $SCRATCH_MNT/foo $SCRATCH_MNT/foo_link
    
      # Now make sure the in memory fsync log is durably persisted.
      # Creating and fsync'ing another file will do it.
      # After this our persisted fsync log will no longer have metadata for our file
      # foo that points to the extent we wrote and fsync'ed before.
      touch $SCRATCH_MNT/bar
      $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/bar
    
      # As expected, before the crash/power failure, we should be able to see a file
      # with a size of 32Kb, with its first 5000 bytes having the value 0xaa and all
      # the remaining bytes with value 0x00.
      echo "File content before:"
      od -t x1 $SCRATCH_MNT/foo
    
      # Simulate a crash/power loss.
      _load_flakey_table $FLAKEY_DROP_WRITES
      _unmount_flakey
    
      _load_flakey_table $FLAKEY_ALLOW_WRITES
      _mount_flakey
    
      # After mounting the fs again, the fsync log was replayed.
      # The expected result is to see a file with a size of 12Kb, with its first 8Kb
      # of data having the value 0xaa and its last 4Kb of data having a value of 0xcc.
      # The btrfs bug used to leave the file as it used te be as of the last
      # transaction commit - that is, with a size of 8Kb with all bytes having a
      # value of 0xaa.
      echo "File content after:"
      od -t x1 $SCRATCH_MNT/foo
    
    The test case for xfstests follows soon.
    
    Signed-off-by: Filipe Manana <[email protected]>
    Signed-off-by: Chris Mason <[email protected]>
    fdmanana authored and masoncl committed Feb 14, 2015
    Configuration menu
    Copy the full SHA
    a742994 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2015

  1. EDAC, amd64_edac: Prevent OOPS with >16 memory controllers

    When DRAM errors occur on memory controllers after EDAC_MAX_MCS (16),
    the kernel fatally dereferences unallocated structures, see splat below;
    this occurs on at least NumaConnect systems.
    
    Fix by checking if a memory controller info structure was found.
    
    BUG: unable to handle kernel NULL pointer dereference at 0000000000000320
    IP: [<ffffffff819f714f>] decode_bus_error+0x2f/0x2b0
    PGD 2f8b5a3067 PUD 2f8b5a2067 PMD 0
    Oops: 0000 [#2] SMP
    Modules linked in:
    CPU: 224 PID: 11930 Comm: stream_c.exe.gn Tainted: G   D    3.19.0 #1
    Hardware name: Supermicro H8QGL/H8QGL, BIOS 3.5b    01/28/2015
    task: ffff8807dbfb8c00 ti: ffff8807dd16c000 task.ti: ffff8807dd16c000
    RIP: 0010:[<ffffffff819f714f>] [<ffffffff819f714f>] decode_bus_error+0x2f/0x2b0
    RSP: 0000:ffff8907dfc03c48 EFLAGS: 00010297
    RAX: 0000000000000001 RBX: 9c67400010080a13 RCX: 0000000000001dc6
    RDX: 000000001dc61dc6 RSI: ffff8907dfc03df0 RDI: 000000000000001c
    RBP: ffff8907dfc03ce8 R08: 0000000000000000 R09: 0000000000000022
    R10: ffff891fffa30380 R11: 00000000001cfc90 R12: 0000000000000008
    R13: 0000000000000000 R14: 000000000000001c R15: 00009c6740001000
    FS: 00007fa97ee18700(0000) GS:ffff8907dfc00000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000000320 CR3: 0000003f889b8000 CR4: 00000000000407e0
    Stack:
     0000000000000000 ffff8907dfc03df0 0000000000000008 9c67400010080a13
     000000000000001c 00009c6740001000 ffff8907dfc03c88 ffffffff810e4f9a
     ffff8907dfc03ce8 ffffffff81b375b9 0000000000000000 0000000000000010
    Call Trace:
     <IRQ>
     ? vprintk_default
     ? printk
     amd_decode_mce
     notifier_call_chain
     atomic_notifier_call_chain
     mce_log
     machine_check_poll
     mce_timer_fn
     ? mce_cpu_restart
     call_timer_fn.isra.29
     run_timer_softirq
     __do_softirq
     irq_exit
     smp_apic_timer_interrupt
     apic_timer_interrupt
     <EOI>
     ? down_read_trylock
     __do_page_fault
     ? __schedule
     do_page_fault
     page_fault
    
    Signed-off-by: Daniel J Blueman <[email protected]>
    Link: http://lkml.kernel.org/r/[email protected]
    Cc: [email protected]
    [ Boris: massage commit message ]
    Signed-off-by: Borislav Petkov <[email protected]>
    dblueman authored and suryasaimadhu committed Feb 17, 2015
    Configuration menu
    Copy the full SHA
    0c510cc View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2015

  1. libceph: nuke pool op infrastructure

    On Mon, Dec 22, 2014 at 5:35 PM, Sage Weil <[email protected]> wrote:
    > On Mon, 22 Dec 2014, Ilya Dryomov wrote:
    >> Actually, pool op stuff has been unused for over two years - looks like
    >> it was added for rbd create_snap and that got ripped out in 2012.  It's
    >> unlikely we'd ever need to manage pools or snaps from the kernel client
    >> so I think it makes sense to nuke it.  Sage?
    >
    > Yep!
    
    Signed-off-by: Ilya Dryomov <[email protected]>
    idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    7a6fdeb View commit details
    Browse the repository at this point in the history
  2. libceph: use mon_client.c/put_generic_request() more

    Signed-off-by: Ilya Dryomov <[email protected]>
    idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    f646912 View commit details
    Browse the repository at this point in the history
  3. ceph: handle SESSION_FORCE_RO message

    mark session as readonly and wake up all cap waiters.
    
    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    03f4fcb View commit details
    Browse the repository at this point in the history
  4. rbd: nuke copy_token()

    It's been largely superseded by dup_token() and unused for over
    2 years, identified by cppcheck.
    
    Signed-off-by: Rickard Strandqvist <[email protected]>
    [[email protected]: changelog]
    Signed-off-by: Ilya Dryomov <[email protected]>
    Rickard Strandqvist authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    3a25cf4 View commit details
    Browse the repository at this point in the history
  5. ceph: acl: Remove unused function

    Remove the function ceph_get_cached_acl() that is not used anywhere.
    
    This was partially found by using a static code analysis program called cppcheck.
    
    Signed-off-by: Rickard Strandqvist <[email protected]>
    Reviewed-by: Yan, Zheng <[email protected]>
    Rickard Strandqvist authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    671762f View commit details
    Browse the repository at this point in the history
  6. ceph: properly zero data pages for file holes.

    A bug is found in striped_read() of fs/ceph/file.c. striped_read() calls
    ceph_zero_pape_vector_range().  The first argument, page_align + read + ret,
    passed to ceph_zero_pape_vector_range() is wrong.
    
    When a file has holes, this wrong parameter may cause memory corruption
    either in kernal space or user space. Kernel space memory may be corrupted in
    the case of non direct IO; user space memory may be corrupted in the case of
    direct IO. In the latter case, the application doing direct IO may crash due
    to memory corruption, as we have experienced.
    
    The correct value should be initial_align + read + ret, where intial_align =
    o_direct ? buf_align : io_align.  Compared with page_align, the current page
    offest, initial_align is the initial page offest, which should be used to
    calculate the page and offset in ceph_zero_pape_vector_range().
    
    Reported-by: caifeng zhu <[email protected]>
    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    1487a68 View commit details
    Browse the repository at this point in the history
  7. ceph: improve reference tracking for snaprealm

    When snaprealm is created, its initial reference count is zero.
    But in some rare cases, the newly created snaprealm is not referenced
    by anyone. This causes snaprealm with zero reference count not freed.
    
    The fix is set reference count of newly snaprealm to 1. The reference
    is return the function who requests to create the snaprealm. When the
    function finishes its job, it releases the reference.
    
    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    982d601 View commit details
    Browse the repository at this point in the history
  8. rbd: fix error paths in rbd_dev_refresh()

    header_rwsem should be released on errors.  Also remove useless
    rbd_dev->mapping.size != rbd_dev->header.image_size test.
    
    Signed-off-by: Ilya Dryomov <[email protected]>
    idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    73e39e4 View commit details
    Browse the repository at this point in the history
  9. ceph: avoid block operation when !TASK_RUNNING (ceph_mdsc_sync)

    check_cap_flush() calls mutex_lock(), which may block. So we can't
    use it as condition check function for wait_event();
    
    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    d3383a8 View commit details
    Browse the repository at this point in the history
  10. ceph: avoid block operation when !TASK_RUNNING (ceph_get_caps)

    we should not do block operation in wait_event_interruptible()'s condition
    check function, but reading inline data can block. so move the read inline
    data code to ceph_get_caps()
    
    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    c4d4a58 View commit details
    Browse the repository at this point in the history
  11. ceph: avoid block operation when !TASK_RUNNING (ceph_mdsc_close_sessi…

    …ons)
    
    use an atomic variable to track number of sessions, this can avoid block
    operation inside wait loops.
    
    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    86d8f67 View commit details
    Browse the repository at this point in the history
  12. ceph: fix reading inline data when i_size > PAGE_SIZE

    when inode has inline data but its size > PAGE_SIZE (it was truncated
    to larger size), previous direct read code return -EIO. This patch adds
    code to return zeros for data whose offset > PAGE_SIZE.
    
    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    fcc02d2 View commit details
    Browse the repository at this point in the history
  13. ceph: fix request time stamp encoding

    struct timespec uses 'long' to present second and nanosecond. 'long'
    is 64 bits on 64bits machine. ceph MDS expects time stamp to be
    encoded as struct ceph_timespec, which uses 'u32' to present second
    and nanosecond.
    
    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    1f041a8 View commit details
    Browse the repository at this point in the history
  14. ceph: provide seperate {inode,file}_operations for snapdir

    remove all unsupported operations from {inode,file}_operations.
    
    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    38c48b5 View commit details
    Browse the repository at this point in the history
  15. client: include kernel version in client metadata

    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    a6a5ce4 View commit details
    Browse the repository at this point in the history
  16. ceph: properly mark empty directory as complete

    ceph_add_cap() calls __check_cap_issue(), which clears directory
    inode' complete flag. so we should set the complete flag for empty
    directory should be set after calling ceph_add_cap().
    
    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    2f92b3d View commit details
    Browse the repository at this point in the history
  17. ceph: fix atomic_open snapdir

    ceph_handle_snapdir() checks ceph_mdsc_do_request()'s return value
    and creates snapdir inode if it's -ENOENT
    
    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    bf91c31 View commit details
    Browse the repository at this point in the history
  18. rbd: do not treat standalone as flatten

    If the clone is resized down to 0, it becomes standalone.  If such
    resize is carried over while an image is mapped we would detect this
    and call rbd_dev_parent_put() which means "let go of all parent state,
    including the spec(s) of parent images(s)".  This leads to a mismatch
    between "rbd info" and sysfs parent fields, so a fix is in order.
    
        # rbd create --image-format 2 --size 1 foo
        # rbd snap create foo@snap
        # rbd snap protect foo@snap
        # rbd clone foo@snap bar
        # DEV=$(rbd map bar)
        # rbd resize --allow-shrink --size 0 bar
        # rbd resize --size 1 bar
        # rbd info bar | grep parent
                parent: rbd/foo@snap
    
    Before:
    
        # cat /sys/bus/rbd/devices/0/parent
        (no parent image)
    
    After:
    
        # cat /sys/bus/rbd/devices/0/parent
        pool_id 0
        pool_name rbd
        image_id 10056b8b4567
        image_name foo
        snap_id 2
        snap_name snap
        overlap 0
    
    Signed-off-by: Ilya Dryomov <[email protected]>
    Reviewed-by: Josh Durgin <[email protected]>
    Reviewed-by: Alex Elder <[email protected]>
    idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    cf32bd9 View commit details
    Browse the repository at this point in the history
  19. libceph: tcp_nodelay support

    TCP_NODELAY socket option set on connection sockets,
    disables Nagle’s algorithm and improves latency characteristics.
    tcp_nodelay(default)/notcp_nodelay option flags provided to
    enable/disable setting the socket option.
    
    Signed-off-by: Chaitanya Huilgol <[email protected]>
    [[email protected]: NO_TCP_NODELAY -> TCP_NODELAY, minor adjustments]
    Signed-off-by: Ilya Dryomov <[email protected]>
    chaitanyahuilgol authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    ba988f8 View commit details
    Browse the repository at this point in the history
  20. ceph: show nocephx_require_signatures and notcp_nodelay options

    Signed-off-by: Ilya Dryomov <[email protected]>
    idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    2a0b61c View commit details
    Browse the repository at this point in the history
  21. ceph: re-send requests when MDS enters reconnecting stage

    So that MDS can check if any request is already completed and process
    completed requests in clientreplay stage. When completed requests are
    processed in clientreplay stage, MDS can avoid sending traceless
    replies.
    
    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    3de22be View commit details
    Browse the repository at this point in the history
  22. ceph: fix dentry leaks

    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    5cba372 View commit details
    Browse the repository at this point in the history
  23. ceph: return error for traceless reply race

    When we receives traceless reply for request that created new inode,
    we re-send a lookup request to MDS get information of the newly created
    inode. (VFS expects FS' callback return an inode in create case)
    This breaks one request into two requests. Other client may modify or
    move to the new inode in the middle.
    
    When the race happens, ceph_handle_notrace_create() unconditionally
    links the dentry for 'create' operation to the inode returned by lookup.
    This may confuse VFS when the inode is a directory (VFS does not allow
    multiple linkages for directory inode).
    
    This patch makes ceph_handle_notrace_create() when it detect a race.
    This event should be rare and it happens only when we talk to old MDS.
    Recent MDS does not send traceless reply for request that creates new
    inode.
    
    Signed-off-by: Yan, Zheng <[email protected]>
    ukernel authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    4d41cef View commit details
    Browse the repository at this point in the history
  24. rbd: convert to blk-mq

    This converts the rbd driver to use the blk-mq infrastructure.  Except
    for switching to a per-request work item this is almost mechanical.
    
    This was tested by Alexandre DERUMIER in November, and found to give
    him 120000 iops, although the only comparism available was an old
    3.10 kernel which gave 80000iops.
    
    Signed-off-by: Christoph Hellwig <[email protected]>
    Reviewed-by: Alex Elder <[email protected]>
    [[email protected]: context, blk_mq_init_queue() EH]
    Signed-off-by: Ilya Dryomov <[email protected]>
    Christoph Hellwig authored and idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    7ad18af View commit details
    Browse the repository at this point in the history
  25. libceph: fix double __remove_osd() problem

    It turns out it's possible to get __remove_osd() called twice on the
    same OSD.  That doesn't sit well with rb_erase() - depending on the
    shape of the tree we can get a NULL dereference, a soft lockup or
    a random crash at some point in the future as we end up touching freed
    memory.  One scenario that I was able to reproduce is as follows:
    
                <osd3 is idle, on the osd lru list>
    <con reset - osd3>
    con_fault_finish()
      osd_reset()
                                  <osdmap - osd3 down>
                                  ceph_osdc_handle_map()
                                    <takes map_sem>
                                    kick_requests()
                                      <takes request_mutex>
                                      reset_changed_osds()
                                        __reset_osd()
                                          __remove_osd()
                                      <releases request_mutex>
                                    <releases map_sem>
        <takes map_sem>
        <takes request_mutex>
        __kick_osd_requests()
          __reset_osd()
            __remove_osd() <-- !!!
    
    A case can be made that osd refcounting is imperfect and reworking it
    would be a proper resolution, but for now Sage and I decided to fix
    this by adding a safe guard around __remove_osd().
    
    Fixes: http://tracker.ceph.com/issues/8087
    
    Cc: Sage Weil <[email protected]>
    Cc: [email protected] # 3.9+: 7c6e6fc: libceph: assert both regular and lingering lists in __remove_osd()
    Cc: [email protected] # 3.9+: cc9f1f5: libceph: change from BUG to WARN for __remove_osd() asserts
    Cc: [email protected] # 3.9+
    Signed-off-by: Ilya Dryomov <[email protected]>
    Reviewed-by: Sage Weil <[email protected]>
    Reviewed-by: Alex Elder <[email protected]>
    idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    7eb71e0 View commit details
    Browse the repository at this point in the history
  26. libceph: kfree() in put_osd() shouldn't depend on authorizer

    a255651 ("ceph: ensure auth ops are defined before use") made
    kfree() in put_osd() conditional on the authorizer.  A mechanical
    mistake most likely - fix it.
    
    Cc: Alex Elder <[email protected]>
    Signed-off-by: Ilya Dryomov <[email protected]>
    Reviewed-by: Sage Weil <[email protected]>
    Reviewed-by: Alex Elder <[email protected]>
    idryomov committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    b28ec2f View commit details
    Browse the repository at this point in the history
  27. Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/gi…

    …t/mmarek/kbuild
    
    Pull kbuild updates from Michal Marek:
    
     - several cleanups in kbuild
    
     - serialize multiple *config targets so that 'make defconfig kvmconfig'
       works
    
     - The cc-ifversion macro got support for an else-branch
    
    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
      kbuild,gcov: simplify kernel/gcov/Makefile more
      kbuild: allow cc-ifversion to have the argument for false condition
      kbuild,gcov: simplify kernel/gcov/Makefile
      kbuild,gcov: remove unnecessary workaround
      kbuild: do not add $(call ...) to invoke cc-version or cc-fullversion
      kbuild: fix cc-ifversion macro
      kbuild: drop $(version_h) from MRPROPER_FILES
      kbuild: use mixed-targets when two or more config targets are given
      kbuild: remove redundant line from bounds.h/asm-offsets.h
      kbuild: merge bounds.h and asm-offsets.h rules
      kbuild: Drop support for clean-rule
    torvalds committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    27a22ee View commit details
    Browse the repository at this point in the history
  28. MAINTAINERS: update Ceph and RBD maintainers

    - add Ilya, drop Yehuda as an RBD maintainer
    - add Zheng as a Ceph maintainer
    - update Yehuda and Sage's emails
    
    Signed-off-by: Sage Weil <[email protected]>
    liewegas committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    0f5417c View commit details
    Browse the repository at this point in the history
  29. Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/…

    …mmarek/kbuild
    
    Pull misc kbuild changes from Michal Marek:
     "Just a few non-critical kbuild changes:
    
       - builddeb adds the actual distribution name in the changelog
       - documentation fixes"
    
    * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
      kbuild: trivial - fix the help doc of CONFIG_CC_OPTIMIZE_FOR_SIZE
      kbuild: Update documentation of clean-files and clean-dirs
      builddeb: Try to determine distribution
      builddeb: Update year and git repository URL in debian/copyright
    torvalds committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    7734334 View commit details
    Browse the repository at this point in the history
  30. Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/g…

    …it/mmarek/kbuild
    
    Pull kconfig updates from Michal Marek:
     "Yann E Morin was supposed to take over kconfig maintainership, but
      this hasn't happened.  So I'm sending a few kconfig patches that I
      collected:
    
       - Fix for missing va_end in kconfig
       - merge_config.sh displays used if given too few arguments
       - s/boolean/bool/ in Kconfig files for consistency, with the plan to
         only support bool in the future"
    
    * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
      kconfig: use va_end to match corresponding va_start
      merge_config.sh: Display usage if given too few arguments
      kconfig: use bool instead of boolean for type definition attributes
    torvalds committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    b11a278 View commit details
    Browse the repository at this point in the history
  31. Merge tag 'platform-drivers-x86-v3.20-1' of git://git.infradead.org/u…

    …sers/dvhart/linux-platform-drivers-x86
    
    Pull platform driver update from Darren Hart:
     "This includes a significant update to the toshiba_acpi driver,
      bringing it to feature parity with the Windows driver, followed by
      some needed cleanups.
    
      The other changes are mostly minor updates, quirks, sparse fixes, or
      cleanups.
    
      Details:
    
       - toshiba_acpi:
           Add support for missing features from the Windows driver, bump the
           sysfs version, and clean up the driver.
    
       - thinkpad_acpi:
           BIOS string versions, unhandled hkey events.
    
       - msamsung-laptop:
           Add native backlight quirk, enable better lid handling.
    
       - intel_scu_ipc:
           Read resources from PCI configuration
    
       - other:
           Fix sparse warnings, general cleanups"
    
    * tag 'platform-drivers-x86-v3.20-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: (34 commits)
      toshiba_acpi: Cleanup GPL header
      toshiba_acpi: Cleanup comment blocks and capitalization
      toshiba_acpi: Make use of DEVICE_ATTR_{RO, RW} macros
      toshiba_acpi: Drop the toshiba_ prefix from sysfs function names
      toshiba_acpi: Move sysfs function and struct declarations further down
      Documentation/ABI: Add file describing the sysfs entries for toshiba_acpi
      toshiba_acpi: Clean file according to coding style
      toshiba_acpi: Bump version number to 0.21
      toshiba_acpi: Add support to enable/disable USB 3
      toshiba_acpi: Add support for Panel Power ON
      toshiba_acpi: Add support for Keyboard functions mode
      toshiba_acpi: Add fan entry to sysfs
      toshiba_acpi: Add version entry to sysfs
      thinkpad_acpi: support new BIOS version string pattern
      thinkpad_acpi: unhandled hkey event
      toshiba_acpi: Make toshiba_eco_mode_available more robust
      classmate-laptop: Fix sparse warning (0 as NULL)
      Sony-laptop: Fix sparse warning (make undeclared var static)
      thinkpad_acpi.c: Fix sparse warning (make undeclared var static)
      samsung-laptop.c: Prefer kstrtoint over single variable sscanf
      ...
    torvalds committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    6ed3e57 View commit details
    Browse the repository at this point in the history
  32. Merge tag 'edac_fixes_for_3.20' of git://git.kernel.org/pub/scm/linux…

    …/kernel/git/bp/bp
    
    Pull two EDAC fixes from Borislav Petkov:
    
     - A fix to sb_edac for proper detection on SNB machines
    
     - A fix to amd64_edac to not explode on Numascale machines with more
       than 16 memory controllers, from Daniel J Blueman.
    
    * tag 'edac_fixes_for_3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
      EDAC, amd64_edac: Prevent OOPS with >16 memory controllers
      sb_edac: Fix detection on SNB machines
    torvalds committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    477ea11 View commit details
    Browse the repository at this point in the history
  33. Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/…

    …rzhang/linux
    
    Pull thermal managament updates from Zhang Rui:
     "Specifics:
    
       - Abstract the code and introduce helper functions for all int340x
         thermal drivers.  From: Srinivas Pandruvada.
    
       - Reorganize the ACPI LPAT table support code so that it can be
         shared for both ACPI PMIC driver and int340x thermal driver.
    
       - Add support for Braswell in intel_soc_dts thermal driver.
    
       - a couple of small fixes/cleanups for step_wise governor and int340x
         thermal driver"
    
    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
      Thermal/int340x_thermal: remove unused uuids.
      thermal: step_wise: spelling fixes
      thermal: int340x: fix sparse warning
      Thermal/int340x: LPAT conversion for temperature
      ACPI / PMIC: Use common LPAT table handling functions
      ACPI / LPAT: Common table processing functions
      thermal: Intel SoC DTS: Add Braswell support
      Thermal/int340x/int3402: Provide notification support
      Thermal/int340x/processor_thermal: Add thermal zone support
      Thermal/int340x/int3403: Use int340x thermal API
      Thermal/int340x/int3402: Use int340x thermal API
      Thermal/int340x: Add common thermal zone handler
    torvalds committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    89d3fa4 View commit details
    Browse the repository at this point in the history
  34. Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…

    …/git/sage/ceph-client
    
    Pull Ceph changes from Sage Weil:
     "On the RBD side, there is a conversion to blk-mq from Christoph,
      several long-standing bug fixes from Ilya, and some cleanup from
      Rickard Strandqvist.
    
      On the CephFS side there is a long list of fixes from Zheng, including
      improved session handling, a few IO path fixes, some dcache management
      correctness fixes, and several blocking while !TASK_RUNNING fixes.
    
      The core code gets a few cleanups and Chaitanya has added support for
      TCP_NODELAY (which has been used on the server side for ages but we
      somehow missed on the kernel client).
    
      There is also an update to MAINTAINERS to fix up some email addresses
      and reflect that Ilya and Zheng are doing most of the maintenance for
      RBD and CephFS these days.  Do not be surprised to see a pull request
      come from one of them in the future if I am unavailable for some
      reason"
    
    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (27 commits)
      MAINTAINERS: update Ceph and RBD maintainers
      libceph: kfree() in put_osd() shouldn't depend on authorizer
      libceph: fix double __remove_osd() problem
      rbd: convert to blk-mq
      ceph: return error for traceless reply race
      ceph: fix dentry leaks
      ceph: re-send requests when MDS enters reconnecting stage
      ceph: show nocephx_require_signatures and notcp_nodelay options
      libceph: tcp_nodelay support
      rbd: do not treat standalone as flatten
      ceph: fix atomic_open snapdir
      ceph: properly mark empty directory as complete
      client: include kernel version in client metadata
      ceph: provide seperate {inode,file}_operations for snapdir
      ceph: fix request time stamp encoding
      ceph: fix reading inline data when i_size > PAGE_SIZE
      ceph: avoid block operation when !TASK_RUNNING (ceph_mdsc_close_sessions)
      ceph: avoid block operation when !TASK_RUNNING (ceph_get_caps)
      ceph: avoid block operation when !TASK_RUNNING (ceph_mdsc_sync)
      rbd: fix error paths in rbd_dev_refresh()
      ...
    torvalds committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    4533f6e View commit details
    Browse the repository at this point in the history
  35. Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…

    …/git/mason/linux-btrfs
    
    Pull btrfs updates from Chris Mason:
     "This pull is mostly cleanups and fixes:
    
       - The raid5/6 cleanups from Zhao Lei fixup some long standing warts
         in the code and add improvements on top of the scrubbing support
         from 3.19.
    
       - Josef has round one of our ENOSPC fixes coming from large btrfs
         clusters here at FB.
    
       - Dave Sterba continues a long series of cleanups (thanks Dave), and
         Filipe continues hammering on corner cases in fsync and others
    
      This all was held up a little trying to track down a use-after-free in
      btrfs raid5/6.  It's not clear yet if this is just made easier to
      trigger with this pull or if its a new bug from the raid5/6 cleanups.
      Dave Sterba is the only one to trigger it so far, but he has a
      consistent way to reproduce, so we'll get it nailed shortly"
    
    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (68 commits)
      Btrfs: don't remove extents and xattrs when logging new names
      Btrfs: fix fsync data loss after adding hard link to inode
      Btrfs: fix BUG_ON in btrfs_orphan_add() when delete unused block group
      Btrfs: account for large extents with enospc
      Btrfs: don't set and clear delalloc for O_DIRECT writes
      Btrfs: only adjust outstanding_extents when we do a short write
      btrfs: Fix out-of-space bug
      Btrfs: scrub, fix sleep in atomic context
      Btrfs: fix scheduler warning when syncing log
      Btrfs: Remove unnecessary placeholder in btrfs_err_code
      btrfs: cleanup init for list in free-space-cache
      btrfs: delete chunk allocation attemp when setting block group ro
      btrfs: clear bio reference after submit_one_bio()
      Btrfs: fix scrub race leading to use-after-free
      Btrfs: add missing cleanup on sysfs init failure
      Btrfs: fix race between transaction commit and empty block group removal
      btrfs: add more checks to btrfs_read_sys_array
      btrfs: cleanup, rename a few variables in btrfs_read_sys_array
      btrfs: add checks for sys_chunk_array sizes
      btrfs: more superblock checks, lower bounds on devices and sectorsize/nodesize
      ...
    torvalds committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    2b9fb53 View commit details
    Browse the repository at this point in the history
  36. x86: pte_protnone() and pmd_protnone() must check entry is not present

    Since _PAGE_PROTNONE aliases _PAGE_GLOBAL it is only valid if
    _PAGE_PRESENT is clear.  Make pte_protnone() and pmd_protnone() check
    for this.
    
    This fixes a 64-bit Xen PV guest regression introduced by 8a0516e
    ("mm: convert p[te|md]_numa users to p[te|md]_protnone_numa").  Any
    userspace process would endlessly fault.
    
    In a 64-bit PV guest, userspace page table entries have _PAGE_GLOBAL set
    by the hypervisor.  This meant that any fault on a present userspace
    entry (e.g., a write to a read-only mapping) would be misinterpreted as
    a NUMA hinting fault and the fault would not be correctly handled,
    resulting in the access endlessly faulting.
    
    Signed-off-by: David Vrabel <[email protected]>
    Acked-by: Mel Gorman <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    David Vrabel authored and torvalds committed Feb 19, 2015
    Configuration menu
    Copy the full SHA
    e3a1f6c View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2015

  1. Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git…

    …/evalenti/linux-soc-thermal
    
    Pull more thermal managament updates from Zhang Rui:
     "Specifics:
    
       - Exynos thermal driver refactoring.  Several cleanups, code
         optimization, unused symbols removal, and unused feature removal in
         Exynos thermal driver.  Thanks Lukasz for this effort.
    
       - Exynos thermal driver support to OF thermal.  After the code
         refactoring, the driver earned the support to OF thermal.  Chip
         thermal data were moved from driver code to DTS, reducing the code
         footprint.  Thanks Lukasz for this.
    
       - After receiving the OF thermal support, the exynos thermal driver
         now must allow modular build.  Thanks Arnd for detecting, reporting
         and fixing this.
    
       - Exynos thermal driver support to Exynos 7 SoC.  Thanks Abhilash for
         this.
    
       - Accurate temperature reporting on Rockchip thermal driver, thanks
         to Caesar.
    
       - Fix on how OF thermal enables its zones, thanks Lukasz for fixing.
    
       - Fixes in OF thermal examples under Documentation/.  Thanks Srinivas
         for fixing"
    
    * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal:
      thermal: exynos: Add TMU support for Exynos7 SoC
      dts: Documentation: Add documentation for Exynos7 SoC thermal bindings
      cpufreq: exynos: allow modular build
      thermal: Fix examples in DT documentation
      thermal: exynos: Correct sanity check at exynos_report_trigger() function
      thermal: Kconfig: Remove config for not used EXYNOS_THERMAL_CORE
      thermal: exynos: Remove exynos_tmu_data.c file
      thermal: rockchip: make temperature reporting much more accurate
      thermal: exynos: Remove exynos_thermal_common.[c|h] files
      thermal: samsung: core: Exynos TMU rework to use device tree for configuration
      dts: Documentation: Update exynos-thermal.txt example for Exynos5440
      dts: Documentation: Extending documentation entry for exynos-thermal
      cpufreq: exynos: Use device tree to determine if cpufreq cooling should be registered
      thermal: exynos: Modify exynos thermal code to use device tree for cpu cooling configuration
      thermal: exynos: Provide thermal_exynos.h file to be included in device tree files
      thermal: exynos: cosmetic: Correct comment format
      thermal: of: Enable thermal_zoneX when sensor is correctly added
    torvalds committed Feb 20, 2015
    Configuration menu
    Copy the full SHA
    3d88348 View commit details
    Browse the repository at this point in the history