1. 19 Jul, 2016 2 commits
  2. 13 Jun, 2016 19 commits
  3. 09 Jun, 2016 1 commit
    • Cong Wang's avatar
      md: use a mutex to protect a global list · 5b1f5bc3
      Cong Wang authored
      We saw a list corruption in the list all_detected_devices:
      
       WARNING: CPU: 16 PID: 226 at lib/list_debug.c:29 __list_add+0x3c/0xa9()
       list_add corruption. next->prev should be prev (ffff880859d58320), but was ffff880859ce74c0. (next=ffffffff81abfdb0).
       Modules linked in: ahci libahci libata sd_mod scsi_mod
       CPU: 16 PID: 226 Comm: kworker/u241:4 Not tainted 4.1.20 #1
       Hardware name: Dell Inc. PowerEdge C6220/04GD66, BIOS 2.2.3 11/07/2013
       Workqueue: events_unbound async_run_entry_fn
        0000000000000000 ffff880859a5baf8 ffffffff81502872 ffff880859a5bb48
        0000000000000009 ffff880859a5bb38 ffffffff810692a5 ffff880859ee8828
        ffffffff812ad02c ffff880859d58320 ffffffff81abfdb0 ffff880859eb90c0
       Call Trace:
        [<ffffffff81502872>] dump_stack+0x4d/0x63
        [<ffffffff810692a5>] warn_slowpath_common+0xa1/0xbb
        [<ffffffff812ad02c>] ? __list_add+0x3c/0xa9
        [<ffffffff81069305>] warn_slowpath_fmt+0x46/0x48
        [<ffffffff812ad02c>] __list_add+0x3c/0xa9
        [<ffffffff81406f28>] md_autodetect_dev+0x41/0x62
        [<ffffffff81285862>] rescan_partitions+0x25f/0x29d
        [<ffffffff81506372>] ? mutex_lock+0x13/0x31
        [<ffffffff811a090f>] __blkdev_get+0x1aa/0x3cd
        [<ffffffff811a0b91>] blkdev_get+0x5f/0x294
        [<ffffffff81377ceb>] ? put_device+0x17/0x19
        [<ffffffff8128227c>] ? disk_put_part+0x12/0x14
        [<ffffffff812836f3>] add_disk+0x29d/0x407
        [<ffffffff81384345>] ? __pm_runtime_use_autosuspend+0x5c/0x64
        [<ffffffffa004a724>] sd_probe_async+0x115/0x1af [sd_mod]
        [<ffffffff81083177>] async_run_entry_fn+0x72/0x12c
        [<ffffffff8107c44c>] process_one_work+0x198/0x2ce
        [<ffffffff8107cac7>] worker_thread+0x1dd/0x2bb
        [<ffffffff8107c8ea>] ? cancel_delayed_work_sync+0x15/0x15
        [<ffffffff8107c8ea>] ? cancel_delayed_work_sync+0x15/0x15
        [<ffffffff81080d9c>] kthread+0xae/0xb6
        [<ffffffff81080000>] ? param_array_set+0x40/0xfa
        [<ffffffff81080cee>] ? __kthread_parkme+0x61/0x61
        [<ffffffff81508152>] ret_from_fork+0x42/0x70
        [<ffffffff81080cee>] ? __kthread_parkme+0x61/0x61
      
      I suspect it is because there is no lock protecting this
      global list, autostart_arrays() is called in ioctl() path
      where there is no lock.
      
      Cc: Shaohua Li <shli@kernel.org>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      5b1f5bc3
  4. 03 Jun, 2016 2 commits
    • Guoqing Jiang's avatar
      db767672
    • Guoqing Jiang's avatar
      md-cluster: fix deadlock issue when add disk to an recoverying array · bb8bf15b
      Guoqing Jiang authored
      Add a disk to an array which is performing recovery
      is a little complicated, we need to do both reap the
      sync thread and perform add disk for the case, then
      it caused deadlock as follows.
      
      linux44:~ # ps aux|grep md|grep D
      root      1822  0.0  0.0      0     0 ?        D    16:50   0:00 [md127_resync]
      root      1848  0.0  0.0  19860   952 pts/0    D+   16:50   0:00 mdadm --manage /dev/md127 --re-add /dev/vdb
      linux44:~ # cat /proc/1848/stack
      [<ffffffff8107afde>] kthread_stop+0x6e/0x120
      [<ffffffffa051ddb0>] md_unregister_thread+0x40/0x80 [md_mod]
      [<ffffffffa0526e45>] md_reap_sync_thread+0x15/0x150 [md_mod]
      [<ffffffffa05271e0>] action_store+0x260/0x270 [md_mod]
      [<ffffffffa05206b4>] md_attr_store+0xb4/0x100 [md_mod]
      [<ffffffff81214a7e>] sysfs_write_file+0xbe/0x140
      [<ffffffff811a6b98>] vfs_write+0xb8/0x1e0
      [<ffffffff811a75b8>] SyS_write+0x48/0xa0
      [<ffffffff8152a5c9>] system_call_fastpath+0x16/0x1b
      [<00007f068ea1ed30>] 0x7f068ea1ed30
      linux44:~ # cat /proc/1822/stack
      [<ffffffffa05251a6>] md_do_sync+0x846/0xf40 [md_mod]
      [<ffffffffa052402d>] md_thread+0x16d/0x180 [md_mod]
      [<ffffffff8107ad94>] kthread+0xb4/0xc0
      [<ffffffff8152a518>] ret_from_fork+0x58/0x90
      
                              Task1848                                Task1822
      md_attr_store (held reconfig_mutex by call mddev_lock())
                              action_store
      			md_reap_sync_thread
      			md_unregister_thread
      			kthread_stop                    md_wakeup_thread(mddev->thread);
      						wait_event(mddev->sb_wait, !test_bit(MD_CHANGE_PENDING))
      
      md_check_recovery is triggered by wakeup mddev->thread,
      but it can't clear MD_CHANGE_PENDING flag since it can't
      get lock which was held by md_attr_store already.
      
      To solve the deadlock problem, we move "->resync_finish()"
      from md_do_sync to md_reap_sync_thread (after md_update_sb),
      also MD_HELD_RESYNC_LOCK is introduced since it is possible
      that node can't get resync lock in md_do_sync.
      
      Then we do not need to wait for MD_CHANGE_PENDING is cleared
      or not since metadata should be updated after md_update_sb,
      so just call resync_finish if MD_HELD_RESYNC_LOCK is set.
      
      We also unified the code after skip label, since set PENDING
      for non-clustered case should be harmless.
      Reviewed-by: default avatarNeilBrown <neilb@suse.com>
      Signed-off-by: default avatarGuoqing Jiang <gqjiang@suse.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      bb8bf15b
  5. 26 May, 2016 4 commits
    • Song Liu's avatar
      right meaning of PARITY_ENABLE_RMW and PARITY_PREFER_RMW · 41257580
      Song Liu authored
      In current handle_stripe_dirtying, the code prefers rmw with
      PARITY_ENABLE_RMW; while prefers rcw with PARITY_PREFER_RMW.
      
      This patch reverses this behavior.
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      41257580
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2f7c3a18
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Misc fixes: EFI, entry code, pkeys and MPX fixes, TASK_SIZE cleanups
        and a tsc frequency table fix"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm: Switch from TASK_SIZE to TASK_SIZE_MAX in the page fault code
        x86/fsgsbase/64: Use TASK_SIZE_MAX for FSBASE/GSBASE upper limits
        x86/mm/mpx: Work around MPX erratum SKD046
        x86/entry/64: Fix stack return address retrieval in thunk
        x86/efi: Fix 7-parameter efi_call()s
        x86/cpufeature, x86/mm/pkeys: Fix broken compile-time disabling of pkeys
        x86/tsc: Add missing Cherrytrail frequency to the table
      2f7c3a18
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f89eae4e
      Linus Torvalds authored
      Pull scheduler fixes from Ingo Molnar:
       "Two fixes: one for a lost wakeup, the other to fix the compiler
        optimizing out preempt operations on ARM64 (and possibly other non-x86
        architectures)"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/core: Fix remote wakeups
        sched/preempt: Fix preempt_count manipulations
      f89eae4e
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · bdc6b758
      Linus Torvalds authored
      Pull perf updates from Ingo Molnar:
       "Mostly tooling and PMU driver fixes, but also a number of late updates
        such as the reworking of the call-chain size limiting logic to make
        call-graph recording more robust, plus tooling side changes for the
        new 'backwards ring-buffer' extension to the perf ring-buffer"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (34 commits)
        perf record: Read from backward ring buffer
        perf record: Rename variable to make code clear
        perf record: Prevent reading invalid data in record__mmap_read
        perf evlist: Add API to pause/resume
        perf trace: Use the ptr->name beautifier as default for "filename" args
        perf trace: Use the fd->name beautifier as default for "fd" args
        perf report: Add srcline_from/to branch sort keys
        perf evsel: Record fd into perf_mmap
        perf evsel: Add overwrite attribute and check write_backward
        perf tools: Set buildid dir under symfs when --symfs is provided
        perf trace: Only auto set call-graph to "dwarf" when syscalls are being traced
        perf annotate: Sort list of recognised instructions
        perf annotate: Fix identification of ARM blt and bls instructions
        perf tools: Fix usage of max_stack sysctl
        perf callchain: Stop validating callchains by the max_stack sysctl
        perf trace: Fix exit_group() formatting
        perf top: Use machine->kptr_restrict_warned
        perf trace: Warn when trying to resolve kernel addresses with kptr_restrict=1
        perf machine: Do not bail out if not managing to read ref reloc symbol
        perf/x86/intel/p4: Trival indentation fix, remove space
        ...
      bdc6b758
  6. 25 May, 2016 12 commits
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c4a34600
      Linus Torvalds authored
      Pull objtool build fix from Ingo Molnar:
       "An libtool fix for older libelf versions"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        objtool: Allow building with older libelf
      c4a34600
    • Linus Torvalds's avatar
      Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 0985b65d
      Linus Torvalds authored
      Pull vfs iov_iter regression fix from Al Viro:
       "Fix for braino in 'fold checks into iterate_and_advance()'"
      
      * 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        do "fold checks into iterate_and_advance()" right
      0985b65d
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 55c1c7b2
      Linus Torvalds authored
      Pull vfs xattr regression fixes from Al Viro.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        make xattr_resolve_handlers() safe to use with NULL ->s_xattr
        xattr: Fail with -EINVAL for NULL attribute names
      55c1c7b2
    • Linus Torvalds's avatar
      Merge tag 'acpi-4.7-rc1-more' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · e92677df
      Linus Torvalds authored
      Pull ACPI fix from Rafael Wysocki:
       "Additional ACPI update for v4.7-rc1
      
        Just one fix for incorrect async_synchronize_cookie() usage in the
        ACPI battery driver (Chris Wilson)"
      
      * tag 'acpi-4.7-rc1-more' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI / battery: Correctly serialise with the pending async probe
      e92677df
    • Linus Torvalds's avatar
      Merge tag 'pm-4.7-rc1-more' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 877c057d
      Linus Torvalds authored
      Pull more power management updates from Rafael Wysocki:
       "These are two stable-candidate fixes (PM core, cpuidle) and a bunch of
        cpufreq cleanups.
      
        Specifics:
      
         - Stable-candidate cpuidle fix to make it check the right variable
           when deciding whether or not to enable interrupts on the local CPU
           so as to avoid enabling iterrupts too early in some cases if the
           system has both coupled and per-core idle states (Daniel Lezcano).
      
         - Stable-candidate PM core fix to make it handle failures at the
           "late suspend" stage of device suspend consistently for all devices
           regardless of whether or not async suspend/resume is enabled for
           them (Rafael Wysocki).
      
         - Cleanups in the cpufreq core, the schedutil governor and the
           intel_pstate driver (Rafael Wysocki, Pankaj Gupta, Viresh Kumar)"
      
      * tag 'pm-4.7-rc1-more' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        PM / sleep: Handle failures in device_suspend_late() consistently
        cpufreq: schedutil: Improve prints messages with pr_fmt
        cpuidle: Fix cpuidle_state_is_coupled() argument in cpuidle_enter()
        cpufreq: simplified goto out in cpufreq_register_driver()
        cpufreq: governor: CPUFREQ_GOV_STOP never fails
        cpufreq: governor: CPUFREQ_GOV_POLICY_EXIT never fails
        intel_pstate: Simplify conditional in intel_pstate_set_policy()
      877c057d
    • Al Viro's avatar
      do "fold checks into iterate_and_advance()" right · 19f18459
      Al Viro authored
      the only case when we should skip the iterate_and_advance() guts
      is when nothing's left in the iterator, _not_ just when requested
      amount is 0.  Said guts will do nothing in the latter case anyway;
      the problem we tried to deal with in the aforementioned commit is
      that when there's nothing left *and* the amount requested is 0,
      we might end up deferencing one iovec too many; the value we fetch
      from there is discarded in that case, but theoretically it might
      oops if the iovec array ends exactly at the end of page with the
      next page not mapped.
      
      Bailing out on zero size requested had an unexpected side effect -
      zero-length segment in the beginning of iovec array ended up
      throwing do_loop_readv_writev() into infinite spin; we do not
      advance past the empty segment at all.  Reproducer is trivial:
      echo '#include <sys/uio.h>' >a.c
      echo 'main() {char c; struct iovec v[] = {{&c,0},{&c,1}}; readv(0,v,2);}' >>a.c
      cc a.c && ./a.out </proc/uptime
      
      which should end up with the process not hanging.  Probably ought to
      go into LTP or xfstests...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      19f18459
    • Al Viro's avatar
    • Andreas Gruenbacher's avatar
      xattr: Fail with -EINVAL for NULL attribute names · aaf431b4
      Andreas Gruenbacher authored
      Commit 98e9cb57 improved the xattr name checks in xattr_resolve_name but
      didn't update the NULL attribute name check appropriately, so NULL
      attribute names lead to NULL pointer dereferences.  Turn that into
      -EINVAL results instead.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
        fs/xattr.c | 2 +-
        1 file changed, 1 insertion(+), 1 deletion(-)
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      aaf431b4
    • Rafael J. Wysocki's avatar
      Merge branch 'acpi-battery' · 0cc4b481
      Rafael J. Wysocki authored
      * acpi-battery:
        ACPI / battery: Correctly serialise with the pending async probe
      0cc4b481
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-cpufreq', 'pm-cpuidle' and 'pm-core' · 4c2628cd
      Rafael J. Wysocki authored
      * pm-cpufreq:
        cpufreq: schedutil: Improve prints messages with pr_fmt
        cpufreq: simplified goto out in cpufreq_register_driver()
        cpufreq: governor: CPUFREQ_GOV_STOP never fails
        cpufreq: governor: CPUFREQ_GOV_POLICY_EXIT never fails
        intel_pstate: Simplify conditional in intel_pstate_set_policy()
      
      * pm-cpuidle:
        cpuidle: Fix cpuidle_state_is_coupled() argument in cpuidle_enter()
      
      * pm-core:
        PM / sleep: Handle failures in device_suspend_late() consistently
      4c2628cd
    • Linus Torvalds's avatar
      Merge tag 'pwm/for-4.7-rc1' of... · ecc5fbd5
      Linus Torvalds authored
      Merge tag 'pwm/for-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
      
      Pull pwm updates from Thierry Reding:
       "This set of changes introduces an atomic API to the PWM subsystem.
        This is influenced by the DRM atomic API that was introduced a while
        back, though it is obviously a lot simpler.  The fundamental idea
        remains the same, though: drivers provide a single callback to
        implement the atomic configuration of a PWM channel.
      
        As a side-effect the PWM subsystem gains the ability for initial state
        retrieval, so that the logical state mirrors that of the hardware.
        Many use-cases don't care about this, but for others it is essential.
      
        These new features require changes in all users, which these patches
        take care of.  The core is transitioned to use the atomic callback if
        available and provides a fallback mechanism for other drivers.
      
        Changes to transition users and drivers to the atomic API are
        postponed to v4.8"
      
      * tag 'pwm/for-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (30 commits)
        pwm: Add information about polarity, duty cycle and period to debugfs
        pwm: Switch to the atomic API
        pwm: Update documentation
        pwm: Add core infrastructure to allow atomic updates
        pwm: Add hardware readout infrastructure
        pwm: Move the enabled/disabled info into pwm_state
        pwm: Introduce the pwm_state concept
        pwm: Keep PWM state in sync with hardware state
        ARM: Explicitly apply PWM config extracted from pwm_args
        drm: i915: Explicitly apply PWM config extracted from pwm_args
        input: misc: pwm-beeper: Explicitly apply PWM config extracted from pwm_args
        input: misc: max8997: Explicitly apply PWM config extracted from pwm_args
        backlight: lm3630a: explicitly apply PWM config extracted from pwm_args
        backlight: lp855x: Explicitly apply PWM config extracted from pwm_args
        backlight: lp8788: Explicitly apply PWM config extracted from pwm_args
        backlight: pwm_bl: Use pwm_get_args() where appropriate
        fbdev: ssd1307fb: Use pwm_get_args() where appropriate
        regulator: pwm: Use pwm_get_args() where appropriate
        leds: pwm: Use pwm_get_args() where appropriate
        input: misc: max77693: Use pwm_get_args() where appropriate
        ...
      ecc5fbd5
    • Linus Torvalds's avatar
      Merge git://www.linux-watchdog.org/linux-watchdog · 1f93d2ab
      Linus Torvalds authored
      Pull watchdog updates from Wim Van Sebroeck:
      
       - add support for Fintek F81865 Super-IO chip
      
       - add support for watchdogs (RWDT and SWDT) found on RCar Gen3 based
         SoCs from Renesas
      
       - octeon: Handle the FROZEN hot plug notifier actions
      
       - f71808e_wdt fixes and cleanups
      
       - some small improvements in code and documentation
      
      * git://www.linux-watchdog.org/linux-watchdog:
        MAINTAINERS: Add file patterns for watchdog device tree bindings
        Documentation: Add ebc-c384_wdt watchdog-parameters.txt entry
        watchdog: shwdt: Use setup_timer()
        watchdog: cpwd: Use setup_timer()
        arm64: defconfig: enable Renesas Watchdog Timer
        watchdog: renesas-wdt: add driver
        watchdog: remove error message when unable to allocate watchdog device
        watchdog: f71808e_wdt: Fix WDTMOUT_STS register read
        watchdog: f71808e_wdt: Fix typo
        watchdog: f71808e_wdt: Add F81865 support
        watchdog: sp5100_tco: properly check for new register layouts
        watchdog: core: Fix circular locking dependency
        watchdog: core: fix trivial typo in a comment
        watchdog: hpwdt: Adjust documentation to match latest kernel module parameters.
        watchdog: imx2_wdt: add external reset support via dt prop
        watchdog: octeon: Handle the FROZEN hot plug notifier actions.
        watchdog: qcom: Report reboot reason
      1f93d2ab