1. 24 Jan, 2017 6 commits
    • Song Liu's avatar
      md/r5cache: disable write back for degraded array · 2e38a37f
      Song Liu authored
      write-back cache in degraded mode introduces corner cases to the array.
      Although we try to cover all these corner cases, it is safer to just
      disable write-back cache when the array is in degraded mode.
      
      In this patch, we disable writeback cache for degraded mode:
      1. On device failure, if the array enters degraded mode, raid5_error()
         will submit async job r5c_disable_writeback_async to disable
         writeback;
      2. In r5c_journal_mode_store(), it is invalid to enable writeback in
         degraded mode;
      3. In r5c_try_caching_write(), stripes with s->failed>0 will be handled
         in write-through mode.
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      2e38a37f
    • Song Liu's avatar
      md/r5cache: shift complex rmw from read path to write path · 07e83364
      Song Liu authored
      Write back cache requires a complex RMW mechanism, where old data is
      read into dev->orig_page for prexor, and then xor is done with
      dev->page. This logic is already implemented in the write path.
      
      However, current read path is not awared of this requirement. When
      the array is optimal, the RMW is not required, as the data are
      read from raid disks. However, when the target stripe is degraded,
      complex RMW is required to generate right data.
      
      To keep read path as clean as possible, we handle read path by
      flushing degraded, in-journal stripes before processing reads to
      missing dev.
      
      Specifically, when there is read requests to a degraded stripe
      with data in journal, handle_stripe_fill() calls
      r5c_make_stripe_write_out() and exits. Then handle_stripe_dirtying()
      will do the complex RMW and flush the stripe to RAID disks. After
      that, read requests are handled.
      
      There is one more corner case when there is non-overwrite bio for
      the missing (or out of sync) dev. handle_stripe_dirtying() will not
      be able to process the non-overwrite bios without constructing the
      data in handle_stripe_fill(). This is fixed by delaying non-overwrite
      bios in handle_stripe_dirtying(). So handle_stripe_fill() works on
      these bios after the stripe is flushed to raid disks.
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      07e83364
    • Song Liu's avatar
      md/r5cache: flush data only stripes in r5l_recovery_log() · a85dd7b8
      Song Liu authored
      For safer operation, all arrays start in write-through mode, which has been
      better tested and is more mature. And actually the write-through/write-mode
      isn't persistent after array restarted, so we always start array in
      write-through mode. However, if recovery found data-only stripes before the
      shutdown (from previous write-back mode), it is not safe to start the array in
      write-through mode, as write-through mode can not handle stripes with data in
      write-back cache. To solve this problem, we flush all data-only stripes in
      r5l_recovery_log(). When r5l_recovery_log() returns, the array starts with
      empty cache in write-through mode.
      
      This logic is implemented in r5c_recovery_flush_data_only_stripes():
      
      1. enable write back cache
      2. flush all stripes
      3. wake up conf->mddev->thread
      4. wait for all stripes get flushed (reuse wait_for_quiescent)
      5. disable write back cache
      
      The wait in 4 will be waked up in release_inactive_stripe_list()
      when conf->active_stripes reaches 0.
      
      It is safe to wake up mddev->thread here because all the resource
      required for the thread has been initialized.
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      a85dd7b8
    • Song Liu's avatar
      ba02684d
    • Song Liu's avatar
      md/r5cache: read data into orig_page for prexor of cached data · 86aa1397
      Song Liu authored
      With write back cache, we use orig_page to do prexor. This patch
      makes sure we read data into orig_page for it.
      
      Flag R5_OrigPageUPTDODATE is added to show whether orig_page
      has the latest data from raid disk.
      
      We introduce a helper function uptodate_for_rmw() to simplify
      the a couple conditions in handle_stripe_dirtying().
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      86aa1397
    • Shaohua Li's avatar
      md/raid5-cache: delete meaningless code · d46d29f0
      Shaohua Li authored
      sector_t is unsigned long, it's never < 0
      Reported-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      d46d29f0
  2. 12 Jan, 2017 7 commits
    • Linus Torvalds's avatar
      Merge tag 'sound-4.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 557ed56c
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "This time we got a few more fixes than the previous rc's, and most of
        commits were about ASoC.
      
        The only significant change in the core side is the regression fix wrt
        the aux device list handling, and all the rest are driver-specific
        small / trivial fixes"
      
      * tag 'sound-4.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: usb-audio: Add a quirk for Plantronics BT600
        ASoC: rt5645: set sel_i2s_pre_div1 to 2
        ASoC: dpcm: Avoid putting stream state to STOP when FE stream is paused
        ASoC: Intel: Skylake: Release FW ctx in cleanup
        ASoC: Intel: bytcr-rt5640: fix settings in internal clock mode
        ASoC: fsl_ssi: set fifo watermark to more reliable value
        ASoC: nau8825: fix invalid configuration in Pre-Scalar of FLL
        ASoC: nau8825: correct the function name of register
        ASoC: Intel: Skylake: Fix to fail safely if module not available in path
        ASoC: tlv320aic3x: Mark the RESET register as volatile
        ASoC: Fix binding and probing of auxiliary components
        ASoC: wm_adsp: Don't overrun firmware file buffer when reading region data
        ASoC: Intel: bytcr_rt5640: fallback mechanism if MCLK is not enabled
        ASoC: hdmi-codec: use unsigned type to structure members with bit-field
        ASoC: topology: kfree kcontrol->private_value before freeing kcontrol
        ASoC: rsnd: don't double free kctrl
        ASoC: dwc: Fix PIO mode initialization
      557ed56c
    • Linus Torvalds's avatar
      Merge tag 'xfs-for-linus-4.10-rc4-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · e28ac1fc
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
       "As promised last week, here's some stability fixes from Christoph and
        Jan Kara:
      
         - fix free space request handling when low on disk space
      
         - remove redundant log failure error messages
      
         - free truncated dirty pages instead of letting them build up
           forever"
      
      * tag 'xfs-for-linus-4.10-rc4-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: Timely free truncated dirty pages
        xfs: don't print warnings when xfs_log_force fails
        xfs: don't rely on ->total in xfs_alloc_space_available
        xfs: adjust allocation length in xfs_alloc_space_available
        xfs: fix bogus minleft manipulations
        xfs: bump up reserved blocks in xfs_alloc_set_aside
      e28ac1fc
    • Linus Torvalds's avatar
      Merge tag 'rproc-v4.10-fixes' of git://github.com/andersson/remoteproc · 9ca277eb
      Linus Torvalds authored
      Pull remoteproc fixes from Bjorn Andersson:
       "This fixes two regressions that have been reported to be introduced in
        v4.10-rc1.
      
         - correct an incorrect usage of the kref api
      
         - revert the change to make the resource table read-only. As the
           space each vdev resource is used as virtio device config space it
           must be shared with the remote"
      
      * tag 'rproc-v4.10-fixes' of git://github.com/andersson/remoteproc:
        Revert "remoteproc: Merge table_ptr and cached_table pointers"
        remoteproc: fix vdev reference management
      9ca277eb
    • Linus Torvalds's avatar
      Merge tag 'rpmsg-v4.10-fixes' of git://github.com/andersson/remoteproc · 1d865da7
      Linus Torvalds authored
      Pull rpmsg fixes from Bjorn Andersson:
       "This fixes a regression introduced in v4.10-rc1 that prohibits
        multiple channels with the same name but different endpoint addresses
        to be used"
      
      * tag 'rpmsg-v4.10-fixes' of git://github.com/andersson/remoteproc:
        rpmsg: virtio_rpmsg_bus: fix channel creation
      1d865da7
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid · 95ce1313
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
      
       - device descriptor length validation fix to hid-cypress driver from
         Greg
      
       - introduction of a short delay into i2c-hid, which is not really
         mandated by the spec, but fixes Asus Touchpads
      
       - Petzl USB connectable flashlight quirk from myself
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
        HID: i2c-hid: Add sleep between POWER ON and RESET
        HID: hid-cypress: validate length of report
        HID: ignore Petzl USB headlamp
      95ce1313
    • Linus Torvalds's avatar
      Merge branch 'scsi-target-for-v4.10' of... · cb38b453
      Linus Torvalds authored
      Merge branch 'scsi-target-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/bvanassche/linux
      
      Pull scsi target fixes from Bart Van Assche:
      
       - a series of bug fixes for the XCOPY implementation from David
         Disseldorp
      
       - one bug fix for the ibmvscsis driver, a driver that is used for
         communication between partitions on IBM POWER systems.
      
      * 'scsi-target-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/bvanassche/linux:
        ibmvscsis: Fix srp_transfer_data fail return code
        target: support XCOPY requests without parameters
        target: check for XCOPY parameter truncation
        target: use XCOPY segment descriptor CSCD IDs
        target: check XCOPY segment descriptor CSCD IDs
        target: simplify XCOPY wwn->se_dev lookup helper
        target: return UNSUPPORTED TARGET/SEGMENT DESC TYPE CODE sense
        target: bounds check XCOPY total descriptor list length
        target: bounds check XCOPY segment descriptor list
        target: use XCOPY TOO MANY TARGET DESCRIPTORS sense
        target: add XCOPY target/segment desc sense codes
      cb38b453
    • Linus Torvalds's avatar
      Merge tag 'md/4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md · 607ae5f2
      Linus Torvalds authored
      Pull md fixes from Shaohua Li:
       "Basically one fix for raid5 cache which is merged in this cycle,
        others are trival fixes"
      
      * tag 'md/4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md:
        md/raid5: Use correct IS_ERR() variation on pointer check
        md: cleanup mddev flag clear for takeover
        md/r5cache: fix spelling mistake on "recoverying"
        md/r5cache: assign conf->log before r5l_load_log()
        md/r5cache: simplify handling of sh->log_start in recovery
        md/raid5-cache: removes unnecessary write-through mode judgments
        md/raid10: Refactor raid10_make_request
        md/raid1: Refactor raid1_make_request
      607ae5f2
  3. 11 Jan, 2017 27 commits