Skip to content
Permalink
Qu-Wenruo/Btrf…

Commits on Jun 15, 2016

  1. btrfs: dedupe: fix false ENOSPC

    When testing in-band dedupe, sometimes we got ENOSPC error, though fs
    still has much free space. After some debuging work, we found that it's
    btrfs_delalloc_reserve_metadata() which sometimes tries to reserve
    plenty of metadata space, even for very small data range.
    
    In btrfs_delalloc_reserve_metadata(), the number of metadata bytes we try
    to reserve is calculated by the difference between outstanding_extents and
    reserved_extents. Please see below case for how ENOSPC occurs:
    
      1, Buffered write 128MB data in unit of 1MB, so finially we'll have
    inode outstanding extents be 1, and reserved_extents be 128.
    Note it's btrfs_merge_extent_hook() that merges these 1MB units into
    one big outstanding extent, but do not change reserved_extents.
    
      2, When writing dirty pages, for in-band dedupe, cow_file_range() will
    split above big extent in unit of 16KB(assume our in-band dedupe blocksize
    is 16KB). When first split opeartion finishes, we'll have 2 outstanding
    extents and 128 reserved extents, and just right the currently generated
    ordered extent is dispatched to run and complete, then
    btrfs_delalloc_release_metadata()(see btrfs_finish_ordered_io()) will be
    called to release metadata, after that we will have 1 outstanding extents
    and 1 reserved extents(also see logic in drop_outstanding_extent()). Later
    cow_file_range() continues to handles left data range[16KB, 128MB), and if
    no other ordered extent was dispatched to run, there will be 8191
    outstanding extents and 1 reserved extent.
    
      3, Now if another bufferd write for this file enters, then
    btrfs_delalloc_reserve_metadata() will at least try to reserve metadata
    for 8191 outstanding extents' metadata, for 64K node size, it'll be
    8191*65536*16, about 8GB metadata, so obviously it'll return ENOSPC error.
    
    But indeed when a file goes through in-band dedupe, its max extent size
    will no longer be BTRFS_MAX_EXTENT_SIZE(128MB), it'll be limited by in-band
    dedupe blocksize, so current metadata reservation method in btrfs is not
    appropriate or correct, here we introduce btrfs_max_extent_size(), which
    will return max extent size for corresponding files, which go through in-band
    and we use this value to do metadata reservation and extent_io merge, split,
    clear operations, we can make sure difference between outstanding_extents
    and reserved_extents will not be so big.
    
    Currently only buffered write will go through in-band dedupe if in-band
    dedupe is enabled.
    
    Reported-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
    Cc: Josef Bacik <jbacik@fb.com>
    Cc: Mark Fasheh <mfasheh@suse.de>
    Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
    wangxiaoguang authored and fengguang committed Jun 15, 2016
  2. btrfs: improve inode's outstanding_extents computation

    This issue was revealed by modifying BTRFS_MAX_EXTENT_SIZE(128MB) to 64KB,
    When modifying BTRFS_MAX_EXTENT_SIZE(128MB) to 64KB, fsstress test often
    gets these warnings from btrfs_destroy_inode():
    	WARN_ON(BTRFS_I(inode)->outstanding_extents);
    	WARN_ON(BTRFS_I(inode)->reserved_extents);
    
    Simple test program below can reproduce this issue steadily.
    Note: you need to modify BTRFS_MAX_EXTENT_SIZE to 64KB to have test,
    otherwise there won't be such WARNING.
    	#include <string.h>
    	#include <unistd.h>
    	#include <sys/types.h>
    	#include <sys/stat.h>
    	#include <fcntl.h>
    
    	int main(void)
    	{
    		int fd;
    		char buf[68 *1024];
    
    		memset(buf, 0, 68 * 1024);
    		fd = open("testfile", O_CREAT | O_EXCL | O_RDWR);
    		pwrite(fd, buf, 68 * 1024, 64 * 1024);
    		return;
    	}
    
    When BTRFS_MAX_EXTENT_SIZE is 64KB, and buffered data range is:
    64KB						128K		132KB
    |-----------------------------------------------|---------------|
                             64 + 4KB
    
    1) for above data range, btrfs_delalloc_reserve_metadata() will reserve
    metadata and set BTRFS_I(inode)->outstanding_extents to 2.
    (68KB + 64KB - 1) / 64KB == 2
    
    Outstanding_extents: 2
    
    2) then btrfs_dirty_page() will be called to dirty pages and set
    EXTENT_DELALLOC flag. In this case, btrfs_set_bit_hook() will be called
    twice.
    The 1st set_bit_hook() call will set DEALLOC flag for the first 64K.
    64KB						128KB
    |-----------------------------------------------|
    	64KB DELALLOC
    Outstanding_extents: 2
    
    Set_bit_hooks() uses FIRST_DELALLOC flag to avoid re-increase
    outstanding_extents counter.
    So for 1st set_bit_hooks() call, it won't modify outstanding_extents,
    it's still 2.
    
    Then FIRST_DELALLOC flag is *CLEARED*.
    
    3) 2nd btrfs_set_bit_hook() call.
    Because FIRST_DELALLOC have been cleared by previous set_bit_hook(),
    btrfs_set_bit_hook() will increase BTRFS_I(inode)->outstanding_extents by one, so
    now BTRFS_I(inode)->outstanding_extents is 3.
    64KB                                            128KB            132KB
    |-----------------------------------------------|----------------|
    	64K DELALLOC				   4K DELALLOC
    Outstanding_extents: 3
    
    But the correct outstanding_extents number should be 2, not 3.
    The 2nd btrfs_set_bit_hook() call just screwed up this, and leads to the
    WARN_ON().
    
    Normally, we can solve it by only increasing outstanding_extents in
    set_bit_hook().
    But the problem is for delalloc_reserve/release_metadata(), we only have
    a 'length' parameter, and calculate in-accurate outstanding_extents.
    If we only rely on set_bit_hook() release_metadata() will crew things up
    as it will decrease inaccurate number.
    
    So the fix we use is:
    1) Increase *INACCURATE* outstanding_extents at delalloc_reserve_meta
       Just as a place holder.
    2) Increase *accurate* outstanding_extents at set_bit_hooks()
       This is the real increaser.
    3) Decrease *INACCURATE* outstanding_extents before returning
       This makes outstanding_extents to correct value.
    
    For 128M BTRFS_MAX_EXTENT_SIZE, due to limitation of
    __btrfs_buffered_write(), each iteration will only handle about 2MB
    data.
    So btrfs_dirty_pages() won't need to handle cases cross 2 extents.
    
    Cc: Mark Fasheh <mfasheh@suse.de>
    Cc: Josef Bacik <jbacik@fb.com>
    Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
    wangxiaoguang authored and fengguang committed Jun 15, 2016
  3. btrfs: relocation: Enhance error handling to avoid BUG_ON

    Since the introduce of btrfs dedupe tree, it's possible that balance can
    race with dedupe disabling.
    
    When this happens, dedupe_enabled will make btrfs_get_fs_root() return
    PTR_ERR(-ENOENT).
    But due to a bug in error handling branch, when this happens
    backref_cache->nr_nodes is increased but the node is neither added to
    backref_cache or nr_nodes decreased.
    Causing BUG_ON() in backref_cache_cleanup()
    
    [ 2611.668810] ------------[ cut here ]------------
    [ 2611.669946] kernel BUG at
    /home/sat/ktest/linux/fs/btrfs/relocation.c:243!
    [ 2611.670572] invalid opcode: 0000 [#1] SMP
    [ 2611.686797] Call Trace:
    [ 2611.687034]  [<ffffffffa01f71d3>]
    btrfs_relocate_block_group+0x1b3/0x290 [btrfs]
    [ 2611.687706]  [<ffffffffa01cc177>]
    btrfs_relocate_chunk.isra.40+0x47/0xd0 [btrfs]
    [ 2611.688385]  [<ffffffffa01cdb12>] btrfs_balance+0xb22/0x11e0 [btrfs]
    [ 2611.688966]  [<ffffffffa01d9611>] btrfs_ioctl_balance+0x391/0x3a0
    [btrfs]
    [ 2611.689587]  [<ffffffffa01ddaf0>] btrfs_ioctl+0x1650/0x2290 [btrfs]
    [ 2611.690145]  [<ffffffff81171cda>] ? lru_cache_add+0x3a/0x80
    [ 2611.690647]  [<ffffffff81171e4c>] ?
    lru_cache_add_active_or_unevictable+0x4c/0xc0
    [ 2611.691310]  [<ffffffff81193f04>] ? handle_mm_fault+0xcd4/0x17f0
    [ 2611.691842]  [<ffffffff811da423>] ? cp_new_stat+0x153/0x180
    [ 2611.692342]  [<ffffffff8119913d>] ? __vma_link_rb+0xfd/0x110
    [ 2611.692842]  [<ffffffff81199209>] ? vma_link+0xb9/0xc0
    [ 2611.693303]  [<ffffffff811e7e81>] do_vfs_ioctl+0xa1/0x5a0
    [ 2611.693781]  [<ffffffff8104e024>] ? __do_page_fault+0x1b4/0x400
    [ 2611.694310]  [<ffffffff811e83c1>] SyS_ioctl+0x41/0x70
    [ 2611.694758]  [<ffffffff816dfc6e>] entry_SYSCALL_64_fastpath+0x12/0x71
    [ 2611.695331] Code: ff 48 8b 45 bf 49 83 af a8 05 00 00 01 49 89 87 a0
    05 00 00 e9 2e fd ff ff b8 f4 ff ff ff e9 e4 fb ff ff 0f 0b 0f 0b 0f 0b
    0f 0b <0f> 0b 0f 0b 41 89 c6 e9 b8 fb ff ff e8 9e a6 e8 e0 4c 89 e7 44
    [ 2611.697870] RIP  [<ffffffffa01f6fc1>]
    relocate_block_group+0x741/0x7a0 [btrfs]
    [ 2611.698818]  RSP <ffff88002a81fb30>
    
    This patch will call remove_backref_node() in error handling branch, and
    cache the returned -ENOENT in relocate_tree_block() and continue
    balancing.
    
    Reported-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
    Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
    Qu Wenruo authored and fengguang committed Jun 15, 2016
  4. btrfs: dedupe: Add ioctl for inband dedupelication

    Add ioctl interface for inband dedupelication, which includes:
    1) enable
    2) disable
    3) status
    
    And a pseudo RO compat flag, to imply that btrfs now supports inband
    dedup.
    However we don't add any ondisk format change, it's just a pseudo RO
    compat flag.
    
    All these ioctl interface are state-less, which means caller don't need
    to bother previous dedupe state before calling them, and only need to
    care the final desired state.
    
    For example, if user want to enable dedupe with specified block size and
    limit, just fill the ioctl structure and call enable ioctl.
    No need to check if dedupe is already running.
    
    These ioctls will handle things like re-configure or disable quite well.
    
    Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
    Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
    wangxiaoguang authored and fengguang committed Jun 15, 2016
  5. btrfs: dedupe: Inband in-memory only de-duplication implement

    Core implement for inband de-duplication.
    It reuse the async_cow_start() facility to do the calculate dedupe hash.
    And use dedupe hash to do inband de-duplication at extent level.
    
    The work flow is as below:
    1) Run delalloc range for an inode
    2) Calculate hash for the delalloc range at the unit of dedupe_bs
    3) For hash match(duplicated) case, just increase source extent ref
       and insert file extent.
       For hash mismatch case, go through the normal cow_file_range()
       fallback, and add hash into dedupe_tree.
       Compress for hash miss case is not supported yet.
    
    Current implement restore all dedupe hash in memory rb-tree, with LRU
    behavior to control the limit.
    
    Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
    Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
    Qu Wenruo authored and fengguang committed Jun 15, 2016
  6. btrfs: ordered-extent: Add support for dedupe

    Add ordered-extent support for dedupe.
    
    Note, current ordered-extent support only supports non-compressed source
    extent.
    Support for compressed source extent will be added later.
    
    Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
    Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
    Reviewed-by: Josef Bacik <jbacik@fb.com>
    wangxiaoguang authored and fengguang committed Jun 15, 2016
  7. btrfs: dedupe: Implement btrfs_dedupe_calc_hash interface

    Unlike in-memory or on-disk dedupe method, only SHA256 hash method is
    supported yet, so implement btrfs_dedupe_calc_hash() interface using
    SHA256.
    
    Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
    Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
    Reviewed-by: Josef Bacik <jbacik@fb.com>
    wangxiaoguang authored and fengguang committed Jun 15, 2016
  8. btrfs: dedupe: Introduce function to search for an existing hash

    Introduce static function inmem_search() to handle the job for in-memory
    hash tree.
    
    The trick is, we must ensure the delayed ref head is not being run at
    the time we search the for the hash.
    
    With inmem_search(), we can implement the btrfs_dedupe_search()
    interface.
    
    Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
    Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
    Reviewed-by: Josef Bacik <jbacik@fb.com>
    wangxiaoguang authored and fengguang committed Jun 15, 2016
  9. btrfs: delayed-ref: Add support for increasing data ref under spinlock

    For in-band dedupe, btrfs needs to increase data ref with delayed_ref
    locked, so add a new function btrfs_add_delayed_data_ref_lock() to
    increase extent ref with delayed_refs already locked.
    
    Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
    Reviewed-by: Josef Bacik <jbacik@fb.com>
    Qu Wenruo authored and fengguang committed Jun 15, 2016
  10. btrfs: dedupe: Introduce function to remove hash from in-memory tree

    Introduce static function inmem_del() to remove hash from in-memory
    dedupe tree.
    And implement btrfs_dedupe_del() and btrfs_dedup_disable() interfaces.
    
    Also for btrfs_dedupe_disable(), add new functions to wait existing
    writer and block incoming writers to eliminate all possible race.
    
    Cc: Mark Fasheh <mfasheh@suse.de>
    Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
    Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
    wangxiaoguang authored and fengguang committed Jun 15, 2016
  11. btrfs: dedupe: Introduce function to add hash into in-memory tree

    Introduce static function inmem_add() to add hash into in-memory tree.
    And now we can implement the btrfs_dedupe_add() interface.
    
    Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
    Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
    Reviewed-by: Josef Bacik <jbacik@fb.com>
    wangxiaoguang authored and fengguang committed Jun 15, 2016
  12. btrfs: dedupe: Introduce function to initialize dedupe info

    Add generic function to initialize dedupe info.
    
    Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
    Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
    Reviewed-by: Josef Bacik <jbacik@fb.com>
    wangxiaoguang authored and fengguang committed Jun 15, 2016
  13. btrfs: dedupe: Introduce dedupe framework and its header

    Introduce the header for btrfs online(write time) de-duplication
    framework and needed header.
    
    The new de-duplication framework is going to support 2 different dedupe
    methods and 1 dedupe hash.
    
    Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
    Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
    wangxiaoguang authored and fengguang committed Jun 15, 2016

