1. 30 Mar, 2016 1 commit
    • Filipe Manana's avatar
      btrfs: fix crash/invalid memory access on fsync when using overlayfs · de17e793
      Filipe Manana authored
      If the lower or upper directory of an overlayfs mount belong to a btrfs
      file system and we fsync the file through the overlayfs' merged directory
      we ended up accessing an inode that didn't belong to btrfs as if it were
      a btrfs inode at btrfs_sync_file() resulting in a crash like the following:
      
      [ 7782.588845] BUG: unable to handle kernel NULL pointer dereference at 0000000000000544
      [ 7782.590624] IP: [<ffffffffa030b7ab>] btrfs_sync_file+0x11b/0x3e9 [btrfs]
      [ 7782.591931] PGD 4d954067 PUD 1e878067 PMD 0
      [ 7782.592016] Oops: 0002 [#6] PREEMPT SMP DEBUG_PAGEALLOC
      [ 7782.592016] Modules linked in: btrfs overlay ppdev crc32c_generic evdev xor raid6_pq psmouse pcspkr sg serio_raw acpi_cpufreq parport_pc parport tpm_tis i2c_piix4 tpm i2c_core processor button loop autofs4 ext4 crc16 mbcache jbd2 sr_mod cdrom sd_mod ata_generic virtio_scsi ata_piix virtio_pci libata virtio_ring virtio scsi_mod e1000 floppy [last unloaded: btrfs]
      [ 7782.592016] CPU: 10 PID: 16437 Comm: xfs_io Tainted: G      D         4.5.0-rc6-btrfs-next-26+ #1
      [ 7782.592016] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS by qemu-project.org 04/01/2014
      [ 7782.592016] task: ffff88001b8d40c0 ti: ffff880137488000 task.ti: ffff880137488000
      [ 7782.592016] RIP: 0010:[<ffffffffa030b7ab>]  [<ffffffffa030b7ab>] btrfs_sync_file+0x11b/0x3e9 [btrfs]
      [ 7782.592016] RSP: 0018:ffff88013748be40  EFLAGS: 00010286
      [ 7782.592016] RAX: 0000000080000000 RBX: ffff880133b30c88 RCX: 0000000000000001
      [ 7782.592016] RDX: 0000000000000001 RSI: ffffffff8148fec0 RDI: 00000000ffffffff
      [ 7782.592016] RBP: ffff88013748bec0 R08: 0000000000000001 R09: 0000000000000000
      [ 7782.624248] R10: ffff88013748be40 R11: 0000000000000246 R12: 0000000000000000
      [ 7782.624248] R13: 0000000000000000 R14: 00000000009305a0 R15: ffff880015e3be40
      [ 7782.624248] FS:  00007fa83b9cb700(0000) GS:ffff88023ed40000(0000) knlGS:0000000000000000
      [ 7782.624248] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 7782.624248] CR2: 0000000000000544 CR3: 00000001fa652000 CR4: 00000000000006e0
      [ 7782.624248] Stack:
      [ 7782.624248]  ffffffff8108b5cc ffff88013748bec0 0000000000000246 ffff8800b005ded0
      [ 7782.624248]  ffff880133b30d60 8000000000000000 7fffffffffffffff 0000000000000246
      [ 7782.624248]  0000000000000246 ffffffff81074f9b ffffffff8104357c ffff880015e3be40
      [ 7782.624248] Call Trace:
      [ 7782.624248]  [<ffffffff8108b5cc>] ? arch_local_irq_save+0x9/0xc
      [ 7782.624248]  [<ffffffff81074f9b>] ? ___might_sleep+0xce/0x217
      [ 7782.624248]  [<ffffffff8104357c>] ? __do_page_fault+0x3c0/0x43a
      [ 7782.624248]  [<ffffffff811a2351>] vfs_fsync_range+0x8c/0x9e
      [ 7782.624248]  [<ffffffff811a237f>] vfs_fsync+0x1c/0x1e
      [ 7782.624248]  [<ffffffff811a24d6>] do_fsync+0x31/0x4a
      [ 7782.624248]  [<ffffffff811a2700>] SyS_fsync+0x10/0x14
      [ 7782.624248]  [<ffffffff81493617>] entry_SYSCALL_64_fastpath+0x12/0x6b
      [ 7782.624248] Code: 85 c0 0f 85 e2 02 00 00 48 8b 45 b0 31 f6 4c 29 e8 48 ff c0 48 89 45 a8 48 8d 83 d8 00 00 00 48 89 c7 48 89 45 a0 e8 fc 43 18 e1 <f0> 41 ff 84 24 44 05 00 00 48 8b 83 58 ff ff ff 48 c1 e8 07 83
      [ 7782.624248] RIP  [<ffffffffa030b7ab>] btrfs_sync_file+0x11b/0x3e9 [btrfs]
      [ 7782.624248]  RSP <ffff88013748be40>
      [ 7782.624248] CR2: 0000000000000544
      [ 7782.661994] ---[ end trace 721e14960eb939bc ]---
      
      This started happening since commit 4bacc9c9 (overlayfs: Make f_path
      always point to the overlay and f_inode to the underlay) and even though
      after this change we could still access the btrfs inode through
      struct file->f_mapping->host or struct file->f_inode, we would end up
      resulting in more similar issues later on at check_parent_dirs_for_sync()
      because the dentry we got (from struct file->f_path.dentry) was from
      overlayfs and not from btrfs, that is, we had no way of getting the dentry
      that belonged to btrfs (we always got the dentry that belonged to
      overlayfs).
      
      The new patch from Miklos Szeredi, titled "vfs: add file_dentry()" and
      recently submitted to linux-fsdevel, adds a file_dentry() API that allows
      us to get the btrfs dentry from the input file and therefore being able
      to fsync when the upper and lower directories belong to btrfs filesystems.
      
      This issue has been reported several times by users in the mailing list
      and bugzilla. A test case for xfstests is being submitted as well.
      
      Fixes: 4bacc9c9 ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay")
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=101951
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=109791Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      Cc: stable@vger.kernel.org
      de17e793
  2. 26 Mar, 2016 6 commits
    • Theodore Ts'o's avatar
      ext4 crypto: use dget_parent() in ext4_d_revalidate() · 3d43bcfe
      Theodore Ts'o authored
      This avoids potential problems caused by a race where the inode gets
      renamed out from its parent directory and the parent directory is
      deleted while ext4_d_revalidate() is running.
      
      Fixes: 28b4c263Reported-by: default avatarAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      3d43bcfe
    • Miklos Szeredi's avatar
      ext4: use file_dentry() · c0a37d48
      Miklos Szeredi authored
      EXT4 may be used as lower layer of overlayfs and accessing f_path.dentry
      can lead to a crash.
      
      Fix by replacing direct access of file->f_path.dentry with the
      file_dentry() accessor, which will always return a native object.
      Reported-by: default avatarDaniel Axtens <dja@axtens.net>
      Fixes: 4bacc9c9 ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay")
      Fixes: ff978b09 ("ext4 crypto: move context consistency check to ext4_file_open()")
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: <stable@vger.kernel.org> # v4.5
      c0a37d48
    • Miklos Szeredi's avatar
      ext4: use dget_parent() in ext4_file_open() · 9dd78d8c
      Miklos Szeredi authored
      In f_op->open() lock on parent is not held, so there's no guarantee that
      parent dentry won't go away at any time.
      
      Even after this patch there's no guarantee that 'dir' will stay the parent
      of 'inode', but at least it won't be freed while being used.
      
      Fixes: ff978b09 ("ext4 crypto: move context consistency check to ext4_file_open()")
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: <stable@vger.kernel.org> # v4.5
      9dd78d8c
    • Miklos Szeredi's avatar
      nfs: use file_dentry() · be62a1a8
      Miklos Szeredi authored
      NFS may be used as lower layer of overlayfs and accessing f_path.dentry can
      lead to a crash.
      
      Fix by replacing direct access of file->f_path.dentry with the
      file_dentry() accessor, which will always return a native object.
      
      Fixes: 4bacc9c9 ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay")
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      Tested-by: default avatarGoldwyn Rodrigues <rgoldwyn@suse.com>
      Acked-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: <stable@vger.kernel.org> # v4.2
      Cc: David Howells <dhowells@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      be62a1a8
    • Miklos Szeredi's avatar
      fs: add file_dentry() · d101a125
      Miklos Szeredi authored
      This series fixes bugs in nfs and ext4 due to 4bacc9c9 ("overlayfs:
      Make f_path always point to the overlay and f_inode to the underlay").
      
      Regular files opened on overlayfs will result in the file being opened on
      the underlying filesystem, while f_path points to the overlayfs
      mount/dentry.
      
      This confuses filesystems which get the dentry from struct file and assume
      it's theirs.
      
      Add a new helper, file_dentry() [*], to get the filesystem's own dentry
      from the file.  This checks file->f_path.dentry->d_flags against
      DCACHE_OP_REAL, and returns file->f_path.dentry if DCACHE_OP_REAL is not
      set (this is the common, non-overlayfs case).
      
      In the uncommon case it will call into overlayfs's ->d_real() to get the
      underlying dentry, matching file_inode(file).
      
      The reason we need to check against the inode is that if the file is copied
      up while being open, d_real() would return the upper dentry, while the open
      file comes from the lower dentry.
      
      [*] If possible, it's better simply to use file_inode() instead.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Tested-by: default avatarGoldwyn Rodrigues <rgoldwyn@suse.com>
      Reviewed-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Cc: <stable@vger.kernel.org> # v4.2
      Cc: David Howells <dhowells@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Daniel Axtens <dja@axtens.net>
      d101a125
    • Theodore Ts'o's avatar
      ext4 crypto: don't let data integrity writebacks fail with ENOMEM · c9af28fd
      Theodore Ts'o authored
      We don't want the writeback triggered from the journal commit (in
      data=writeback mode) to cause the journal to abort due to
      generic_writepages() returning an ENOMEM error.  In addition, if
      fsync() fails with ENOMEM, most applications will probably not do the
      right thing.
      
      So if we are doing a data integrity sync, and ext4_encrypt() returns
      ENOMEM, we will submit any queued I/O to date, and then retry the
      allocation using GFP_NOFAIL.
      
      Google-Bug-Id: 27641567
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      c9af28fd
  3. 22 Mar, 2016 12 commits
    • Theodore Ts'o's avatar
      ext4: check if in-inode xattr is corrupted in ext4_expand_extra_isize_ea() · 9e92f48c
      Theodore Ts'o authored
      We aren't checking to see if the in-inode extended attribute is
      corrupted before we try to expand the inode's extra isize fields.
      
      This can lead to potential crashes caused by the BUG_ON() check in
      ext4_xattr_shift_entries().
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      9e92f48c
    • Linus Torvalds's avatar
      Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs · 243d5067
      Linus Torvalds authored
      Pull overlayfs updates from Miklos Szeredi:
       "Various fixes and tweaks"
      
      * 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
        ovl: cleanup unused var in rename2
        ovl: rename is_merge to is_lowest
        ovl: fixed coding style warning
        ovl: Ensure upper filesystem supports d_type
        ovl: Warn on copy up if a process has a R/O fd open to the lower file
        ovl: honor flag MS_SILENT at mount
        ovl: verify upper dentry before unlink and rename
      243d5067
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse · 9f15dec8
      Linus Torvalds authored
      Pull fuse update from Miklos Szeredi:
       "This contains direct I/O fixes"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
        fuse: return patrial success from fuse_direct_io()
        fuse: Add reference counting for fuse_io_priv
        fuse: do not use iocb after it may have been freed
      9f15dec8
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.6-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 55fc733c
      Linus Torvalds authored
      Pull xen updates from David Vrabel:
       "Features and fixes for 4.6:
      
        - Make earlyprintk=xen work for HVM guests
      
        - Remove module support for things never built as modules"
      
      * tag 'for-linus-4.6-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        drivers/xen: make platform-pci.c explicitly non-modular
        drivers/xen: make sys-hypervisor.c explicitly non-modular
        drivers/xen: make xenbus_dev_[front/back]end explicitly non-modular
        drivers/xen: make [xen-]ballon explicitly non-modular
        xen: audit usages of module.h ; remove unnecessary instances
        xen/x86: Drop mode-selecting ifdefs in startup_xen()
        xen/x86: Zero out .bss for PV guests
        hvc_xen: make early_printk work with HVM guests
        hvc_xen: fix xenboot for DomUs
        hvc_xen: add earlycon support
      55fc733c
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · b8524959
      Linus Torvalds authored
      Pull i2c updates from Wolfram Sang:
       "Mostly usual driver updates and improvements.  The changelog should
        give an idea.  Standing out is the i2c-qup driver with lots of new
        capabilities and we also have now an i2c-demuxer.
      
        I'd especially like to welcome Peter Rosin as the i2c-mux maintainer.
        He has an interesting series for muxes in the queue and agreed to look
        after this part of the subsystem.  Thank you, Peter, and welcome
        again!
      
        The octeon changes were applied pretty recently before the merge
        window.  I am aware.  They are the first (and relatively simple)
        patches of a larger overhaul to this driver.  In case something goes
        wrong with them, they are easy to fix (or revert).  The advantage I
        see is that they are out of the way, and I can concentrate on the next
        block of patches.  I really would like to apply the overhaul in
        smaller batches to avoid regressions.  And waiting a cycle for the
        introductory patches seemed too much of a delay for me"
      
      * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (39 commits)
        i2c: octeon: Support I2C_M_RECV_LEN
        i2c: octeon: Cleanup resource allocation code
        i2c: octeon: Cleanup i2c-octeon driver
        MAINTAINERS: add Peter Rosin as i2c mux maintainer
        dt-bindings: i2c: Spelling s/propoerty/property/
        i2c: immediately mark ourselves as registered
        i2c: i801: sort IDs alphabetically
        MAINTAINERS: Mika and me are designated reviewers for I2C DESIGNWARE
        i2c: octeon: Cleanup kerneldoc comments
        i2c: do not use internal data from driver core
        i2c: cadence: Fix the kernel-doc warnings
        i2c: imx: remove extra spaces.
        i2c: rcar: don't open code of_device_get_match_data()
        i2c: qup: Fix fifo handling after adding V2 support
        i2c: xiic: Implement power management
        i2c: piix4: Pre-shift the port number
        i2c: piix4: Always use the same type for port
        i2c: piix4: Support alternative port selection register
        i2c: tegra: don't open code of_device_get_match_data()
        i2c: riic, sh_mobile, rcar: Use ARCH_RENESAS
        ...
      b8524959
    • Linus Torvalds's avatar
      Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · 5266e5b1
      Linus Torvalds authored
      Pull SCSI target updates from Nicholas Bellinger:
       "The highlights this round include:
      
         - Add target_alloc_session() w/ callback helper for doing se_session
           allocation + tag + se_node_acl lookup.  (HCH + nab)
      
         - Tree-wide fabric driver conversion to use target_alloc_session()
      
         - Convert sbp-target to use percpu_ida tag pre-allocation, and
           TARGET_SCF_ACK_KREF I/O krefs (Chris Boot + nab)
      
         - Convert usb-gadget to use percpu_ida tag pre-allocation, and
           TARGET_SCF_ACK_KREF I/O krefs (Andrzej Pietrasiewicz + nab)
      
         - Convert xen-scsiback to use percpu_ida tag pre-allocation, and
           TARGET_SCF_ACK_KREF I/O krefs (Juergen Gross + nab)
      
         - Convert tcm_fc to use TARGET_SCF_ACK_KREF I/O + TMR krefs
      
         - Convert ib_srpt to use percpu_ida tag pre-allocation
      
         - Add DebugFS node for qla2xxx target sess list (Quinn)
      
         - Rework iser-target connection termination (Jenny + Sagi)
      
         - Convert iser-target to new CQ API (HCH)
      
         - Add pass-through WRITE_SAME support for IBLOCK (Mike Christie)
      
         - Introduce data_bitmap for asynchronous access of data area (Sheng
           Yang + Andy)
      
         - Fix target_release_cmd_kref shutdown comp leak (Himanshu Madhani)
      
        Also, there is a separate PULL request coming for cxgb4 NIC driver
        prerequisites for supporting hw iscsi segmentation offload (ISO), that
        will be the base for a number of v4.7 developments involving
        iscsi-target hw offloads"
      
      * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (36 commits)
        target: Fix target_release_cmd_kref shutdown comp leak
        target: Avoid DataIN transfers for non-GOOD SAM status
        target/user: Report capability of handling out-of-order completions to userspace
        target/user: Fix size_t format-spec build warning
        target/user: Don't free expired command when time out
        target/user: Introduce data_bitmap, replace data_length/data_head/data_tail
        target/user: Free data ring in unified function
        target/user: Use iovec[] to describe continuous area
        target: Remove enum transport_lunflags_table
        target/iblock: pass WRITE_SAME to device if possible
        iser-target: Kill the ->isert_cmd back pointer in struct iser_tx_desc
        iser-target: Kill struct isert_rdma_wr
        iser-target: Convert to new CQ API
        iser-target: Split and properly type the login buffer
        iser-target: Remove ISER_RECV_DATA_SEG_LEN
        iser-target: Remove impossible condition from isert_wait_conn
        iser-target: Remove redundant wait in release_conn
        iser-target: Rework connection termination
        iser-target: Separate flows for np listeners and connections cma events
        iser-target: Add new state ISER_CONN_BOUND to isert_conn
        ...
      5266e5b1
    • Linus Torvalds's avatar
      Merge tag 'pci-v4.6-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · fc739eba
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
       "Here are two fixes for v4.6:
      
         - You merged a fix for a TI DRA7xx reset issue from another source,
           so Sekhar removed the "broken" tag from the driver, and
      
         - I botched a Kconfig merge and broke hotplug configuration for
           everybody, so Tero fixed that.
      
        Summary:
      
        TI DRA7xx host bridge driver:
          Revert "PCI: dra7xx: Mark driver as broken" (Sekhar Nori)
      
        Miscellaneous:
          Restore inclusion of pci/hotplug Kconfig (Tero Roponen)"
      
      * tag 'pci-v4.6-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        Revert "PCI: dra7xx: Mark driver as broken"
        PCI: Restore inclusion of pci/hotplug Kconfig
      fc739eba
    • Linus Torvalds's avatar
      Merge tag 'sound-fix-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 87cf815b
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "The previous pull request introduced a few WARN_ON() for Intel
        HD-audio HDMI.  Indeed it caught bugs, and now users get annoyed.  So
        this request came up: a collection of small fixes to paper over the
        inconsistencies on (mostly) old Intel chipsets.
      
        In addition, a trivial USB-audio quirk is included, too"
      
      * tag 'sound-fix-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda - Fix missing ELD update at unplugging
        ALSA: usb-audio: add Microsoft HD-5001 to quirks
        ALSA: hda - Workaround for unbalanced i915 power refcount by concurrent probe
        ALSA: hda - Fix spurious kernel WARNING on Baytrail HDMI
        ALSA: hda - Fix forgotten HDMI monitor_present update
        ALSA: hda - Really restrict i915 notifier to HSW+
      87cf815b
    • Linus Torvalds's avatar
      Merge tag 'iommu-updates-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · b4af7f77
      Linus Torvalds authored
      Pull IOMMU updates from Joerg Roedel:
      
       - updates for the Exynos IOMMU driver to make use of default domains
         and to add support for the SYSMMU v5
      
       - new Mediatek IOMMU driver
      
       - support for the ARMv7 short descriptor format in the io-pgtable code
      
       - default domain support for the ARM SMMU
      
       - couple of other small fixes all over the place
      
      * tag 'iommu-updates-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (41 commits)
        iommu/ipmmu-vmsa: Add r8a7795 DT binding
        iommu/mediatek: Check for NULL instead of IS_ERR()
        iommu/io-pgtable-armv7s: Fix kmem_cache_alloc() flags
        iommu/mediatek: Fix handling of of_count_phandle_with_args result
        iommu/dma: Fix NEED_SG_DMA_LENGTH dependency
        iommu/mediatek: Mark PM functions as __maybe_unused
        iommu/mediatek: Select ARM_DMA_USE_IOMMU
        iommu/exynos: Use proper readl/writel register interface
        iommu/exynos: Pointers are nto physical addresses
        dts: mt8173: Add iommu/smi nodes for mt8173
        iommu/mediatek: Add mt8173 IOMMU driver
        memory: mediatek: Add SMI driver
        dt-bindings: mediatek: Add smi dts binding
        dt-bindings: iommu: Add binding for mediatek IOMMU
        iommu/ipmmu-vmsa: Use ARCH_RENESAS
        iommu/exynos: Support multiple attach_device calls
        iommu/exynos: Add Maintainers entry for Exynos SYSMMU driver
        iommu/exynos: Add support for v5 SYSMMU
        iommu/exynos: Update device tree documentation
        iommu/exynos: Add support for SYSMMU controller with bogus version reg
        ...
      b4af7f77
    • Sekhar Nori's avatar
      Revert "PCI: dra7xx: Mark driver as broken" · 9188269a
      Sekhar Nori authored
      Revert 5c3b99d0 ("PCI: dra7xx: Mark driver as broken").
      
      1c96bee4 ("ARM: DRA7: hwmod: Add custom reset handler for PCIeSS")
      added support to de-assert PCIe reset, so DRA7x PCIe is not broken anymore.
      Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      9188269a
    • Himanshu Madhani's avatar
      target: Fix target_release_cmd_kref shutdown comp leak · 5e47f198
      Himanshu Madhani authored
      This patch fixes an active I/O shutdown bug for fabric
      drivers using target_wait_for_sess_cmds(), where se_cmd
      descriptor shutdown would result in hung tasks waiting
      indefinitely for se_cmd->cmd_wait_comp to complete().
      
      To address this bug, drop the incorrect list_del_init()
      usage in target_wait_for_sess_cmds() and always complete()
      during se_cmd target_release_cmd_kref() put, in order to
      let caller invoke the final fabric release callback
      into se_cmd->se_tfo->release_cmd() code.
      Reported-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
      Tested-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
      Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      5e47f198
    • Linus Torvalds's avatar
      Merge branch 'for-linus-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 968f3e37
      Linus Torvalds authored
      Pull btrfs updates from Chris Mason:
       "We have a good sized cleanup of our internal read ahead code, and the
        first series of commits from Chandan to enable PAGE_SIZE > sectorsize
      
        Otherwise, it's a normal series of cleanups and fixes, with many
        thanks to Dave Sterba for doing most of the patch wrangling this time"
      
      * 'for-linus-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (82 commits)
        btrfs: make sure we stay inside the bvec during __btrfs_lookup_bio_sums
        btrfs: Fix misspellings in comments.
        btrfs: Print Warning only if ENOSPC_DEBUG is enabled
        btrfs: scrub: silence an uninitialized variable warning
        btrfs: move btrfs_compression_type to compression.h
        btrfs: rename btrfs_print_info to btrfs_print_mod_info
        Btrfs: Show a warning message if one of objectid reaches its highest value
        Documentation: btrfs: remove usage specific information
        btrfs: use kbasename in btrfsic_mount
        Btrfs: do not collect ordered extents when logging that inode exists
        Btrfs: fix race when checking if we can skip fsync'ing an inode
        Btrfs: fix listxattrs not listing all xattrs packed in the same item
        Btrfs: fix deadlock between direct IO reads and buffered writes
        Btrfs: fix extent_same allowing destination offset beyond i_size
        Btrfs: fix file loss on log replay after renaming a file and fsync
        Btrfs: fix unreplayable log after snapshot delete + parent dir fsync
        Btrfs: fix lockdep deadlock warning due to dev_replace
        btrfs: drop unused argument in btrfs_ioctl_get_supported_features
        btrfs: add GET_SUPPORTED_FEATURES to the control device ioctls
        btrfs: change max_inline default to 2048
        ...
      968f3e37
  4. 21 Mar, 2016 21 commits
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.6' of git://git.linaro.org/people/ulf.hansson/mmc · e531cdf5
      Linus Torvalds authored
      Pull MMC updates from Ulf Hansson:
       "MMC core:
            - Fix ABI regression of MMC BLK ioctl
            - Remove the unused MMC_DATA_STREAM flag
            - Enable asynchronous system PM for the host device
            - Minor fixes and clean-ups
      
        SDHCI host:
           Throughout the years, the numbers of SDHCI variants have increased
           and so has also the numbers of SDHCI callbacks/quirks.  The purpose
           of these callbacks/quirks were to enable SDHCI to deal with variant
           specific requirements, but unfortunate this method didn't scale.
           Instead we have ended up with a mess.  Not only did the code become
           suboptimal but also highly fragile.
      
           Lately many discussions of how to move forward with SDHCI has taken
           place at the MMC mailing list.  Step by step, we aim to turn
           SDHCI's common code into a set of library functions.  This will
           enable for optimizations and allow some of the existing callbacks
           and quirks to be removed, which also should help to make the code
           less fragile.
      
           Therefore I am also really pleased to announce that Adrian Hunter
           (Intel) has volunteered to step in as the maintainer for SDHCI.
      
           Future wise, I hope the community around SDHCI will continue to
           grow and that this release cycle can be the starting point of
           moving SDHCI into a better shape.  As a matter of fact, already in
           this cycle the re-factoring has begun, but of course there are also
           fixes and new features included.  Some highlights:
      
            - sdhci-iproc: Add support for Broadcom's BCM2835 eMMC IP
            - sdhci-acpi: Add support for QCOM controllers
            - sdhci-pic32: Add new SDHCI variant for PIC32MZDA
      
        Other hosts:
            - atmel-mci: Fix a NULL pointer dereference
            - mediatek: Add SD write-protect support
            - mmc_spi: Fix card detect in GPIO case
            - tmio/sdhi: Add r8a7795 support
            - tmio/sdhi: Some fixes and clean-ups
            - dw_mmc: Add HW reset support
            - dw_mmc: Some fixes and clean-ups
            - sunxi: Add support for MMC DDR52 mode"
      
      * tag 'mmc-v4.6' of git://git.linaro.org/people/ulf.hansson/mmc: (123 commits)
        mmc: sdhci-of-at91: fix wake-up issue when using runtime pm
        mmc: sdhci-pci: Do not set DMA mask in enable_dma()
        mmc: sdhci-acpi: Remove enable_dma() hook
        mmc: sdhci: Set DMA mask when adding host
        mmc: block: fix ABI regression of mmc_blk_ioctl
        mmc: atmel-mci: Check pdata for NULL before dereferencing it at DMA config
        mmc: core: remove redundant memset of sdio_read_cccr
        mmc: core: remove redundant memset of mmc_decode_cid
        mmc: of_mmc_spi: fix unused warning
        mmc: sdhci-of-arasan: add phy support for sdhci-of-arasan
        mmc: sdhci-of-arasan: fix missing sdhci_pltfm_free for err handling
        mmc: sdhci-of-arasan: remove disable clk_ahb from sdhci_arasan_resume
        Documentation: bindings: add description of phy for sdhci-of-arasan
        mmc: sdhci: Fix override of timeout clk wrt max_busy_timeout
        mmc: mmci: Remove unnecessary header file
        mmc: sdhci-acpi: add QCOM controllers
        mmc: tegra: implement memcomp pad calibration
        mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
        mmc: mediatek: Change signal voltage error to dev_dbg()
        mmc: sh_mmcif, tmio: Use ARCH_RENESAS
        ...
      e531cdf5
    • Linus Torvalds's avatar
      Merge tag 'md/4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md · 4526b710
      Linus Torvalds authored
      Pull MD updates from Shaohua Li:
       "This update mainly fixes bugs.
      
         - a raid5 discard related fix from Jes
         - a MD multipath bio clone fix from Ming
         - raid1 error handling deadlock fix from Nate and corresponding
           raid10 fix from myself
         - a raid5 stripe batch fix from Neil
         - a patch from Sebastian to avoid unnecessary uevent
         - several cleanup/debug patches"
      
      * tag 'md/4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md:
        md/raid5: Cleanup cpu hotplug notifier
        raid10: include bio_end_io_list in nr_queued to prevent freeze_array hang
        raid1: include bio_end_io_list in nr_queued to prevent freeze_array hang
        md: fix typos for stipe
        md/bitmap: remove redundant return in bitmap_checkpage
        md/raid1: remove unnecessary BUG_ON
        md: multipath: don't hardcopy bio in .make_request path
        md/raid5: output stripe state for debug
        md/raid5: preserve STRIPE_PREREAD_ACTIVE in break_stripe_batch_list
        Update MD git tree URL
        md/bitmap: remove redundant check
        MD: warn for potential deadlock
        md: Drop sending a change uevent when stopping
        RAID5: revert e9e4c377 to fix a livelock
        RAID5: check_reshape() shouldn't call mddev_suspend
        md/raid5: Compare apples to apples (or sectors to sectors)
      4526b710
    • Linus Torvalds's avatar
      [media] vsp1: use proper dma alloc/free functions · 770c4c11
      Linus Torvalds authored
      I noticed this while merging the drm tree and checking for stragglers:
      the vsp1 driver still used dma_[alloc|free]_writecombine() that got
      renamed in commit f6e45661 ("dma, mm/pat: Rename
      dma_*_writecombine() to dma_*_wc()")
      
      I should have noticed back in the media merge (commit bace3db5), but
      better late than never.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      770c4c11
    • Linus Torvalds's avatar
      Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux · 266c73b7
      Linus Torvalds authored
      Pull drm updates from Dave Airlie:
       "This is the main drm pull request for 4.6 kernel.
      
        Overall the coolest thing here for me is the nouveau maxwell signed
        firmware support from NVidia, it's taken a long while to extract this
        from them.
      
        I also wish the ARM vendors just designed one set of display IP, ARM
        display block proliferation is definitely increasing.
      
        Core:
           - drm_event cleanups
           - Internal API cleanup making mode_fixup optional.
           - Apple GMUX vga switcheroo support.
           - DP AUX testing interface
      
        Panel:
           - Refactoring of DSI core for use over more transports.
      
        New driver:
           - ARM hdlcd driver
      
        i915:
           - FBC/PSR (framebuffer compression, panel self refresh) enabled by default.
           - Ongoing atomic display support work
           - Ongoing runtime PM work
           - Pixel clock limit checks
           - VBT DSI description support
           - GEM fixes
           - GuC firmware scheduler enhancements
      
        amdkfd:
           - Deferred probing fixes to avoid make file or link ordering.
      
        amdgpu/radeon:
           - ACP support for i2s audio support.
           - Command Submission/GPU scheduler/GPUVM optimisations
           - Initial GPU reset support for amdgpu
      
        vmwgfx:
           - Support for DX10 gen mipmaps
           - Pageflipping and other fixes.
      
        exynos:
           - Exynos5420 SoC support for FIMD
           - Exynos5422 SoC support for MIPI-DSI
      
        nouveau:
           - GM20x secure boot support - adds acceleration for Maxwell GPUs.
           - GM200 support
           - GM20B clock driver support
           - Power sensors work
      
        etnaviv:
           - Correctness fixes for GPU cache flushing
           - Better support for i.MX6 systems.
      
        imx-drm:
           - VBlank IRQ support
           - Fence support
           - OF endpoint support
      
        msm:
           - HDMI support for 8996 (snapdragon 820)
           - Adreno 430 support
           - Timestamp queries support
      
        virtio-gpu:
           - Fixes for Android support.
      
        rockchip:
           - Add support for Innosilicion HDMI
      
        rcar-du:
           - Support for 4 crtcs
           - R8A7795 support
           - RCar Gen 3 support
      
        omapdrm:
           - HDMI interlace output support
           - dma-buf import support
           - Refactoring to remove a lot of legacy code.
      
        tilcdc:
           - Rewrite of pageflipping code
           - dma-buf support
           - pinctrl support
      
        vc4:
           - HDMI modesetting bug fixes
           - Significant 3D performance improvement.
      
        fsl-dcu (FreeScale):
           - Lots of fixes
      
        tegra:
           - Two small fixes
      
        sti:
           - Atomic support for planes
           - Improved HDMI support"
      
      * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (1063 commits)
        drm/amdgpu: release_pages requires linux/pagemap.h
        drm/sti: restore mode_fixup callback
        drm/amdgpu/gfx7: add MTYPE definition
        drm/amdgpu: removing BO_VAs shouldn't be interruptible
        drm/amd/powerplay: show uvd/vce power gate enablement for tonga.
        drm/amd/powerplay: show uvd/vce power gate info for fiji
        drm/amdgpu: use sched fence if possible
        drm/amdgpu: move ib.fence to job.fence
        drm/amdgpu: give a fence param to ib_free
        drm/amdgpu: include the right version of gmc header files for iceland
        drm/radeon: fix indentation.
        drm/amd/powerplay: add uvd/vce dpm enabling flag to fix the performance issue for CZ
        drm/amdgpu: switch back to 32bit hw fences v2
        drm/amdgpu: remove amdgpu_fence_is_signaled
        drm/amdgpu: drop the extra fence range check v2
        drm/amdgpu: signal fences directly in amdgpu_fence_process
        drm/amdgpu: cleanup amdgpu_fence_wait_empty v2
        drm/amdgpu: keep all fences in an RCU protected array v2
        drm/amdgpu: add number of hardware submissions to amdgpu_fence_driver_init_ring
        drm/amdgpu: RCU protected amd_sched_fence_release
        ...
      266c73b7
    • Linus Torvalds's avatar
      Merge tag 'arm64-perf' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 2c856e14
      Linus Torvalds authored
      Pull arm[64] perf updates from Will Deacon:
       "I have another mixed bag of ARM-related perf patches here.
      
        It's about 25% CPU and 75% interconnect, but with drivers/bus/
        languishing without an obvious maintainer or tree, Olof and I agreed
        to keep all of these PMU patches together.  I suspect a whole load of
        code from drivers/bus/arm-* can be moved under drivers/perf/, so
        that's on the radar for the future.
      
        Summary:
      
         - Initial support for ARMv8.1 CPU PMUs
      
         - Support for the CPU PMU in Cavium ThunderX
      
         - CPU PMU support for systems running 32-bit Linux in secure mode
      
         - Support for the system PMU in ARM CCI-550 (Cache Coherent Interconnect)"
      
      * tag 'arm64-perf' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (26 commits)
        drivers/perf: arm_pmu: avoid NULL dereference when not using devicetree
        arm64: perf: Extend ARMV8_EVTYPE_MASK to include PMCR.LC
        arm-cci: remove unused variable
        arm-cci: don't return value from void function
        arm-cci: make private functions static
        arm-cci: CoreLink CCI-550 PMU driver
        arm-cci500: Rearrange PMU driver for code sharing with CCI-550 PMU
        arm-cci: CCI-500: Work around PMU counter writes
        arm-cci: Provide hook for writing to PMU counters
        arm-cci: Add helper to enable PMU without synchornising counters
        arm-cci: Add routines to save/restore all counters
        arm-cci: Get the status of a counter
        arm-cci: write_counter: Remove redundant check
        arm-cci: Delay PMU counter writes to pmu::pmu_enable
        arm-cci: Refactor CCI PMU enable/disable methods
        arm-cci: Group writes to counter
        arm-cci: fix handling cpumask_any_but return value
        arm-cci: simplify sysfs attr handling
        drivers/perf: arm_pmu: implement CPU_PM notifier
        arm64: dts: Add Cavium ThunderX specific PMU
        ...
      2c856e14
    • Linus Torvalds's avatar
      Merge tag 'arc-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc · d34687ab
      Linus Torvalds authored
      Pull ARC architecture updates from Vineet Gupta:
       - Big Endian io accessors fix [Lada]
       - Spellos fixes [Adam]
       - Fix for DW GMAC breakage [Alexey]
       - Making DMA API 64-bit ready
       - Shutting up -Wmaybe-uninitialized noise for ARC
       - Other minor fixes here and there, comments update
      
      * tag 'arc-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: (21 commits)
        ARCv2: ioremap: Support dynamic peripheral address space
        ARC: dma: reintroduce platform specific dma<->phys
        ARC: dma: ioremap: use phys_addr_t consistenctly in code paths
        ARC: dma: pass_phys() not sg_virt() to cache ops
        ARC: dma: non-coherent pages need V-P mapping if in HIGHMEM
        ARC: dma: Use struct page based page allocator helpers
        ARC: build: Turn off -Wmaybe-uninitialized for ARC gcc 4.8
        ARC: [plat-axs10x] add Ethernet PHY description in .dts
        arc: use of_platform_default_populate() to populate default bus
        ARC: thp: unbork !CONFIG_TRANSPARENT_HUGEPAGE build
        arc: [plat-nsimosci*] use ezchip network driver
        ARCv2: LLSC: software backoff is NOT needed starting HS2.1c
        ARC: mm: Use virt_to_pfn() for addr >> PAGE_SHIFT pattern
        ARC: [plat-nsim] document ranges
        ARC: build: Better way to detect ISA compatible toolchain
        ARCv2: Allow enabling PAE40 w/o HIGHMEM
        ARC: [BE] readl()/writel() to work in Big Endian CPU configuration
        ARC: [*defconfig] No need to specify CONFIG_CROSS_COMPILE
        ARC: [BE] Select correct CROSS_COMPILE prefix
        ARC: bitops: Remove non relevant comments
        ...
      d34687ab
    • Linus Torvalds's avatar
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 77d91317
      Linus Torvalds authored
      Pull UDF and quota updates from Jan Kara:
       "This contains a rewrite of UDF handling of filename encoding to fix
        remaining overflow issues from Andrew Gabbasov and quota changes to
        support new Q_[X]GETNEXTQUOTA quotactl for VFS quota formats"
      
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        quota: Fix possible GPF due to uninitialised pointers
        ext4: Make Q_GETNEXTQUOTA work for quota in hidden inodes
        quota: Forbid Q_GETQUOTA and Q_GETNEXTQUOTA for frozen filesystem
        quota: Fix possible races during quota loading
        ocfs2: Implement get_next_id()
        quota_v2: Implement get_next_id() for V2 quota format
        quota: Add support for ->get_nextdqblk() for VFS quota
        udf: Merge linux specific translation into CS0 conversion function
        udf: Remove struct ustr as non-needed intermediate storage
        udf: Use separate buffer for copying split names
        udf: Adjust UDF_NAME_LEN to better reflect actual restrictions
        udf: Join functions for UTF8 and NLS conversions
        udf: Parameterize output length in udf_put_filename
        quota: Allow Q_GETQUOTA for frozen filesystem
        quota: Fixup comments about return value of Q_[X]GETNEXTQUOTA
      77d91317
    • Linus Torvalds's avatar
      Merge tag 'xfs-for-linus-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs · 53d2e697
      Linus Torvalds authored
      Pull xfs updates from Dave Chinner:
       "There's quite a lot in this request, and there's some cross-over with
        ext4, dax and quota code due to the nature of the changes being made.
      
        As for the rest of the XFS changes, there are lots of little things
        all over the place, which add up to a lot of changes in the end.
      
        The major changes are that we've reduced the size of the struct
        xfs_inode by ~100 bytes (gives an inode cache footprint reduction of
        >10%), the writepage code now only does a single set of mapping tree
        lockups so uses less CPU, delayed allocation reservations won't
        overrun under random write loads anymore, and we added compile time
        verification for on-disk structure sizes so we find out when a commit
        or platform/compiler change breaks the on disk structure as early as
        possible.
      
        Change summary:
      
         - error propagation for direct IO failures fixes for both XFS and
           ext4
         - new quota interfaces and XFS implementation for iterating all the
           quota IDs in the filesystem
         - locking fixes for real-time device extent allocation
         - reduction of duplicate information in the xfs and vfs inode, saving
           roughly 100 bytes of memory per cached inode.
         - buffer flag cleanup
         - rework of the writepage code to use the generic write clustering
           mechanisms
         - several fixes for inode flag based DAX enablement
         - rework of remount option parsing
         - compile time verification of on-disk format structure sizes
         - delayed allocation reservation overrun fixes
         - lots of little error handling fixes
         - small memory leak fixes
         - enable xfsaild freezing again"
      
      * tag 'xfs-for-linus-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs: (66 commits)
        xfs: always set rvalp in xfs_dir2_node_trim_free
        xfs: ensure committed is initialized in xfs_trans_roll
        xfs: borrow indirect blocks from freed extent when available
        xfs: refactor delalloc indlen reservation split into helper
        xfs: update freeblocks counter after extent deletion
        xfs: debug mode forced buffered write failure
        xfs: remove impossible condition
        xfs: check sizes of XFS on-disk structures at compile time
        xfs: ioends require logically contiguous file offsets
        xfs: use named array initializers for log item dumping
        xfs: fix computation of inode btree maxlevels
        xfs: reinitialise per-AG structures if geometry changes during recovery
        xfs: remove xfs_trans_get_block_res
        xfs: fix up inode32/64 (re)mount handling
        xfs: fix format specifier , should be %llx and not %llu
        xfs: sanitize remount options
        xfs: convert mount option parsing to tokens
        xfs: fix two memory leaks in xfs_attr_list.c error paths
        xfs: XFS_DIFLAG2_DAX limited by PAGE_SIZE
        xfs: dynamically switch modes when XFS_DIFLAG2_DAX is set/cleared
        ...
      53d2e697
    • Linus Torvalds's avatar
      Merge tag 'for-f2fs-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs · d407574e
      Linus Torvalds authored
      Pull f2fs updates from Jaegeuk Kim:
       "New Features:
         - uplift filesystem encryption into fs/crypto/
         - give sysfs entries to control memroy consumption
      
        Enhancements:
         - aio performance by preallocating blocks in ->write_iter
         - use writepages lock for only WB_SYNC_ALL
         - avoid redundant inline_data conversion
         - enhance forground GC
         - use wait_for_stable_page as possible
         - speed up SEEK_DATA and fiiemap
      
        Bug Fixes:
         - corner case in terms of -ENOSPC for inline_data
         - hung task caused by long latency in shrinker
         - corruption between atomic write and f2fs_trace_pid
         - avoid garbage lengths in dentries
         - revoke atomicly written pages if an error occurs
      
        In addition, there are various minor bug fixes and clean-ups"
      
      * tag 'for-f2fs-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (81 commits)
        f2fs: submit node page write bios when really required
        f2fs: add missing argument to f2fs_setxattr stub
        f2fs: fix to avoid unneeded unlock_new_inode
        f2fs: clean up opened code with f2fs_update_dentry
        f2fs: declare static functions
        f2fs: use cryptoapi crc32 functions
        f2fs: modify the readahead method in ra_node_page()
        f2fs crypto: sync ext4_lookup and ext4_file_open
        fs crypto: move per-file encryption from f2fs tree to fs/crypto
        f2fs: mutex can't be used by down_write_nest_lock()
        f2fs: recovery missing dot dentries in root directory
        f2fs: fix to avoid deadlock when merging inline data
        f2fs: introduce f2fs_flush_merged_bios for cleanup
        f2fs: introduce f2fs_update_data_blkaddr for cleanup
        f2fs crypto: fix incorrect positioning for GCing encrypted data page
        f2fs: fix incorrect upper bound when iterating inode mapping tree
        f2fs: avoid hungtask problem caused by losing wake_up
        f2fs: trace old block address for CoWed page
        f2fs: try to flush inode after merging inline data
        f2fs: show more info about superblock recovery
        ...
      d407574e
    • Linus Torvalds's avatar
      Merge branch 'for-4.6-ns' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · 5518f66b
      Linus Torvalds authored
      Pull cgroup namespace support from Tejun Heo:
       "These are changes to implement namespace support for cgroup which has
        been pending for quite some time now.  It is very straight-forward and
        only affects what part of cgroup hierarchies are visible.
      
        After unsharing, mounting a cgroup fs will be scoped to the cgroups
        the task belonged to at the time of unsharing and the cgroup paths
        exposed to userland would be adjusted accordingly"
      
      * 'for-4.6-ns' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
        cgroup: fix and restructure error handling in copy_cgroup_ns()
        cgroup: fix alloc_cgroup_ns() error handling in copy_cgroup_ns()
        Add FS_USERNS_FLAG to cgroup fs
        cgroup: Add documentation for cgroup namespaces
        cgroup: mount cgroupns-root when inside non-init cgroupns
        kernfs: define kernfs_node_dentry
        cgroup: cgroup namespace setns support
        cgroup: introduce cgroup namespaces
        sched: new clone flag CLONE_NEWCGROUP for cgroup namespace
        kernfs: Add API to generate relative kernfs path
      5518f66b
    • Miklos Szeredi's avatar
      ovl: cleanup unused var in rename2 · 6986c012
      Miklos Szeredi authored
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      6986c012
    • Miklos Szeredi's avatar
      ovl: rename is_merge to is_lowest · 56656e96
      Miklos Szeredi authored
      The 'is_merge' is an historical naming from when only a single lower layer
      could exist.  With the introduction of multiple lower layers the meaning of
      this flag was changed to mean only the "lowest layer" (while all lower
      layers were being merged).
      
      So now 'is_merge' is inaccurate and hence renaming to 'is_lowest'
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      56656e96
    • Sohom Bhattacharjee's avatar
      ovl: fixed coding style warning · f134f244
      Sohom Bhattacharjee authored
      This patch fixes a newline warning found by the checkpatch.pl tool
      Signed-off-by: default avatarSohom-Bhattacharjee <soham.bhattacharjee15@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      f134f244
    • Vivek Goyal's avatar
      ovl: Ensure upper filesystem supports d_type · 45aebeaf
      Vivek Goyal authored
      In some instances xfs has been created with ftype=0 and there if a file
      on lower fs is removed, overlay leaves a whiteout in upper fs but that
      whiteout does not get filtered out and is visible to overlayfs users.
      
      And reason it does not get filtered out because upper filesystem does
      not report file type of whiteout as DT_CHR during iterate_dir().
      
      So it seems to be a requirement that upper filesystem support d_type for
      overlayfs to work properly. Do this check during mount and fail if d_type
      is not supported.
      Suggested-by: default avatarDave Chinner <dchinner@redhat.com>
      Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      45aebeaf
    • David Howells's avatar
      ovl: Warn on copy up if a process has a R/O fd open to the lower file · fb5bb2c3
      David Howells authored
      Print a warning when overlayfs copies up a file if the process that
      triggered the copy up has a R/O fd open to the lower file being copied up.
      
      This can help catch applications that do things like the following:
      
      	fd1 = open("foo", O_RDONLY);
      	fd2 = open("foo", O_RDWR);
      
      where they expect fd1 and fd2 to refer to the same file - which will no
      longer be the case post-copy up.
      
      With this patch, the following commands:
      
      	bash 5</mnt/a/foo128
      	6<>/mnt/a/foo128
      
      assuming /mnt/a/foo128 to be an un-copied up file on an overlay will
      produce the following warning in the kernel log:
      
      	overlayfs: Copying up foo129, but open R/O on fd 5 which will cease
      	to be coherent [pid=3818 bash]
      
      This is enabled by setting:
      
      	/sys/module/overlay/parameters/check_copy_up
      
      to 1.
      
      The warnings are ratelimited and are also limited to one warning per file -
      assuming the copy up completes in each case.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      fb5bb2c3
    • Konstantin Khlebnikov's avatar
      ovl: honor flag MS_SILENT at mount · 07f2af7b
      Konstantin Khlebnikov authored
      This patch hides error about missing lowerdir if MS_SILENT is set.
      
      We use mount(NULL, "/", "overlay", MS_SILENT, NULL) for testing support of
      overlayfs: syscall returns -ENODEV if it's not supported. Otherwise kernel
      automatically loads module and returns -EINVAL because lowerdir is missing.
      Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      07f2af7b
    • Miklos Szeredi's avatar
      ovl: verify upper dentry before unlink and rename · 11f37104
      Miklos Szeredi authored
      Unlink and rename in overlayfs checked the upper dentry for staleness by
      verifying upper->d_parent against upperdir.  However the dentry can go
      stale also by being unhashed, for example.
      
      Expand the verification to actually look up the name again (under parent
      lock) and check if it matches the upper dentry.  This matches what the VFS
      does before passing the dentry to filesytem's unlink/rename methods, which
      excludes any inconsistency caused by overlayfs.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      11f37104
    • Takashi Iwai's avatar
      ALSA: hda - Fix missing ELD update at unplugging · c64c1437
      Takashi Iwai authored
      i915 get_eld ops may return an error when no encoder is connected, and
      currently we regard the error as fatal and skip the whole ELD
      handling.  This ended up with the missing ELD update at unplugging.
      
      This patch fixes the issue by treating the error as the unplugged
      state, instead of skipping the rest.
      Reported-by: default avatarLibin Yang <libin.yang@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.5
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      c64c1437
    • Paul Gortmaker's avatar
      drivers/xen: make platform-pci.c explicitly non-modular · e01dc539
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      arch/x86/xen/Kconfig:config XEN_PVHVM
      arch/x86/xen/Kconfig:   def_bool y
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      Since module_init translates to device_initcall in the non-modular
      case, the init ordering remains unchanged with this commit.
      
      Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      was (or is now) contained at the top of the file in the comments.
      
      In removing "module" from the init fcn name, we observe a namespace
      collision with the probe function, so we use "probe" in the name of
      the probe function, and "init" in the registration fcn, as per
      standard convention, as suggested by Stefano.
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Reviewed-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      e01dc539
    • Paul Gortmaker's avatar
      drivers/xen: make sys-hypervisor.c explicitly non-modular · 46894f17
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      config XEN_SYS_HYPERVISOR
             bool "Create xen entries under /sys/hypervisor"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      Since module_init translates to device_initcall in the non-modular
      case, the init ordering remains unchanged with this commit.  However
      one could argue that fs_initcall() might make more sense here.
      
      This change means that the one line function xen_properties_destroy()
      has only one user left, and since that is inside an #ifdef, we just
      manually inline it there vs. adding more ifdeffery around the function
      to avoid compile warnings about "defined but not used".
      
      In order to be consistent we also manually inline the other _destroy
      functions that are also just one line sysfs functions calls with only
      one call site remaing, even though they wouldn't need #ifdeffery.
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Reviewed-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      46894f17
    • Paul Gortmaker's avatar
      drivers/xen: make xenbus_dev_[front/back]end explicitly non-modular · ab1241a1
      Paul Gortmaker authored
      The Makefile / Kconfig currently controlling compilation here is:
      
      obj-y   += xenbus_dev_frontend.o
      [...]
      obj-$(CONFIG_XEN_BACKEND) += xenbus_dev_backend.o
      
      ...with:
      
      drivers/xen/Kconfig:config XEN_BACKEND
      drivers/xen/Kconfig:    bool "Backend driver support"
      
      ...meaning that they currently are not being built as modules by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      Since module_init translates to device_initcall in the non-modular
      case, the init ordering remains unchanged with this commit.
      
      We also delete the MODULE_LICENSE tag since all that information
      is already contained at the top of the file in the comments.
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Reviewed-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      ab1241a1