1. 23 2月, 2017 23 次提交
  2. 22 2月, 2017 10 次提交
    • O
      scsi_transport_sas: fix BSG ioctl memory corruption · bd1599d9
      Omar Sandoval 提交于
      The end_device and sas_host devices support BSG ioctls, but the
      request_queue allocated for them isn't set up to allocate the struct
      scsi_request payload. This leads to memory corruption in the call to
      scsi_req_init() in bsg_map_hdr(), since it will memset past the end of
      the allocated request. Fix it by setting ->cmd_size on the allocated
      request_queue.
      
      Fixes: 82ed4db4 ("block: split scsi_request out of struct request")
      Signed-off-by: NOmar Sandoval <osandov@fb.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      bd1599d9
    • J
      block: Revalidate i_bdev reference in bd_aquire() · cccd9fb9
      Jan Kara 提交于
      When a device gets removed, block device inode unhashed so that it is not
      used anymore (bdget() will not find it anymore). Later when a new device
      gets created with the same device number, we create new block device
      inode. However there may be file system device inodes whose i_bdev still
      points to the original block device inode and thus we get two active
      block device inodes for the same device. They will share the same
      gendisk so the only visible differences will be that page caches will
      not be coherent and BDIs will be different (the old block device inode
      still points to unregistered BDI).
      
      Fix the problem by checking in bd_acquire() whether i_bdev still points
      to active block device inode and re-lookup the block device if not. That
      way any open of a block device happening after the old device has been
      removed will get correct block device inode.
      Tested-by: NLekshmi Pillai <lekshmicpillai@in.ibm.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      cccd9fb9
    • J
      block: Unhash also block device inode for the whole device · d06e05c0
      Jan Kara 提交于
      Iteration over partitions in del_gendisk() omits part0. Add
      bdev_unhash_inode() call for the whole device. Otherwise if the device
      number gets reused, bdev inode will be still associated with the old
      (stale) bdi.
      Tested-by: NLekshmi Pillai <lekshmicpillai@in.ibm.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      d06e05c0
    • J
      block: Move bdev_unhash_inode() after invalidate_partition() · 4b8c861a
      Jan Kara 提交于
      Move bdev_unhash_inode() after invalidate_partition() as
      invalidate_partition() looks up bdev and it cannot find the right bdev
      inode after bdev_unhash_inode() is called. Thus invalidate_partition()
      would not invalidate page cache of the previously used bdev. Also use
      part_devt() when calling bdev_unhash_inode() instead of manually
      creating the device number.
      Tested-by: NLekshmi Pillai <lekshmicpillai@in.ibm.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      4b8c861a
    • J
      nbd: cleanup workqueue on error properly · 6330a2d0
      Josef Bacik 提交于
      If we fail to register the blockdev we need to make sure to destroy the
      recv workqueue.
      Signed-off-by: NJosef Bacik <jbacik@fb.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      6330a2d0
    • J
      nbd: set the logical and physical blocksize properly · e544541b
      Josef Bacik 提交于
      We noticed when trying to do O_DIRECT to an export on the server side
      that we were getting requests smaller than the 4k sectorsize of the
      device.  This is because the client isn't setting the logical and
      physical blocksizes properly for the underlying device.  Fix this up by
      setting the queue blocksizes and then calling bd_set_size.
      Signed-off-by: NJosef Bacik <jbacik@fb.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      e544541b
    • J
      nbd: cleanup ioctl handling · 9442b739
      Josef Bacik 提交于
      Break the ioctl handling out into helper functions, some of these things
      are getting pretty big and unwieldy.
      Signed-off-by: NJosef Bacik <jbacik@fb.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      9442b739
    • C
      scsi: zero per-cmd driver data before each I/O · ee524236
      Christoph Hellwig 提交于
      Without this drivers that don't clear the state themselves can see off
      effects.  For example Hyper-V VMs using the storvsc driver will often
      hang during boot due to uncleared Test Unit Ready failures.
      
      Fixes: e9c787e6 ("scsi: allocate scsi_cmnd structures as part of struct request")
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reported-by: NDexuan Cui <decui@microsoft.com>
      Tested-by: NDexuan Cui <decui@microsoft.com>
      Reviewed-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      ee524236
    • L
      Merge tag 'for-4.11/linus-merge-signed' of git://git.kernel.dk/linux-block · 772c8f6f
      Linus Torvalds 提交于
      Pull block layer updates from Jens Axboe:
      
       - blk-mq scheduling framework from me and Omar, with a port of the
         deadline scheduler for this framework. A port of BFQ from Paolo is in
         the works, and should be ready for 4.12.
      
       - Various fixups and improvements to the above scheduling framework
         from Omar, Paolo, Bart, me, others.
      
       - Cleanup of the exported sysfs blk-mq data into debugfs, from Omar.
         This allows us to export more information that helps debug hangs or
         performance issues, without cluttering or abusing the sysfs API.
      
       - Fixes for the sbitmap code, the scalable bitmap code that was
         migrated from blk-mq, from Omar.
      
       - Removal of the BLOCK_PC support in struct request, and refactoring of
         carrying SCSI payloads in the block layer. This cleans up the code
         nicely, and enables us to kill the SCSI specific parts of struct
         request, shrinking it down nicely. From Christoph mainly, with help
         from Hannes.
      
       - Support for ranged discard requests and discard merging, also from
         Christoph.
      
       - Support for OPAL in the block layer, and for NVMe as well. Mainly
         from Scott Bauer, with fixes/updates from various others folks.
      
       - Error code fixup for gdrom from Christophe.
      
       - cciss pci irq allocation cleanup from Christoph.
      
       - Making the cdrom device operations read only, from Kees Cook.
      
       - Fixes for duplicate bdi registrations and bdi/queue life time
         problems from Jan and Dan.
      
       - Set of fixes and updates for lightnvm, from Matias and Javier.
      
       - A few fixes for nbd from Josef, using idr to name devices and a
         workqueue deadlock fix on receive. Also marks Josef as the current
         maintainer of nbd.
      
       - Fix from Josef, overwriting queue settings when the number of
         hardware queues is updated for a blk-mq device.
      
       - NVMe fix from Keith, ensuring that we don't repeatedly mark and IO
         aborted, if we didn't end up aborting it.
      
       - SG gap merging fix from Ming Lei for block.
      
       - Loop fix also from Ming, fixing a race and crash between setting loop
         status and IO.
      
       - Two block race fixes from Tahsin, fixing request list iteration and
         fixing a race between device registration and udev device add
         notifiations.
      
       - Double free fix from cgroup writeback, from Tejun.
      
       - Another double free fix in blkcg, from Hou Tao.
      
       - Partition overflow fix for EFI from Alden Tondettar.
      
      * tag 'for-4.11/linus-merge-signed' of git://git.kernel.dk/linux-block: (156 commits)
        nvme: Check for Security send/recv support before issuing commands.
        block/sed-opal: allocate struct opal_dev dynamically
        block/sed-opal: tone down not supported warnings
        block: don't defer flushes on blk-mq + scheduling
        blk-mq-sched: ask scheduler for work, if we failed dispatching leftovers
        blk-mq: don't special case flush inserts for blk-mq-sched
        blk-mq-sched: don't add flushes to the head of requeue queue
        blk-mq: have blk_mq_dispatch_rq_list() return if we queued IO or not
        block: do not allow updates through sysfs until registration completes
        lightnvm: set default lun range when no luns are specified
        lightnvm: fix off-by-one error on target initialization
        Maintainers: Modify SED list from nvme to block
        Move stack parameters for sed_ioctl to prevent oversized stack with CONFIG_KASAN
        uapi: sed-opal fix IOW for activate lsp to use correct struct
        cdrom: Make device operations read-only
        elevator: fix loading wrong elevator type for blk-mq devices
        cciss: switch to pci_irq_alloc_vectors
        block/loop: fix race between I/O and set_status
        blk-mq-sched: don't hold queue_lock when calling exit_icq
        block: set make_request_fn manually in blk_mq_update_nr_hw_queues
        ...
      772c8f6f
    • M
      sched/core: Fix build paravirt build on arm and arm64 · fd4a61e0
      Mark Brown 提交于
      Commit 004172bd ("sched/core: Remove unnecessary #include headers")
      removed the inclusion of asm/paravirt.h which is used to get
      declarations of paravirt_steal_rq_enabled and paravirt_steal_clock.
      
      It is implicitly included on x86 but not on arm and arm64 breaking the
      build if paravirtualization is used.  Since things from that header are
      used directly fix the build by putting the direct inclusion back.
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fd4a61e0
  3. 21 2月, 2017 7 次提交
    • L
      Merge tag 'gfs2-4.11.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · 9763dd6f
      Linus Torvalds 提交于
      Pull GFS2 updates from Robert Peterson:
       "We've got eight GFS2 patches for this merge window:
      
         - Andy Price submitted a patch to make gfs2_write_full_page a static
           function.
      
         - Dan Carpenter submitted a patch to fix a ERR_PTR thinko.
      
        Three patches fix bugs related to deleting very large files, which
        cause GFS2 to run out of journal space:
      
         - The first one prevents GFS2 delete operation from requesting too
           much journal space.
      
         - The second one fixes a problem whereby GFS2 can hang because it
           wasn't taking journal space demand into its calculations.
      
         - The third one wakes up IO waiters when a flush is done to restart
           processes stuck waiting for journal space to become available.
      
        The final three patches are a performance improvement related to
        spin_lock contention between multiple writers:
      
         - The "tr_touched" variable was switched to a flag to be more atomic
           and eliminate the possibility of some races.
      
         - Function meta_lo_add was moved inline with its only caller to make
           the code more readable and efficient.
      
         - Contention on the gfs2_log_lock spinlock was greatly reduced by
           avoiding the lock altogether in cases where we don't really need
           it: buffers that already appear in the appropriate metadata list
           for the journal. Many thanks to Steve Whitehouse for the ideas and
           principles behind these patches"
      
      * tag 'gfs2-4.11.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: Make gfs2_write_full_page static
        GFS2: Reduce contention on gfs2_log_lock
        GFS2: Inline function meta_lo_add
        GFS2: Switch tr_touched to flag in transaction
        GFS2: Wake up io waiters whenever a flush is done
        GFS2: Made logd daemon take into account log demand
        GFS2: Limit number of transaction blocks requested for truncates
        GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next
      9763dd6f
    • L
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 70fcf5c3
      Linus Torvalds 提交于
      Pull UDF fixes and cleanups from Jan Kara:
       "Several small UDF fixes and cleanups and a small cleanup of fanotify
        code"
      
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        fanotify: simplify the code of fanotify_merge
        udf: simplify udf_ioctl()
        udf: fix ioctl errors
        udf: allow implicit blocksize specification during mount
        udf: check partition reference in udf_read_inode()
        udf: atomically read inode size
        udf: merge module informations in super.c
        udf: remove next_epos from udf_update_extent_cache()
        udf: Factor out trimming of crtime
        udf: remove empty condition
        udf: remove unneeded line break
        udf: merge bh free
        udf: use pointer for kernel_long_ad argument
        udf: use __packed instead of __attribute__ ((packed))
        udf: Make stat on symlink report symlink length as st_size
        fs/udf: make #ifdef UDF_PREALLOCATE unconditional
        fs: udf: Replace CURRENT_TIME with current_time()
      70fcf5c3
    • L
      Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6 · 2bfe01ef
      Linus Torvalds 提交于
      Pull CIFS/SMB3 updates from Steve French:
       "Includes support for a critical SMB3 security feature: per-share
        encryption from Pavel, and a cleanup from Jean Delvare.
      
        Will have another cifs/smb3 merge next week"
      
      * 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
        CIFS: Allow to switch on encryption with seal mount option
        CIFS: Add capability to decrypt big read responses
        CIFS: Decrypt and process small encrypted packets
        CIFS: Add copy into pages callback for a read operation
        CIFS: Add mid handle callback
        CIFS: Add transform header handling callbacks
        CIFS: Encrypt SMB3 requests before sending
        CIFS: Enable encryption during session setup phase
        CIFS: Add capability to transform requests before sending
        CIFS: Separate RFC1001 length processing for SMB2 read
        CIFS: Separate SMB2 sync header processing
        CIFS: Send RFC1001 length in a separate iov
        CIFS: Make send_cancel take rqst as argument
        CIFS: Make SendReceive2() takes resp iov
        CIFS: Separate SMB2 header structure
        CIFS: Fix splice read for non-cached files
        cifs: Add soft dependencies
        cifs: Only select the required crypto modules
        cifs: Simplify SMB2 and SMB311 dependencies
      2bfe01ef
    • L
      Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · cab7076a
      Linus Torvalds 提交于
      Pull ext4 updates from Ted Ts'o:
       "For this cycle we add support for the shutdown ioctl, which is
        primarily used for testing, but which can be useful on production
        systems when a scratch volume is being destroyed and the data on it
        doesn't need to be saved.
      
        This found (and we fixed) a number of bugs with ext4's recovery to
        corrupted file system --- the bugs increased the amount of data that
        could be potentially lost, and in the case of the inline data feature,
        could cause the kernel to BUG.
      
        Also included are a number of other bug fixes, including in ext4's
        fscrypt, DAX, inline data support"
      
      * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (26 commits)
        ext4: rename EXT4_IOC_GOINGDOWN to EXT4_IOC_SHUTDOWN
        ext4: fix fencepost in s_first_meta_bg validation
        ext4: don't BUG when truncating encrypted inodes on the orphan list
        ext4: do not use stripe_width if it is not set
        ext4: fix stripe-unaligned allocations
        dax: assert that i_rwsem is held exclusive for writes
        ext4: fix DAX write locking
        ext4: add EXT4_IOC_GOINGDOWN ioctl
        ext4: add shutdown bit and check for it
        ext4: rename s_resize_flags to s_ext4_flags
        ext4: return EROFS if device is r/o and journal replay is needed
        ext4: preserve the needs_recovery flag when the journal is aborted
        jbd2: don't leak modified metadata buffers on an aborted journal
        ext4: fix inline data error paths
        ext4: move halfmd4 into hash.c directly
        ext4: fix use-after-iput when fscrypt contexts are inconsistent
        jbd2: fix use after free in kjournald2()
        ext4: fix data corruption in data=journal mode
        ext4: trim allocation requests to group size
        ext4: replace BUG_ON with WARN_ON in mb_find_extent()
        ...
      cab7076a
    • L
      Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/fscrypt · 6c24337f
      Linus Torvalds 提交于
      Pull fscrypt updates from Ted Ts'o:
       "Various cleanups for the file system encryption feature"
      
      * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/fscrypt:
        fscrypt: constify struct fscrypt_operations
        fscrypt: properly declare on-stack completion
        fscrypt: split supp and notsupp declarations into their own headers
        fscrypt: remove redundant assignment of res
        fscrypt: make fscrypt_operations.key_prefix a string
        fscrypt: remove unused 'mode' member of fscrypt_ctx
        ext4: don't allow encrypted operations without keys
        fscrypt: make test_dummy_encryption require a keyring key
        fscrypt: factor out bio specific functions
        fscrypt: pass up error codes from ->get_context()
        fscrypt: remove user-triggerable warning messages
        fscrypt: use EEXIST when file already uses different policy
        fscrypt: use ENOTDIR when setting encryption policy on nondirectory
        fscrypt: use ENOKEY when file cannot be created w/o key
      6c24337f
    • L
      Merge tag 'device-properties-4.11-rc1' of... · 786856b6
      Linus Torvalds 提交于
      Merge tag 'device-properties-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
      
      Pull device property updates from Rafael J. Wysocki:
       "Generic device properties framework updates for v4.11-rc1
      
        Allow built-in (static) device properties to be declared as constant,
        make it possible to save memory by discarding alternative (but unused)
        built-in (static) property sets and add support for automatic handling
        of built-in properties to the I2C code"
      
      * tag 'device-properties-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        i2c: allow specify device properties in i2c_board_info
        device property: export code duplicating array of property entries
        device property: constify property arrays values
        device property: allow to constify properties
      786856b6
    • L
      Merge tag 'acpi-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 43e31e40
      Linus Torvalds 提交于
      Pull ACPI updates from Rafael Wysocki:
       "These update the ACPICA code in the kernel to upstream revision
        20170119, which among other things updates copyright notices in all of
        the ACPICA files, fix a couple of issues in the ACPI EC and button
        drivers, fix modalias handling for non-discoverable devices with
        DT-compatible identification strings, add a suspend quirk for one
        platform and fix a message in the APEI code.
      
        Specifics:
      
         - Update of the ACPICA code in the kernel to upstream revision
           20170119 including:
      
            + Fixes related to the handling of the bit width and bit offset
              fields in Generic Address Structure (Lv Zheng)
            + ACPI resources handling fix related to invalid resource
              descriptors (Bob Moore)
            + Fix to enable implicit result conversion for several ASL library
              functions (Bob Moore)
            + Support for method invocations as target operands in AML (Bob
              Moore)
            + Fix to use a correct operand type for DeRefOf() in some
              situations (Bob Moore)
            + Utilities updates (Bob Moore, Lv Zheng)
            + Disassembler/debugger updates (David Box, Lv Zheng)
            + Build fixes (Colin Ian King, Lv Zheng)
            + Update of copyright notices in all files (Bob Moore)
      
         - Fix for modalias handling for SPI and I2C devices with
           DT-compatible identification strings (Dan O'Donovan)
      
         - Fixes for the ACPI EC and button drivers (Lv Zheng)
      
         - ACPI processor handling fix related to CPU hotplug (online/offline)
           on x86 (Vitaly Kuznetsov)
      
         - Suspend quirk to save/restore NVS memory over S3 transitions for
           Lenovo G50-45 (Zhang Rui)
      
         - Message formatting fix for the ACPI APEI code (Colin Ian King)"
      
      * tag 'acpi-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits)
        ACPICA: Update version to 20170119
        ACPICA: Tools: Update common signon, remove compilation bit width
        ACPICA: Source tree: Update copyright notices to 2017
        ACPICA: Linuxize: Restore and fix Intel compiler build
        x86/ACPI: keep x86_cpu_to_acpiid mapping valid on CPU hotplug
        spi: acpi: Initialize modalias from of_compatible
        i2c: acpi: Initialize info.type from of_compatible
        ACPI / bus: Introduce acpi_of_modalias() equiv of of_modalias_node()
        ACPI: save NVS memory for Lenovo G50-45
        ACPI, APEI, EINJ: fix malformed newline escape
        ACPI / button: Remove lid_init_state=method mode
        ACPI / button: Change default behavior to lid_init_state=open
        ACPI / EC: Use busy polling mode when GPE is not enabled
        ACPI / EC: Remove old CLEAR_ON_RESUME quirk
        ACPICA: Update version to 20161222
        ACPICA: Parser: Update parse info table for some operators
        ACPICA: Fix a problem with recent extra support for control method invocations
        ACPICA: Parser: Allow method invocations as target operands
        ACPICA: Fix for implicit result conversion for the ToXXX functions
        ACPICA: Resources: Not a valid resource if buffer length too long
        ..
      43e31e40