Commits on Jun 12, 2016

  1. Linux 4.7-rc3

    torvalds committed Jun 12, 2016
  2. Merge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/gi…

    …t/rzhang/linux
    
    Pull thermal management fixes from Zhang Rui:
    
     - fix an ordering issue in cpu cooling that cooling device is
       registered before it's ready (freq_table being populated).
       (Lukasz Luba)
    
     - fix a missing comment update (Caesar Wang)
    
    * 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
      thermal: add the note for set_trip_temp
      thermal: cpu_cooling: fix improper order during initialization
    torvalds committed Jun 12, 2016
  3. Merge branch 'for-linus' of git://git.kernel.dk/linux-block

    Pull block layer fixes from Jens Axboe:
     "A small collection of fixes for the current series.  This contains:
    
       - Two fixes for xen-blkfront, from Bob Liu.
    
       - A bug fix for NVMe, releasing only the specific resources we
         requested.
    
       - Fix for a debugfs flags entry for nbd, from Josef.
    
       - Plug fix from Omar, fixing up a case of code being switched between
         two functions.
    
       - A missing bio_put() for the new discard callers of
         submit_bio_wait(), fixing a regression causing a leak of the bio.
         From Shaun.
    
       - Improve dirty limit calculation precision in the writeback code,
         fixing a case where setting a limit lower than 1% of memory would
         end up being zero.  From Tejun"
    
    * 'for-linus' of git://git.kernel.dk/linux-block:
      NVMe: Only release requested regions
      xen-blkfront: fix resume issues after a migration
      xen-blkfront: don't call talk_to_blkback when already connected to blkback
      nbd: pass the nbd pointer for flags debugfs
      block: missing bio_put following submit_bio_wait
      blk-mq: really fix plug list flushing for nomerge queues
      writeback: use higher precision calculation in domain_dirty_limits()
    torvalds committed Jun 12, 2016
  4. Merge tag 'gpio-v4.7-3' of git://git.kernel.org/pub/scm/linux/kernel/…

    …git/linusw/linux-gpio
    
    Pull GPIO fixes from Linus Walleij:
     "A new bunch of GPIO fixes for v4.7.
    
      This time I am very grateful that Ricardo Ribalda Delgado went in and
      fixed my stupid refcounting mistakes in the removal path for GPIO
      chips.  I had a feeling something was wrong here and so it was.  It
      exploded on OMAP and it fixes their problem.  Now it should be (more)
      solid.
    
      The rest i compilation, Kconfig and driver fixes.  Some tagged for
      stable.
    
      Summary:
    
       - Fix a NULL pointer dereference when we are searching the GPIO
         device list but one of the devices have been removed (struct
         gpio_chip pointer is NULL).
    
       - Fix unaligned reference counters: we were ending on +3 after all
         said and done.  It should be 0.  Remove an extraneous get_device(),
         and call cdev_del() followed by device_del() in gpiochip_remove()
         instead and the count goes to zero and calls the release() function
         properly.
    
       - Fix a compile warning due to a missing #include in the OF/device
         tree portions.
    
       - Select ANON_INODES for GPIOLIB, we're using that for our character
         device.  Some randconfig tests disclosed the problem.
    
       - Make sure the Zynq driver clock runs also without CONFIG_PM enabled
    
       - Fix an off-by-one error in the 104-DIO-48E driver
    
       - Fix warnings in bcm_kona_gpio_reset()"
    
    * tag 'gpio-v4.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
      gpio: bcm-kona: fix bcm_kona_gpio_reset() warnings
      gpio: select ANON_INODES
      gpio: include <linux/io-mapping.h> in gpiolib-of
      gpiolib: Fix unaligned used of reference counters
      gpiolib: Fix NULL pointer deference
      gpio: zynq: initialize clock even without CONFIG_PM
      gpio: 104-dio-48e: Fix control port offset computation off-by-one error
    torvalds committed Jun 12, 2016

