1. 15 Sep, 2017 9 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.14-ofs2' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux · 30db202e
      Linus Torvalds authored
      Pull orangefs updates from Mike Marshall:
       "Some cleanups and a big bug fix for ACLs.
      
        When I was reviewing Jan Kara's ACL patch, I realized that Orangefs
        ACL code was busted, not just in the kernel module, but in the server
        as well. I've been working on the code in the server mostly, but
        here's one kernel patch, there will be more"
      
      * tag 'for-linus-4.14-ofs2' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux:
        orangefs: Adjust three checks for null pointers
        orangefs: Use kcalloc() in orangefs_prepare_cdm_array()
        orangefs: Delete error messages for a failed memory allocation in five functions
        orangefs: constify xattr_handler structure
        orangefs: don't call filemap_write_and_wait from fsync
        orangefs: off by ones in xattr size checks
        orangefs: documentation clean up
        orangefs: react properly to posix_acl_update_mode's aftermath.
        orangefs: Don't clear SGID when inheriting ACLs
      30db202e
    • Mimi Zohar's avatar
      vfs: constify path argument to kernel_read_file_from_path · 711aab1d
      Mimi Zohar authored
      This patch constifies the path argument to kernel_read_file_from_path().
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      711aab1d
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-4.14-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 6ed0529f
      Linus Torvalds authored
      Pull more NFS client updates from Trond Myklebust:
       "Hightlights include:
      
        Bugfixes:
         - Various changes relating to reporting IO errors.
         - pnfs: Use the standard I/O stateid when calling LAYOUTGET
      
        Features:
         - Add static NFS I/O tracepoints for debugging"
      
      * tag 'nfs-for-4.14-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        NFS: various changes relating to reporting IO errors.
        NFS: Add static NFS I/O tracepoints
        pNFS: Use the standard I/O stateid when calling LAYOUTGET
      6ed0529f
    • Linus Torvalds's avatar
      Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 9e0ce554
      Linus Torvalds authored
      Pull misc leftovers from Al Viro.
      
      * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fix the __user misannotations in asm-generic get_user/put_user
        fput: Don't reinvent the wheel but use existing llist API
        namespace.c: Don't reinvent the wheel but use existing llist API
      9e0ce554
    • Linus Torvalds's avatar
      Merge branch 'work.read_write' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · e253d98f
      Linus Torvalds authored
      Pull nowait read support from Al Viro:
       "Support IOCB_NOWAIT for buffered reads and block devices"
      
      * 'work.read_write' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        block_dev: support RFW_NOWAIT on block device nodes
        fs: support RWF_NOWAIT for buffered reads
        fs: support IOCB_NOWAIT in generic_file_buffered_read
        fs: pass iocb to do_generic_file_read
      e253d98f
    • Linus Torvalds's avatar
      Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 0f0d1272
      Linus Torvalds authored
      Pull mount flag updates from Al Viro:
       "Another chunk of fmount preparations from dhowells; only trivial
        conflicts for that part. It separates MS_... bits (very grotty
        mount(2) ABI) from the struct super_block ->s_flags (kernel-internal,
        only a small subset of MS_... stuff).
      
        This does *not* convert the filesystems to new constants; only the
        infrastructure is done here. The next step in that series is where the
        conflicts would be; that's the conversion of filesystems. It's purely
        mechanical and it's better done after the merge, so if you could run
        something like
      
      	list=$(for i in MS_RDONLY MS_NOSUID MS_NODEV MS_NOEXEC MS_SYNCHRONOUS MS_MANDLOCK MS_DIRSYNC MS_NOATIME MS_NODIRATIME MS_SILENT MS_POSIXACL MS_KERNMOUNT MS_I_VERSION MS_LAZYTIME; do git grep -l $i fs drivers/staging/lustre drivers/mtd ipc mm include/linux; done|sort|uniq|grep -v '^fs/namespace.c$')
      
      	sed -i -e 's/\<MS_RDONLY\>/SB_RDONLY/g' \
      	        -e 's/\<MS_NOSUID\>/SB_NOSUID/g' \
      	        -e 's/\<MS_NODEV\>/SB_NODEV/g' \
      	        -e 's/\<MS_NOEXEC\>/SB_NOEXEC/g' \
      	        -e 's/\<MS_SYNCHRONOUS\>/SB_SYNCHRONOUS/g' \
      	        -e 's/\<MS_MANDLOCK\>/SB_MANDLOCK/g' \
      	        -e 's/\<MS_DIRSYNC\>/SB_DIRSYNC/g' \
      	        -e 's/\<MS_NOATIME\>/SB_NOATIME/g' \
      	        -e 's/\<MS_NODIRATIME\>/SB_NODIRATIME/g' \
      	        -e 's/\<MS_SILENT\>/SB_SILENT/g' \
      	        -e 's/\<MS_POSIXACL\>/SB_POSIXACL/g' \
      	        -e 's/\<MS_KERNMOUNT\>/SB_KERNMOUNT/g' \
      	        -e 's/\<MS_I_VERSION\>/SB_I_VERSION/g' \
      	        -e 's/\<MS_LAZYTIME\>/SB_LAZYTIME/g' \
      	        $list
      
        and commit it with something along the lines of 'convert filesystems
        away from use of MS_... constants' as commit message, it would save a
        quite a bit of headache next cycle"
      
      * 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        VFS: Differentiate mount flags (MS_*) from internal superblock flags
        VFS: Convert sb->s_flags & MS_RDONLY to sb_rdonly(sb)
        vfs: Add sb_rdonly(sb) to query the MS_RDONLY flag on s_flags
      0f0d1272
    • Linus Torvalds's avatar
      Merge branch 'work.set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 581bfce9
      Linus Torvalds authored
      Pull more set_fs removal from Al Viro:
       "Christoph's 'use kernel_read and friends rather than open-coding
        set_fs()' series"
      
      * 'work.set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fs: unexport vfs_readv and vfs_writev
        fs: unexport vfs_read and vfs_write
        fs: unexport __vfs_read/__vfs_write
        lustre: switch to kernel_write
        gadget/f_mass_storage: stop messing with the address limit
        mconsole: switch to kernel_read
        btrfs: switch write_buf to kernel_write
        net/9p: switch p9_fd_read to kernel_write
        mm/nommu: switch do_mmap_private to kernel_read
        serial2002: switch serial2002_tty_write to kernel_{read/write}
        fs: make the buf argument to __kernel_write a void pointer
        fs: fix kernel_write prototype
        fs: fix kernel_read prototype
        fs: move kernel_read to fs/read_write.c
        fs: move kernel_write to fs/read_write.c
        autofs4: switch autofs4_write to __kernel_write
        ashmem: switch to ->read_iter
      581bfce9
    • Linus Torvalds's avatar
      Merge branch 'work.ipc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · cc73fee0
      Linus Torvalds authored
      Pull ipc compat cleanup and 64-bit time_t from Al Viro:
       "IPC copyin/copyout sanitizing, including 64bit time_t work from Deepa
        Dinamani"
      
      * 'work.ipc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        utimes: Make utimes y2038 safe
        ipc: shm: Make shmid_kernel timestamps y2038 safe
        ipc: sem: Make sem_array timestamps y2038 safe
        ipc: msg: Make msg_queue timestamps y2038 safe
        ipc: mqueue: Replace timespec with timespec64
        ipc: Make sys_semtimedop() y2038 safe
        get rid of SYSVIPC_COMPAT on ia64
        semtimedop(): move compat to native
        shmat(2): move compat to native
        msgrcv(2), msgsnd(2): move compat to native
        ipc(2): move compat to native
        ipc: make use of compat ipc_perm helpers
        semctl(): move compat to native
        semctl(): separate all layout-dependent copyin/copyout
        msgctl(): move compat to native
        msgctl(): split the actual work from copyin/copyout
        ipc: move compat shmctl to native
        shmctl: split the work from copyin/copyout
      cc73fee0
    • Linus Torvalds's avatar
      Merge branch 'zstd-minimal' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · e7cdb60f
      Linus Torvalds authored
      Pull zstd support from Chris Mason:
       "Nick Terrell's patch series to add zstd support to the kernel has been
        floating around for a while. After talking with Dave Sterba, Herbert
        and Phillip, we decided to send the whole thing in as one pull
        request.
      
        zstd is a big win in speed over zlib and in compression ratio over
        lzo, and the compression team here at FB has gotten great results
        using it in production. Nick will continue to update the kernel side
        with new improvements from the open source zstd userland code.
      
        Nick has a number of benchmarks for the main zstd code in his lib/zstd
        commit:
      
            I ran the benchmarks on a Ubuntu 14.04 VM with 2 cores and 4 GiB
            of RAM. The VM is running on a MacBook Pro with a 3.1 GHz Intel
            Core i7 processor, 16 GB of RAM, and a SSD. I benchmarked using
            `silesia.tar` [3], which is 211,988,480 B large. Run the following
            commands for the benchmark:
      
              sudo modprobe zstd_compress_test
              sudo mknod zstd_compress_test c 245 0
              sudo cp silesia.tar zstd_compress_test
      
            The time is reported by the time of the userland `cp`.
            The MB/s is computed with
      
              1,536,217,008 B / time(buffer size, hash)
      
            which includes the time to copy from userland.
            The Adjusted MB/s is computed with
      
              1,536,217,088 B / (time(buffer size, hash) - time(buffer size, none)).
      
            The memory reported is the amount of memory the compressor
            requests.
      
              | Method   | Size (B) | Time (s) | Ratio | MB/s    | Adj MB/s | Mem (MB) |
              |----------|----------|----------|-------|---------|----------|----------|
              | none     | 11988480 |    0.100 |     1 | 2119.88 |        - |        - |
              | zstd -1  | 73645762 |    1.044 | 2.878 |  203.05 |   224.56 |     1.23 |
              | zstd -3  | 66988878 |    1.761 | 3.165 |  120.38 |   127.63 |     2.47 |
              | zstd -5  | 65001259 |    2.563 | 3.261 |   82.71 |    86.07 |     2.86 |
              | zstd -10 | 60165346 |   13.242 | 3.523 |   16.01 |    16.13 |    13.22 |
              | zstd -15 | 58009756 |   47.601 | 3.654 |    4.45 |     4.46 |    21.61 |
              | zstd -19 | 54014593 |  102.835 | 3.925 |    2.06 |     2.06 |    60.15 |
              | zlib -1  | 77260026 |    2.895 | 2.744 |   73.23 |    75.85 |     0.27 |
              | zlib -3  | 72972206 |    4.116 | 2.905 |   51.50 |    52.79 |     0.27 |
              | zlib -6  | 68190360 |    9.633 | 3.109 |   22.01 |    22.24 |     0.27 |
              | zlib -9  | 67613382 |   22.554 | 3.135 |    9.40 |     9.44 |     0.27 |
      
            I benchmarked zstd decompression using the same method on the same
            machine. The benchmark file is located in the upstream zstd repo
            under `contrib/linux-kernel/zstd_decompress_test.c` [4]. The
            memory reported is the amount of memory required to decompress
            data compressed with the given compression level. If you know the
            maximum size of your input, you can reduce the memory usage of
            decompression irrespective of the compression level.
      
              | Method   | Time (s) | MB/s    | Adjusted MB/s | Memory (MB) |
              |----------|----------|---------|---------------|-------------|
              | none     |    0.025 | 8479.54 |             - |           - |
              | zstd -1  |    0.358 |  592.15 |        636.60 |        0.84 |
              | zstd -3  |    0.396 |  535.32 |        571.40 |        1.46 |
              | zstd -5  |    0.396 |  535.32 |        571.40 |        1.46 |
              | zstd -10 |    0.374 |  566.81 |        607.42 |        2.51 |
              | zstd -15 |    0.379 |  559.34 |        598.84 |        4.61 |
              | zstd -19 |    0.412 |  514.54 |        547.77 |        8.80 |
              | zlib -1  |    0.940 |  225.52 |        231.68 |        0.04 |
              | zlib -3  |    0.883 |  240.08 |        247.07 |        0.04 |
              | zlib -6  |    0.844 |  251.17 |        258.84 |        0.04 |
              | zlib -9  |    0.837 |  253.27 |        287.64 |        0.04 |
      
        I ran a long series of tests and benchmarks on the btrfs side and the
        gains are very similar to the core benchmarks Nick ran"
      
      * 'zstd-minimal' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        squashfs: Add zstd support
        btrfs: Add zstd support
        lib: Add zstd modules
        lib: Add xxhash module
      e7cdb60f
  2. 14 Sep, 2017 28 commits
    • Linus Torvalds's avatar
      Merge tag 'kbuild-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild · a2bc8dea
      Linus Torvalds authored
      Pull Kbuild updates from Masahiro Yamada:
      
       - Use Make-builtin $(abspath ...) helper to get absolute path
      
       - Add W=2 extra warning option to detect unused macros
      
       - Use more KCONFIG_CONFIG instead hard-coded .config
      
       - Fix bugs of tar*-pkg targets
      
      * tag 'kbuild-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: buildtar: do not print successful message if tar returns error
        kbuild: buildtar: fix tar error when CONFIG_MODULES is disabled
        kbuild: Use KCONFIG_CONFIG in buildtar
        Kbuild: enable -Wunused-macros warning for "make W=2"
        kbuild: use $(abspath ...) instead of $(shell cd ... && /bin/pwd)
      a2bc8dea
    • Linus Torvalds's avatar
      Merge tag 'for-4.14/dm-changes' of... · dff4d1f6
      Linus Torvalds authored
      Merge tag 'for-4.14/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      
      Pull device mapper updates from Mike Snitzer:
      
       - Some request-based DM core and DM multipath fixes and cleanups
      
       - Constify a few variables in DM core and DM integrity
      
       - Add bufio optimization and checksum failure accounting to DM
         integrity
      
       - Fix DM integrity to avoid checking integrity of failed reads
      
       - Fix DM integrity to use init_completion
      
       - A couple DM log-writes target fixes
      
       - Simplify DAX flushing by eliminating the unnecessary flush
         abstraction that was stood up for DM's use.
      
      * tag 'for-4.14/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dax: remove the pmem_dax_ops->flush abstraction
        dm integrity: use init_completion instead of COMPLETION_INITIALIZER_ONSTACK
        dm integrity: make blk_integrity_profile structure const
        dm integrity: do not check integrity for failed read operations
        dm log writes: fix >512b sectorsize support
        dm log writes: don't use all the cpu while waiting to log blocks
        dm ioctl: constify ioctl lookup table
        dm: constify argument arrays
        dm integrity: count and display checksum failures
        dm integrity: optimize writing dm-bufio buffers that are partially changed
        dm rq: do not update rq partially in each ending bio
        dm rq: make dm-sq requeuing behavior consistent with dm-mq behavior
        dm mpath: complain about unsupported __multipath_map_bio() return values
        dm mpath: avoid that building with W=1 causes gcc 7 to complain about fall-through
      dff4d1f6
    • Linus Torvalds's avatar
      Merge tag 'fbdev-v4.14' of git://github.com/bzolnier/linux · 503f0453
      Linus Torvalds authored
      Pull fbdev updates from Bartlomiej Zolnierkiewicz:
      
       - make fbcon a built-time depency for fbdev (fbcon was tristate option
         before, now it is a bool) - this is a first step in preparations for
         making console_lock usage saner (currently it acts like the BKL for
         all things fbdev/fbcon) (Daniel Vetter)
      
       - add fbcon=margin:<color> command line option to select the fbcon
         margin color (David Lechner)
      
       - add DMI quirk table for x86 systems which need fbcon rotation
         (devices like Asus T100HA, GPD Pocket, the GPD win and the I.T.Works
         TW891) (Hans de Goede)
      
       - fix 1bpp logo support for unusual width (needed by LEGO MINDSTORMS
         EV3) (David Lechner)
      
       - enable Xilinx FB driver for ARM ZynqMP platform (Michal Simek)
      
       - fix use after free in the error path of udlfb driver (Anton Vasilyev)
      
       - fix error return code handling in pxa3xx_gcu driver (Gustavo A. R.
         Silva)
      
       - fix bootparams.screeninfo arguments checking in vgacon (Jan H.
         Schönherr)
      
       - do not leak uninitialized padding in clk to userspace in the debug
         code of atyfb driver (Vladis Dronov)
      
       - fix compiler warnings in fbcon code and matroxfb driver (Arnd
         Bergmann)
      
       - convert fbdev susbsytem to using %pOF instead of full_name (Rob
         Herring)
      
       - structures constifications (Arvind Yadav, Bhumika Goyal, Gustavo A.
         R. Silva, Julia Lawall)
      
       - misc cleanups (Gustavo A. R. Silva, Hyun Kwon, Julia Lawall, Kuninori
         Morimoto, Lynn Lei)
      
      * tag 'fbdev-v4.14' of git://github.com/bzolnier/linux: (75 commits)
        video/console: Update BIOS dates list for GPD win console rotation DMI quirk
        video/console: Add rotated LCD-panel DMI quirk for the VIOS LTH17
        video: fbdev: sis: fix duplicated code for different branches
        video: fbdev: make fb_var_screeninfo const
        video: fbdev: aty: do not leak uninitialized padding in clk to userspace
        vgacon: Prevent faulty bootparams.screeninfo from causing harm
        video: fbdev: make fb_videomode const
        video/console: Add new BIOS date for GPD pocket to dmi quirk table
        fbcon: remove restriction on margin color
        video: ARM CLCD: constify amba_id
        video: fm2fb: constify zorro_device_id
        video: fbdev: annotate fb_fix_screeninfo with const and __initconst
        omapfb: constify omap_video_timings structures
        video: fbdev: udlfb: Fix use after free on dlfb_usb_probe error path
        fbdev: i810: make fb_ops const
        fbdev: matrox: make fb_ops const
        video: fbdev: pxa3xx_gcu: fix error return code in pxa3xx_gcu_probe()
        video: fbdev: Enable Xilinx FB for ZynqMP
        video: fbdev: Fix multiple style issues in xilinxfb
        video: fbdev: udlfb: constify usb_device_id.
        ...
      503f0453
    • Linus Torvalds's avatar
      Merge git://www.linux-watchdog.org/linux-watchdog · 939ae589
      Linus Torvalds authored
      Pull watchdog updates from Wim Van Sebroeck:
      
       - add support for the watchdog on Meson8 and Meson8m2
      
       - add support for MediaTek MT7623 and MT7622 SoC
      
       - add support for the r8a77995 wdt
      
       - explicitly request exclusive reset control for asm9260_wdt,
         zx2967_wdt, rt2880_wdt and mt7621_wdt
      
       - improvements to asm9260_wdt, aspeed_wdt, renesas_wdt and cadence_wdt
      
       - add support for reading freq via CCF + suspend/resume support for
         of_xilinx_wdt
      
       - constify watchdog_ops and various device-id structures
      
       - revert of commit 1fccb730 ("iTCO_wdt: all versions count down
         twice") (Bug 196509)
      
      * git://www.linux-watchdog.org/linux-watchdog: (40 commits)
        watchdog: mei_wdt: constify mei_cl_device_id
        watchdog: sp805: constify amba_id
        watchdog: ziirave: constify i2c_device_id
        watchdog: sc1200: constify pnp_device_id
        dt-bindings: watchdog: renesas-wdt: Add support for the r8a77995 wdt
        watchdog: renesas_wdt: update copyright dates
        watchdog: renesas_wdt: make 'clk' a variable local to probe()
        watchdog: renesas_wdt: consistently use RuntimePM for clock management
        watchdog: aspeed: Support configuration of external signal properties
        dt-bindings: watchdog: aspeed: External reset signal properties
        drivers/watchdog: Add optional ASPEED device tree properties
        drivers/watchdog: ASPEED reference dev tree properties for config
        watchdog: da9063_wdt: Simplify by removing unneeded struct...
        watchdog: bcm7038: Check the return value from clk_prepare_enable()
        watchdog: qcom: Check for platform_get_resource() failure
        watchdog: of_xilinx_wdt: Add suspend/resume support
        watchdog: of_xilinx_wdt: Add support for reading freq via CCF
        dt-bindings: watchdog: mediatek: add support for MediaTek MT7623 and MT7622 SoC
        watchdog: max77620_wdt: constify platform_device_id
        watchdog: pcwd_usb: constify usb_device_id
        ...
      939ae589
    • Linus Torvalds's avatar
      Merge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging · e75f801f
      Linus Torvalds authored
      Pull dmi update from Jean Delvare:
       "Mark all struct dmi_system_id instances const"
      
      * 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
        dmi: Mark all struct dmi_system_id instances const
      e75f801f
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · ba768535
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "This slew of fixes for pin control was noticed and patched up early,
        so to get the annoyance out of the way for -rc1 it would make sense to
        send them already.
      
         - Fix a build include in the Uniphier driver to keep pace with
           ongoing refactorings.
      
         - Fix a slew of minor semantic and syntactic issues as well as
           stricting up Kconfig for the new Spreadtrum driver.
      
         - Fix the GPIO interrupt set-up on the Marvell 37xx Armada as fallout
           for dynamically allocating irq descriptors from the core. (Also
           tagged for stable.)
      
         - Fix AMD register suspend/resume state spool/unspooling so that
           wakeup works as it should. (Also tagged for stable.)"
      
      * tag 'pinctrl-v4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl/amd: save pin registers over suspend/resume
        pinctrl: armada-37xx: Fix gpio interrupt setup
        pinctrl: sprd: fix off by one bugs
        pinctrl: sprd: check for allocation failure
        pinctrl: sprd: Restrict PINCTRL_SPRD to ARCH_SPRD or COMPILE_TEST
        pinctrl: sprd: fix build errors and dependencies
        pinctrl: sprd: make three local functions static
        pinctrl: uniphier: include <linux/build_bug.h> instead of <linux/bug.h>
      ba768535
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 7a95bdb0
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "A few leftovers"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm, page_owner: skip unnecessary stack_trace entries
        arm64: stacktrace: avoid listing stacktrace functions in stacktrace
        mm: treewide: remove GFP_TEMPORARY allocation flag
        IB/mlx4: fix sprintf format warning
        fscache: fix fscache_objlist_show format processing
        lib/test_bitmap.c: use ULL suffix for 64-bit constants
        procfs: remove unused variable
        drivers/media/cec/cec-adap.c: fix build with gcc-4.4.4
        idr: remove WARN_ON_ONCE() when trying to replace negative ID
      7a95bdb0
    • Markus Elfring's avatar
      orangefs: Adjust three checks for null pointers · 0b08273c
      Markus Elfring authored
      MIME-Version: 1.0
      Content-Type: text/plain; charset=UTF-8
      Content-Transfer-Encoding: 8bit
      
      The script “checkpatch.pl” pointed information out like the following.
      
      Comparison to NULL could be written !…
      
      Thus fix affected source code places.
      Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
      0b08273c
    • Markus Elfring's avatar
      orangefs: Use kcalloc() in orangefs_prepare_cdm_array() · 5e273a0e
      Markus Elfring authored
      * A multiplication for the size determination of a memory allocation
        indicated that an array data structure should be processed.
        Thus use the corresponding function "kcalloc".
      
        This issue was detected by using the Coccinelle software.
      
      * Replace the specification of a data structure by a pointer dereference
        to make the corresponding size determination a bit safer according to
        the Linux coding style convention.
      Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
      5e273a0e
    • Markus Elfring's avatar
      orangefs: Delete error messages for a failed memory allocation in five functions · 07a25853
      Markus Elfring authored
      Omit an extra message for a memory allocation failure in these functions.
      
      This issue was detected by using the Coccinelle software.
      Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
      07a25853
    • Julia Lawall's avatar
      orangefs: constify xattr_handler structure · 12174444
      Julia Lawall authored
      The xattr_handler structure is only stored in an array of const
      structures.  Thus the xattr_handler structure itself can be
      const.
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
      12174444
    • Jeff Layton's avatar
      orangefs: don't call filemap_write_and_wait from fsync · 49e55713
      Jeff Layton authored
      Orangefs doesn't do buffered writes yet, so there's no point in
      initiating and waiting for writeback.
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
      49e55713
    • Dan Carpenter's avatar
      orangefs: off by ones in xattr size checks · 5f13e587
      Dan Carpenter authored
      A previous patch which claimed to remove off by ones actually introduced
      them.
      
      strlen() returns the length of the string not including the NUL
      character.  We are using strcpy() to copy "name" into a buffer which is
      ORANGEFS_MAX_XATTR_NAMELEN characters long.  We should make sure to
      leave space for the NUL, otherwise we're writing one character beyond
      the end of the buffer.
      
      Fixes: e675c5ec ("orangefs: clean up oversize xattr validation")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
      5f13e587
    • Mike Marshall's avatar
      orangefs: documentation clean up · ba5e79ea
      Mike Marshall authored
      Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
      ba5e79ea
    • Mike Marshall's avatar
      orangefs: react properly to posix_acl_update_mode's aftermath. · 4bef6900
      Mike Marshall authored
      posix_acl_update_mode checks to see if the permissions
      described by the ACL can be encoded into the
      object's mode. If so, it sets "acl" to NULL
      and "mode" to the new desired value. Prior to this patch
      we failed to actually propagate the new mode back to the
      server.
      Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
      4bef6900
    • Jan Kara's avatar
      orangefs: Don't clear SGID when inheriting ACLs · b5accbb0
      Jan Kara authored
      When new directory 'DIR1' is created in a directory 'DIR0' with SGID bit
      set, DIR1 is expected to have SGID bit set (and owning group equal to
      the owning group of 'DIR0'). However when 'DIR0' also has some default
      ACLs that 'DIR1' inherits, setting these ACLs will result in SGID bit on
      'DIR1' to get cleared if user is not member of the owning group.
      
      Fix the problem by creating __orangefs_set_acl() function that does not
      call posix_acl_update_mode() and use it when inheriting ACLs. That
      prevents SGID bit clearing and the mode has been properly set by
      posix_acl_create() anyway.
      
      Fixes: 07393101
      CC: stable@vger.kernel.org
      CC: Mike Marshall <hubcap@omnibond.com>
      CC: pvfs2-developers@beowulf-underground.org
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
      b5accbb0
    • Tim Chen's avatar
      sched/wait: Introduce wakeup boomark in wake_up_page_bit · 11a19c7b
      Tim Chen authored
      Now that we have added breaks in the wait queue scan and allow bookmark
      on scan position, we put this logic in the wake_up_page_bit function.
      
      We can have very long page wait list in large system where multiple
      pages share the same wait list. We break the wake up walk here to allow
      other cpus a chance to access the list, and not to disable the interrupts
      when traversing the list for too long.  This reduces the interrupt and
      rescheduling latency, and excessive page wait queue lock hold time.
      
      [ v2: Remove bookmark_wake_function ]
      Signed-off-by: default avatarTim Chen <tim.c.chen@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      11a19c7b
    • Tim Chen's avatar
      sched/wait: Break up long wake list walk · 2554db91
      Tim Chen authored
      We encountered workloads that have very long wake up list on large
      systems. A waker takes a long time to traverse the entire wake list and
      execute all the wake functions.
      
      We saw page wait list that are up to 3700+ entries long in tests of
      large 4 and 8 socket systems. It took 0.8 sec to traverse such list
      during wake up. Any other CPU that contends for the list spin lock will
      spin for a long time. It is a result of the numa balancing migration of
      hot pages that are shared by many threads.
      
      Multiple CPUs waking are queued up behind the lock, and the last one
      queued has to wait until all CPUs did all the wakeups.
      
      The page wait list is traversed with interrupt disabled, which caused
      various problems. This was the original cause that triggered the NMI
      watch dog timer in: https://patchwork.kernel.org/patch/9800303/ . Only
      extending the NMI watch dog timer there helped.
      
      This patch bookmarks the waker's scan position in wake list and break
      the wake up walk, to allow access to the list before the waker resume
      its walk down the rest of the wait list. It lowers the interrupt and
      rescheduling latency.
      
      This patch also provides a performance boost when combined with the next
      patch to break up page wakeup list walk. We saw 22% improvement in the
      will-it-scale file pread2 test on a Xeon Phi system running 256 threads.
      
      [ v2: Merged in Linus' changes to remove the bookmark_wake_function, and
        simply access to flags. ]
      Reported-by: default avatarKan Liang <kan.liang@intel.com>
      Tested-by: default avatarKan Liang <kan.liang@intel.com>
      Signed-off-by: default avatarTim Chen <tim.c.chen@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2554db91
    • Christoph Hellwig's avatar
      dmi: Mark all struct dmi_system_id instances const · 6faadbbb
      Christoph Hellwig authored
      ... and __initconst if applicable.
      
      Based on similar work for an older kernel in the Grsecurity patch.
      
      [JD: fix toshiba-wmi build]
      [JD: add htcpen]
      [JD: move __initconst where checkscript wants it]
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
      6faadbbb
    • Prakash Gupta's avatar
      mm, page_owner: skip unnecessary stack_trace entries · 5f48f0bd
      Prakash Gupta authored
      The page_owner stacktrace always begin as follows:
      
        [<ffffff987bfd48f4>] save_stack+0x40/0xc8
        [<ffffff987bfd4da8>] __set_page_owner+0x3c/0x6c
      
      These two entries do not provide any useful information and limits the
      available stacktrace depth.  The page_owner stacktrace was skipping
      caller function from stack entries but this was missed with commit
      f2ca0b55 ("mm/page_owner: use stackdepot to store stacktrace")
      
      Example page_owner entry after the patch:
      
        Page allocated via order 0, mask 0x8(ffffff80085fb714)
        PFN 654411 type Movable Block 639 type CMA Flags 0x0(ffffffbe5c7f12c0)
        [<ffffff9b64989c14>] post_alloc_hook+0x70/0x80
        ...
        [<ffffff9b651216e8>] msm_comm_try_state+0x5f8/0x14f4
        [<ffffff9b6512486c>] msm_vidc_open+0x5e4/0x7d0
        [<ffffff9b65113674>] msm_v4l2_open+0xa8/0x224
      
      Link: http://lkml.kernel.org/r/1504078343-28754-2-git-send-email-guptap@codeaurora.org
      Fixes: f2ca0b55 ("mm/page_owner: use stackdepot to store stacktrace")
      Signed-off-by: default avatarPrakash Gupta <guptap@codeaurora.org>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5f48f0bd
    • Prakash Gupta's avatar
      arm64: stacktrace: avoid listing stacktrace functions in stacktrace · bb53c820
      Prakash Gupta authored
      The stacktraces always begin as follows:
      
        [<c00117b4>] save_stack_trace_tsk+0x0/0x98
        [<c0011870>] save_stack_trace+0x24/0x28
        ...
      
      This is because the stack trace code includes the stack frames for
      itself.  This is incorrect behaviour, and also leads to "skip" doing the
      wrong thing (which is the number of stack frames to avoid recording.)
      
      Perversely, it does the right thing when passed a non-current thread.
      Fix this by ensuring that we have a known constant number of frames
      above the main stack trace function, and always skip these.
      
      This was fixed for arch arm by commit 3683f44c ("ARM: stacktrace:
      avoid listing stacktrace functions in stacktrace")
      
      Link: http://lkml.kernel.org/r/1504078343-28754-1-git-send-email-guptap@codeaurora.orgSigned-off-by: default avatarPrakash Gupta <guptap@codeaurora.org>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bb53c820
    • Michal Hocko's avatar
      mm: treewide: remove GFP_TEMPORARY allocation flag · 0ee931c4
      Michal Hocko authored
      GFP_TEMPORARY was introduced by commit e12ba74d ("Group short-lived
      and reclaimable kernel allocations") along with __GFP_RECLAIMABLE.  It's
      primary motivation was to allow users to tell that an allocation is
      short lived and so the allocator can try to place such allocations close
      together and prevent long term fragmentation.  As much as this sounds
      like a reasonable semantic it becomes much less clear when to use the
      highlevel GFP_TEMPORARY allocation flag.  How long is temporary? Can the
      context holding that memory sleep? Can it take locks? It seems there is
      no good answer for those questions.
      
      The current implementation of GFP_TEMPORARY is basically GFP_KERNEL |
      __GFP_RECLAIMABLE which in itself is tricky because basically none of
      the existing caller provide a way to reclaim the allocated memory.  So
      this is rather misleading and hard to evaluate for any benefits.
      
      I have checked some random users and none of them has added the flag
      with a specific justification.  I suspect most of them just copied from
      other existing users and others just thought it might be a good idea to
      use without any measuring.  This suggests that GFP_TEMPORARY just
      motivates for cargo cult usage without any reasoning.
      
      I believe that our gfp flags are quite complex already and especially
      those with highlevel semantic should be clearly defined to prevent from
      confusion and abuse.  Therefore I propose dropping GFP_TEMPORARY and
      replace all existing users to simply use GFP_KERNEL.  Please note that
      SLAB users with shrinkers will still get __GFP_RECLAIMABLE heuristic and
      so they will be placed properly for memory fragmentation prevention.
      
      I can see reasons we might want some gfp flag to reflect shorterm
      allocations but I propose starting from a clear semantic definition and
      only then add users with proper justification.
      
      This was been brought up before LSF this year by Matthew [1] and it
      turned out that GFP_TEMPORARY really doesn't have a clear semantic.  It
      seems to be a heuristic without any measured advantage for most (if not
      all) its current users.  The follow up discussion has revealed that
      opinions on what might be temporary allocation differ a lot between
      developers.  So rather than trying to tweak existing users into a
      semantic which they haven't expected I propose to simply remove the flag
      and start from scratch if we really need a semantic for short term
      allocations.
      
      [1] http://lkml.kernel.org/r/20170118054945.GD18349@bombadil.infradead.org
      
      [akpm@linux-foundation.org: fix typo]
      [akpm@linux-foundation.org: coding-style fixes]
      [sfr@canb.auug.org.au: drm/i915: fix up]
        Link: http://lkml.kernel.org/r/20170816144703.378d4f4d@canb.auug.org.au
      Link: http://lkml.kernel.org/r/20170728091904.14627-1-mhocko@kernel.orgSigned-off-by: default avatarMichal Hocko <mhocko@suse.com>
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: default avatarMel Gorman <mgorman@suse.de>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Neil Brown <neilb@suse.de>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0ee931c4
    • Arnd Bergmann's avatar
      IB/mlx4: fix sprintf format warning · d0dbf771
      Arnd Bergmann authored
      gcc-7 points out that a negative port_num value would overflow the
      string buffer:
      
        drivers/infiniband/hw/mlx4/sysfs.c: In function 'mlx4_ib_device_register_sysfs':
        drivers/infiniband/hw/mlx4/sysfs.c:251:16: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
        drivers/infiniband/hw/mlx4/sysfs.c:251:2: note: 'sprintf' output between 2 and 11 bytes into a destination of size 10
        drivers/infiniband/hw/mlx4/sysfs.c:303:17: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
        drivers/infiniband/hw/mlx4/sysfs.c:303:3: note: 'sprintf' output between 2 and 11 bytes into a destination of size 10
      
      While we should be able to assume that port_num is positive here, making
      the buffer one byte longer has no downsides and avoids the warning.
      
      Fixes: c1e7e466 ("IB/mlx4: Add iov directory in sysfs under the ib device")
      Link: http://lkml.kernel.org/r/20170714120720.906842-23-arnd@arndb.deSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d0dbf771
    • Arnd Bergmann's avatar
      fscache: fix fscache_objlist_show format processing · ebfddb3d
      Arnd Bergmann authored
      gcc points out a minor bug in the handling of unknown cookie types,
      which could result in a string overflow when the integer is copied into
      a 3-byte string:
      
        fs/fscache/object-list.c: In function 'fscache_objlist_show':
        fs/fscache/object-list.c:265:19: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
         sprintf(_type, "%02u", cookie->def->type);
                        ^~~~~~
        fs/fscache/object-list.c:265:4: note: 'sprintf' output between 3 and 4 bytes into a destination of size 3
      
      This is currently harmless as no code sets a type other than 0 or 1, but
      it makes sense to use snprintf() here to avoid overflowing the array if
      that changes.
      
      Link: http://lkml.kernel.org/r/20170714120720.906842-22-arnd@arndb.deSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ebfddb3d
    • Geert Uytterhoeven's avatar
      lib/test_bitmap.c: use ULL suffix for 64-bit constants · 8185f570
      Geert Uytterhoeven authored
      With gcc 4.1.2:
      
        lib/test_bitmap.c:189: warning: integer constant is too large for `long' type
        lib/test_bitmap.c:190: warning: integer constant is too large for `long' type
        lib/test_bitmap.c:194: warning: integer constant is too large for `long' type
        lib/test_bitmap.c:195: warning: integer constant is too large for `long' type
      
      Add the missing "ULL" suffix to fix this.
      
      Link: http://lkml.kernel.org/r/1505040523-31230-1-git-send-email-geert@linux-m68k.org
      Fixes: 60ef6900 ("bitmap: introduce BITMAP_FROM_U64()")
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarYury Norov <ynorov@caviumnetworks.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8185f570
    • Arnd Bergmann's avatar
      procfs: remove unused variable · 6dec0dd4
      Arnd Bergmann authored
      In NOMMU configurations, we get a warning about a variable that has become
      unused:
      
        fs/proc/task_nommu.c: In function 'nommu_vma_show':
        fs/proc/task_nommu.c:148:28: error: unused variable 'priv' [-Werror=unused-variable]
      
      Link: http://lkml.kernel.org/r/20170911200231.3171415-1-arnd@arndb.de
      Fixes: 1240ea0d ("fs, proc: remove priv argument from is_stack")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6dec0dd4
    • Andrew Morton's avatar
      drivers/media/cec/cec-adap.c: fix build with gcc-4.4.4 · c848c49a
      Andrew Morton authored
      gcc-4.4.4 has issues with initialization of anonymous unions:
      
        drivers/media/cec/cec-adap.c: In function 'cec_queue_msg_fh':
        drivers/media/cec/cec-adap.c:184: error: unknown field 'lost_msgs' specified in initializer
      
      work around this.
      
      Fixes: 6b2bbb08 ("media: cec: rework the cec event handling")
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Hans Verkuil <hans.verkuil@cisco.com>
      Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
      Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c848c49a
    • Eric Biggers's avatar
      idr: remove WARN_ON_ONCE() when trying to replace negative ID · a47f68d6
      Eric Biggers authored
      IDR only supports non-negative IDs.  There used to be a 'WARN_ON_ONCE(id <
      0)' in idr_replace(), but it was intentionally removed by commit
      2e1c9b28 ("idr: remove WARN_ON_ONCE() on negative IDs").
      
      Then it was added back by commit 0a835c4f ("Reimplement IDR and IDA
      using the radix tree").  However it seems that adding it back was a
      mistake, given that some users such as drm_gem_handle_delete()
      (DRM_IOCTL_GEM_CLOSE) pass in a value from userspace to idr_replace(),
      allowing the WARN_ON_ONCE to be triggered.  drm_gem_handle_delete()
      actually just wants idr_replace() to return an error code if the ID is
      not allocated, including in the case where the ID is invalid (negative).
      
      So once again remove the bogus WARN_ON_ONCE().
      
      This bug was found by syzkaller, which encountered the following
      warning:
      
          WARNING: CPU: 3 PID: 3008 at lib/idr.c:157 idr_replace+0x1d8/0x240 lib/idr.c:157
          Kernel panic - not syncing: panic_on_warn set ...
      
          CPU: 3 PID: 3008 Comm: syzkaller218828 Not tainted 4.13.0-rc4-next-20170811 #2
          Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
          Call Trace:
           fixup_bug+0x40/0x90 arch/x86/kernel/traps.c:190
           do_trap_no_signal arch/x86/kernel/traps.c:224 [inline]
           do_trap+0x260/0x390 arch/x86/kernel/traps.c:273
           do_error_trap+0x120/0x390 arch/x86/kernel/traps.c:310
           do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:323
           invalid_op+0x1e/0x30 arch/x86/entry/entry_64.S:930
          RIP: 0010:idr_replace+0x1d8/0x240 lib/idr.c:157
          RSP: 0018:ffff8800394bf9f8 EFLAGS: 00010297
          RAX: ffff88003c6c60c0 RBX: 1ffff10007297f43 RCX: 0000000000000000
          RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8800394bfa78
          RBP: ffff8800394bfae0 R08: ffffffff82856487 R09: 0000000000000000
          R10: ffff8800394bf9a8 R11: ffff88006c8bae28 R12: ffffffffffffffff
          R13: ffff8800394bfab8 R14: dffffc0000000000 R15: ffff8800394bfbc8
           drm_gem_handle_delete+0x33/0xa0 drivers/gpu/drm/drm_gem.c:297
           drm_gem_close_ioctl+0xa1/0xe0 drivers/gpu/drm/drm_gem.c:671
           drm_ioctl_kernel+0x1e7/0x2e0 drivers/gpu/drm/drm_ioctl.c:729
           drm_ioctl+0x72e/0xa50 drivers/gpu/drm/drm_ioctl.c:825
           vfs_ioctl fs/ioctl.c:45 [inline]
           do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:685
           SYSC_ioctl fs/ioctl.c:700 [inline]
           SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
           entry_SYSCALL_64_fastpath+0x1f/0xbe
      
      Here is a C reproducer:
      
          #include <fcntl.h>
          #include <stddef.h>
          #include <stdint.h>
          #include <sys/ioctl.h>
          #include <drm/drm.h>
      
          int main(void)
          {
                  int cardfd = open("/dev/dri/card0", O_RDONLY);
      
                  ioctl(cardfd, DRM_IOCTL_GEM_CLOSE,
                        &(struct drm_gem_close) { .handle = -1 } );
          }
      
      Link: http://lkml.kernel.org/r/20170906235306.20534-1-ebiggers3@gmail.com
      Fixes: 0a835c4f ("Reimplement IDR and IDA using the radix tree")
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Cc: <stable@vger.kernel.org> [v4.11+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a47f68d6
  3. 13 Sep, 2017 3 commits