Commits on Jun 11, 2016

  1. Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/g…

    …it/jejb/scsi
    
    Pull SCSI fixes from James Bottomley:
     "Two current fixes:
    
       - one affects Qemu CD ROM emulation, which stopped working after the
         updates in SCSI to require VPD pages from all conformant devices.
    
         Fix temporarily by blacklisting Qemu (we can relax later when they
         come into compliance).
    
       - The other is a fix to the optimal transfer size.  We set up a
         minefield for ourselves by being confused about whether the limits
         are in bytes or sectors (SCSI optimal is in blocks and the queue
         parameter is in bytes).
    
         This tries to fix the problem (wrong setting for queue limits
         max_sectors) and make the problem more obvious by introducing a
         wrapper function"
    
    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
      sd: Fix rw_max for devices that report an optimal xfer size
      scsi: Add QEMU CD-ROM to VPD Inquiry Blacklist
    torvalds committed Jun 11, 2016
  2. Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/…

    …kernel/git/wsa/linux
    
    Pull i2c fixes from Wolfram Sang:
    
     - a bigger fix for i801 to finally be able to be loaded on some
       machines again
    
     - smaller driver fixes
    
     - documentation update because of a renamed file
    
    * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
      i2c: mux: reg: Provide of_match_table
      i2c: mux: refer to i2c-mux.txt
      i2c: octeon: Avoid printk after too long SMBUS message
      i2c: octeon: Missing AAK flag in case of I2C_M_RECV_LEN
      i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR
    torvalds committed Jun 11, 2016
  3. Merge tag 'devicetree-fixes-for-4.7' of git://git.kernel.org/pub/scm/…

    …linux/kernel/git/robh/linux
    
    Pull DeviceTree fixes from Rob Herring:
    
     - fix unflatten_dt_nodes when dad parameter is set.
    
     - add vendor prefixes for TechNexion and UniWest
    
     - documentation fix for Marvell BT
    
     - OF IRQ kerneldoc fixes
    
     - restrict CMA alignment adjustments to non dma-coherent
    
     - a couple of warning fixes in reserved-memory code
    
     - DT maintainers updates
    
    * tag 'devicetree-fixes-for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
      drivers: of: add definition of early_init_dt_alloc_reserved_memory_arch
      drivers/of: Fix depth for sub-tree blob in unflatten_dt_nodes()
      drivers: of: Fix of_pci.h header guard
      dt-bindings: Add vendor prefix for TechNexion
      of: add vendor prefix for UniWest
      dt: bindings: fix documentation for MARVELL's bt-sd8xxx wireless device
      of: add missing const for of_parse_phandle_with_args() in !CONFIG_OF
      of: silence warnings due to max() usage
      drivers: of: of_reserved_mem: fixup the CMA alignment not to affect dma-coherent
      of: irq: fix of_irq_get[_byname]() kernel-doc
      MAINTAINERS: DeviceTree maintainer updates
    torvalds committed Jun 11, 2016
  4. Merge tag '20160610_uvc_compat_for_linus' of git://git.kernel.org/pub…

    …/scm/linux/kernel/git/luto/linux
    
    Pull uvc compat XU ioctl fixes from Andy Lutomirski:
     "uvc's compat XU ioctls go through tons of potentially buggy
      indirection.  The first patch removes the indirection.  The second one
      cleans up the code.
    
      Compile-tested only.  I have the hardware, but I have absolutely no
      idea what XU does, how to use it, what software to recompile as
      32-bit, or what to test in that software"
    
    * tag '20160610_uvc_compat_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/luto/linux:
      uvc_v4l2: Simplify compat ioctl implementation
      uvc: Forward compat ioctls to their handlers directly
    torvalds committed Jun 11, 2016

Commits on Jun 10, 2016

  1. uvc_v4l2: Simplify compat ioctl implementation

    The uvc compat ioctl implementation seems to have copied user data
    for no good reason.  Remove a bunch of copies.
    
    Signed-off-by: Andy Lutomirski <luto@kernel.org>
    amluto committed Jun 10, 2016
  2. uvc: Forward compat ioctls to their handlers directly

    The current code goes through a lot of indirection just to call a
    known handler.  Simplify it: just call the handlers directly.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Andy Lutomirski <luto@kernel.org>
    amluto committed Jun 10, 2016
  3. Merge branch 'for-linus-4.7' of git://git.kernel.org/pub/scm/linux/ke…

    …rnel/git/mason/linux-btrfs
    
    Pull btrfs fixes from Chris Mason:
     "Has some fixes and some new self tests for btrfs.  The self tests are
      usually disabled in the .config file (unless you're doing btrfs dev
      work), and this bunch is meant to find problems with the 64K page size
      patches.
    
      Jeff has a patch to help people see if they are using the hardware
      assist crc32c module, which really helps us nail down problems when
      people ask why crcs are using so much CPU.
    
      Otherwise, it's small fixes"
    
    * 'for-linus-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
      Btrfs: self-tests: Fix extent buffer bitmap test fail on BE system
      Btrfs: self-tests: Fix test_bitmaps fail on 64k sectorsize
      Btrfs: self-tests: Use macros instead of constants and add missing newline
      Btrfs: self-tests: Support testing all possible sectorsizes and nodesizes
      Btrfs: self-tests: Execute page straddling test only when nodesize < PAGE_SIZE
      btrfs: advertise which crc32c implementation is being used at module load
      Btrfs: add validadtion checks for chunk loading
      Btrfs: add more validation checks for superblock
      Btrfs: clear uptodate flags of pages in sys_array eb
      Btrfs: self-tests: Support non-4k page size
      Btrfs: Fix integer overflow when calculating bytes_per_bitmap
      Btrfs: test_check_exists: Fix infinite loop when searching for free space entries
      Btrfs: end transaction if we abort when creating uuid root
      btrfs: Use __u64 in exported linux/btrfs.h.
    torvalds committed Jun 10, 2016
  4. Merge tag 'powerpc-4.7-3Michael Ellerman:' of git://git.kernel.org/pu…

    …b/scm/linux/kernel/git/powerpc/linux
    
    Pull powerpc fixes from
     - ptrace: Fix out of bounds array access warning from Khem Raj
     - pseries: Fix PCI config address for DDW from Gavin Shan
     - pseries: Fix IBM_ARCH_VEC_NRCORES_OFFSET since POWER8NVL was added
       from Michael Ellerman
     - of: fix autoloading due to broken modalias with no 'compatible' from
       Wolfram Sang
     - radix: Fix always false comparison against MMU_NO_CONTEXT from Aneesh
       Kumar K.V
     - hash: Compute the segment size correctly for ISA 3.0 from Aneesh
       Kumar K.V
     - nohash: Fix build break with 64K pages from Michael Ellerman
    
    * tag 'powerpc-4.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
      powerpc/nohash: Fix build break with 64K pages
      powerpc/mm/hash: Compute the segment size correctly for ISA 3.0
      powerpc/mm/radix: Fix always false comparison against MMU_NO_CONTEXT
      of: fix autoloading due to broken modalias with no 'compatible'
      powerpc/pseries: Fix IBM_ARCH_VEC_NRCORES_OFFSET since POWER8NVL was added
      powerpc/pseries: Fix PCI config address for DDW
      powerpc/ptrace: Fix out of bounds array access warning
    torvalds committed Jun 10, 2016
  5. Merge tag 'hwmon-for-linus-v4.7-rc3' of git://git.kernel.org/pub/scm/…

    …linux/kernel/git/groeck/linux-staging
    
    Pull hwmon fixes from Guenter Roeck:
    
     - fix regression in fam15h_power driver
    
     - minor variable type fix in lm90 driver
    
     - document compatible statement for ina2xx driver
    
    * tag 'hwmon-for-linus-v4.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
      hwmon: (lm90) use proper type for update_interval
      hwmon: (ina2xx) Document compatible for INA231
      hwmon: (fam15h_power) Disable preemption when reading registers
    torvalds committed Jun 10, 2016
  6. Merge branch 'stacking-fixes' (vfs stacking fixes from Jann)

    Merge filesystem stacking fixes from Jann Horn.
    
    * emailed patches from Jann Horn <jannh@google.com>:
      sched: panic on corrupted stack end
      ecryptfs: forbid opening files without mmap handler
      proc: prevent stacking filesystems on top
    torvalds committed Jun 10, 2016
  7. sched: panic on corrupted stack end

    Until now, hitting this BUG_ON caused a recursive oops (because oops
    handling involves do_exit(), which calls into the scheduler, which in
    turn raises an oops), which caused stuff below the stack to be
    overwritten until a panic happened (e.g.  via an oops in interrupt
    context, caused by the overwritten CPU index in the thread_info).
    
    Just panic directly.
    
    Signed-off-by: Jann Horn <jannh@google.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    thejh authored and torvalds committed Jun 10, 2016
  8. ecryptfs: forbid opening files without mmap handler

    This prevents users from triggering a stack overflow through a recursive
    invocation of pagefault handling that involves mapping procfs files into
    virtual memory.
    
    Signed-off-by: Jann Horn <jannh@google.com>
    Acked-by: Tyler Hicks <tyhicks@canonical.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    thejh authored and torvalds committed Jun 10, 2016
  9. proc: prevent stacking filesystems on top

    This prevents stacking filesystems (ecryptfs and overlayfs) from using
    procfs as lower filesystem.  There is too much magic going on inside
    procfs, and there is no good reason to stack stuff on top of procfs.
    
    (For example, procfs does access checks in VFS open handlers, and
    ecryptfs by design calls open handlers from a kernel thread that doesn't
    drop privileges or so.)
    
    Signed-off-by: Jann Horn <jannh@google.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    thejh authored and torvalds committed Jun 10, 2016
  10. Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/…

    …git/arm64/linux
    
    Pull arm64 fix from Will Deacon:
     "A fix for an issue that Alex saw whilst swapping with hardware
      access/dirty bit support enabled in the kernel: Fix a failure to fault
      in old pages on a write when CONFIG_ARM64_HW_AFDBM is enabled"
    
    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
      arm64: mm: always take dirty state from new pte in ptep_set_access_flags
    torvalds committed Jun 10, 2016
  11. Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/l…

    …inux/kernel/git/tip/tip
    
    Pull x86 fixes from Ingo Molnar:
     "Misc fixes from all around the map, plus a commit that introduces a
      new header of Intel model name symbols (unused) that will make the
      next merge window easier"
    
    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      x86/ioapic: Fix incorrect pointers in ioapic_setup_resources()
      x86/entry/traps: Don't force in_interrupt() to return true in IST handlers
      x86/cpu/AMD: Extend X86_FEATURE_TOPOEXT workaround to newer models
      x86/cpu/intel: Introduce macros for Intel family numbers
      x86, build: copy ldlinux.c32 to image.iso
      x86/msr: Use the proper trace point conditional for writes
    torvalds committed Jun 10, 2016
  12. Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm…

    …/linux/kernel/git/tip/tip
    
    Pull scheduler fixes from Ingo Molnar:
     "Two scheduler debugging fixes"
    
    * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      sched/debug: Fix 'schedstats=enable' cmdline option
      sched/debug: Fix /proc/sched_debug regression
    torvalds committed Jun 10, 2016
  13. Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/…

    …linux/kernel/git/tip/tip
    
    Pull perf fixes from Ingo Molnar:
     "A handful of tooling fixes, two PMU driver fixes and a cleanup of
      redundant code that addresses a security analyzer false positive"
    
    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      perf/core: Remove a redundant check
      perf/x86/intel/uncore: Remove SBOX support for Broadwell server
      perf ctf: Convert invalid chars in a string before set value
      perf record: Fix crash when kptr is restricted
      perf symbols: Check kptr_restrict for root
      perf/x86/intel/rapl: Fix pmus free during cleanup
    torvalds committed Jun 10, 2016
  14. Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/s…

    …cm/linux/kernel/git/tip/tip
    
    Pull locking fixes from Ingo Molnar:
     "Misc fixes:
    
       - a file-based futex fix
       - one more spin_unlock_wait() fix
       - a ww-mutex deadlock detection improvement/fix
       - and a raw_read_seqcount_latch() barrier fix"
    
    * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      futex: Calculate the futex key based on a tail page for file-based futexes
      locking/qspinlock: Fix spin_unlock_wait() some more
      locking/ww_mutex: Report recursive ww_mutex locking early
      locking/seqcount: Re-fix raw_read_seqcount_latch()
    torvalds committed Jun 10, 2016
Older
You can’t perform that action at this time.