1. 09 4月, 2015 2 次提交
    • B
      Defer processing of REQ_PREEMPT requests for blocked devices · bba0bdd7
      Bart Van Assche 提交于
      SCSI transport drivers and SCSI LLDs block a SCSI device if the
      transport layer is not operational. This means that in this state
      no requests should be processed, even if the REQ_PREEMPT flag has
      been set. This patch avoids that a rescan shortly after a cable
      pull sporadically triggers the following kernel oops:
      
      BUG: unable to handle kernel paging request at ffffc9001a6bc084
      IP: [<ffffffffa04e08f2>] mlx4_ib_post_send+0xd2/0xb30 [mlx4_ib]
      Process rescan-scsi-bus (pid: 9241, threadinfo ffff88053484a000, task ffff880534aae100)
      Call Trace:
       [<ffffffffa0718135>] srp_post_send+0x65/0x70 [ib_srp]
       [<ffffffffa071b9df>] srp_queuecommand+0x1cf/0x3e0 [ib_srp]
       [<ffffffffa0001ff1>] scsi_dispatch_cmd+0x101/0x280 [scsi_mod]
       [<ffffffffa0009ad1>] scsi_request_fn+0x411/0x4d0 [scsi_mod]
       [<ffffffff81223b37>] __blk_run_queue+0x27/0x30
       [<ffffffff8122a8d2>] blk_execute_rq_nowait+0x82/0x110
       [<ffffffff8122a9c2>] blk_execute_rq+0x62/0xf0
       [<ffffffffa000b0e8>] scsi_execute+0xe8/0x190 [scsi_mod]
       [<ffffffffa000b2f3>] scsi_execute_req+0xa3/0x130 [scsi_mod]
       [<ffffffffa000c1aa>] scsi_probe_lun+0x17a/0x450 [scsi_mod]
       [<ffffffffa000ce86>] scsi_probe_and_add_lun+0x156/0x480 [scsi_mod]
       [<ffffffffa000dc2f>] __scsi_scan_target+0xdf/0x1f0 [scsi_mod]
       [<ffffffffa000dfa3>] scsi_scan_host_selected+0x183/0x1c0 [scsi_mod]
       [<ffffffffa000edfb>] scsi_scan+0xdb/0xe0 [scsi_mod]
       [<ffffffffa000ee13>] store_scan+0x13/0x20 [scsi_mod]
       [<ffffffff811c8d9b>] sysfs_write_file+0xcb/0x160
       [<ffffffff811589de>] vfs_write+0xce/0x140
       [<ffffffff81158b53>] sys_write+0x53/0xa0
       [<ffffffff81464592>] system_call_fastpath+0x16/0x1b
       [<00007f611c9d9300>] 0x7f611c9d92ff
      Reported-by: NMax Gurtuvoy <maxg@mellanox.com>
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NMike Christie <michaelc@cs.wisc.edu>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      bba0bdd7
    • J
      be2iscsi: Fix kernel panic when device initialization fails · 2e7cee02
      John Soni Jose 提交于
      Kernel panic was happening as iscsi_host_remove() was called on
      a host which was not yet added.
      Signed-off-by: NJohn Soni Jose <sony.john-n@emulex.com>
      Reviewed-by: NMike Christie <michaelc@cs.wisc.edu>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      2e7cee02
  2. 31 3月, 2015 1 次提交
    • J
      enclosure: fix WARN_ON removing an adapter in multi-path devices · 11e52a69
      James Bottomley 提交于
      We have peculiar problems with multi-path and enclosures: physically, we know
      each bay can only be occupied by a single disk device.  However in multi-path,
      it appears we have many (because each path to the device appears in Linux as a
      different kernel device).  We try to fix this by only having the last seen
      device show up in the bay.
      
      Sysfs gets very annoyed if we try to manipulate links when the kobject sysfs
      directory (kobj.sd) doesn't exist and drops a huge WARN_ON which most users
      panic and report an oops for.  This happens on a few path removal situations
      and IBM reports seeing it when one of their multi-path adapters is removed.
      
      Add a check to enclosure device removal for the existence the sysfs directory
      containing both the forward and back links so that the remnants (if any) get
      removed in either direction but no scary warnings are dumped.
      Reported-by: NWen Xiong <wenxiong@linux.vnet.ibm.com>
      Tested-by: NWen Xiong <wenxiong@linux.vnet.ibm.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      11e52a69
  3. 07 3月, 2015 1 次提交
    • J
      libsas: Fix Kernel Crash in smp_execute_task · 6302ce4d
      James Bottomley 提交于
      This crash was reported:
      
      [  366.947370] sd 3:0:1:0: [sdb] Spinning up disk....
      [  368.804046] BUG: unable to handle kernel NULL pointer dereference at           (null)
      [  368.804072] IP: [<ffffffff81358457>] __mutex_lock_common.isra.7+0x9c/0x15b
      [  368.804098] PGD 0
      [  368.804114] Oops: 0002 [#1] SMP
      [  368.804143] CPU 1
      [  368.804151] Modules linked in: sg netconsole s3g(PO) uinput joydev hid_multitouch usbhid hid snd_hda_codec_via cpufreq_userspace cpufreq_powersave cpufreq_stats uhci_hcd cpufreq_conservative snd_hda_intel snd_hda_codec snd_hwdep snd_pcm sdhci_pci snd_page_alloc sdhci snd_timer snd psmouse evdev serio_raw pcspkr soundcore xhci_hcd shpchp s3g_drm(O) mvsas mmc_core ahci libahci drm i2c_core acpi_cpufreq mperf video processor button thermal_sys dm_dmirror exfat_fs exfat_core dm_zcache dm_mod padlock_aes aes_generic padlock_sha iscsi_target_mod target_core_mod configfs sswipe libsas libata scsi_transport_sas picdev via_cputemp hwmon_vid fuse parport_pc ppdev lp parport autofs4 ext4 crc16 mbcache jbd2 sd_mod crc_t10dif usb_storage scsi_mod ehci_hcd usbcore usb_common
      [  368.804749]
      [  368.804764] Pid: 392, comm: kworker/u:3 Tainted: P        W  O 3.4.87-logicube-ng.22 #1 To be filled by O.E.M. To be filled by O.E.M./EPIA-M920
      [  368.804802] RIP: 0010:[<ffffffff81358457>]  [<ffffffff81358457>] __mutex_lock_common.isra.7+0x9c/0x15b
      [  368.804827] RSP: 0018:ffff880117001cc0  EFLAGS: 00010246
      [  368.804842] RAX: 0000000000000000 RBX: ffff8801185030d0 RCX: ffff88008edcb420
      [  368.804857] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff8801185030d4
      [  368.804873] RBP: ffff8801181531c0 R08: 0000000000000020 R09: 00000000fffffffe
      [  368.804885] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801185030d4
      [  368.804899] R13: 0000000000000002 R14: ffff880117001fd8 R15: ffff8801185030d8
      [  368.804916] FS:  0000000000000000(0000) GS:ffff88011fc80000(0000) knlGS:0000000000000000
      [  368.804931] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [  368.804946] CR2: 0000000000000000 CR3: 000000000160b000 CR4: 00000000000006e0
      [  368.804962] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  368.804978] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [  368.804995] Process kworker/u:3 (pid: 392, threadinfo ffff880117000000, task ffff8801181531c0)
      [  368.805009] Stack:
      [  368.805017]  ffff8801185030d8 0000000000000000 ffffffff8161ddf0 ffffffff81056f7c
      [  368.805062]  000000000000b503 ffff8801185030d0 ffff880118503000 0000000000000000
      [  368.805100]  ffff8801185030d0 ffff8801188b8000 ffff88008edcb420 ffffffff813583ac
      [  368.805135] Call Trace:
      [  368.805153]  [<ffffffff81056f7c>] ? up+0xb/0x33
      [  368.805168]  [<ffffffff813583ac>] ? mutex_lock+0x16/0x25
      [  368.805194]  [<ffffffffa018c414>] ? smp_execute_task+0x4e/0x222 [libsas]
      [  368.805217]  [<ffffffffa018ce1c>] ? sas_find_bcast_dev+0x3c/0x15d [libsas]
      [  368.805240]  [<ffffffffa018ce4f>] ? sas_find_bcast_dev+0x6f/0x15d [libsas]
      [  368.805264]  [<ffffffffa018e989>] ? sas_ex_revalidate_domain+0x37/0x2ec [libsas]
      [  368.805280]  [<ffffffff81355a2a>] ? printk+0x43/0x48
      [  368.805296]  [<ffffffff81359a65>] ? _raw_spin_unlock_irqrestore+0xc/0xd
      [  368.805318]  [<ffffffffa018b767>] ? sas_revalidate_domain+0x85/0xb6 [libsas]
      [  368.805336]  [<ffffffff8104e5d9>] ? process_one_work+0x151/0x27c
      [  368.805351]  [<ffffffff8104f6cd>] ? worker_thread+0xbb/0x152
      [  368.805366]  [<ffffffff8104f612>] ? manage_workers.isra.29+0x163/0x163
      [  368.805382]  [<ffffffff81052c4e>] ? kthread+0x79/0x81
      [  368.805399]  [<ffffffff8135fea4>] ? kernel_thread_helper+0x4/0x10
      [  368.805416]  [<ffffffff81052bd5>] ? kthread_flush_work_fn+0x9/0x9
      [  368.805431]  [<ffffffff8135fea0>] ? gs_change+0x13/0x13
      [  368.805442] Code: 83 7d 30 63 7e 04 f3 90 eb ab 4c 8d 63 04 4c 8d 7b 08 4c 89 e7 e8 fa 15 00 00 48 8b 43 10 4c 89 3c 24 48 89 63 10 48 89 44 24 08 <48> 89 20 83 c8 ff 48 89 6c 24 10 87 03 ff c8 74 35 4d 89 ee 41
      [  368.805851] RIP  [<ffffffff81358457>] __mutex_lock_common.isra.7+0x9c/0x15b
      [  368.805877]  RSP <ffff880117001cc0>
      [  368.805886] CR2: 0000000000000000
      [  368.805899] ---[ end trace b720682065d8f4cc ]---
      
      It's directly caused by 89d3cf6a [SCSI] libsas: add mutex for SMP task
      execution, but shows a deeper cause: expander functions expect to be able to
      cast to and treat domain devices as expanders.  The correct fix is to only do
      expander discover when we know we've got an expander device to avoid wrongly
      casting a non-expander device.
      Reported-by: NPraveen Murali <pmurali@logicube.com>
      Tested-by: NPraveen Murali <pmurali@logicube.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      6302ce4d
  4. 04 3月, 2015 2 次提交
    • L
      Linux 4.0-rc2 · 13a7a6ac
      Linus Torvalds 提交于
      13a7a6ac
    • D
      drm/i915: Fix modeset state confusion in the load detect code · 9128b040
      Daniel Vetter 提交于
      This is a tricky story of the new atomic state handling and the legacy
      code fighting over each another. The bug at hand is an underrun of the
      framebuffer reference with subsequent hilarity caused by the load
      detect code. Which is peculiar since the the exact same code works
      fine as the implementation of the legacy setcrtc ioctl.
      
      Let's look at the ingredients:
      
      - Currently our code is a crazy mix of legacy modeset interfaces to
        set the parameters and half-baked atomic state tracking underneath.
        While this transition is going we're using the transitional plane
        helpers to update the atomic side (drm_plane_helper_disable/update
        and friends), i.e. plane->state->fb. Since the state structure owns
        the fb those functions take care of that themselves.
      
        The legacy state (specifically crtc->primary->fb) is still managed
        by the old code (and mostly by the drm core), with the fb reference
        counting done by callers (core drm for the ioctl or the i915 load
        detect code). The relevant commit is
      
        commit ea2c67bb
        Author: Matt Roper <matthew.d.roper@intel.com>
        Date:   Tue Dec 23 10:41:52 2014 -0800
      
            drm/i915: Move to atomic plane helpers (v9)
      
      - drm_plane_helper_disable has special code to handle multiple calls
        in a row - it checks plane->crtc == NULL and bails out. This is to
        match the proper atomic implementation which needs the crtc to get
        at the implied locking context atomic updates always need. See
      
        commit acf24a39
        Author: Daniel Vetter <daniel.vetter@ffwll.ch>
        Date:   Tue Jul 29 15:33:05 2014 +0200
      
            drm/plane-helper: transitional atomic plane helpers
      
      - The universal plane code split out the implicit primary plane from
        the CRTC into it's own full-blown drm_plane object. As part of that
        the setcrtc ioctl (which updated both the crtc mode and primary
        plane) learned to set crtc->primary->crtc on modeset to make sure
        the plane->crtc assignments statate up to date in
      
        commit e13161af
        Author: Matt Roper <matthew.d.roper@intel.com>
        Date:   Tue Apr 1 15:22:38 2014 -0700
      
            drm: Add drm_crtc_init_with_planes() (v2)
      
        Unfortunately we've forgotten to update the load detect code. Which
        wasn't a problem since the load detect modeset is temporary and
        always undone before we drop the locks.
      
      - Finally there is a organically grown history (i.e. don't ask) around
        who sets the legacy plane->fb for the various driver entry points.
        Originally updating that was the drivers duty, but for almost all
        places we've moved that (plus updating the refcounts) into the core.
        Again the exception is the load detect code.
      
      Taking all together the following happens:
      - The load detect code doesn't set crtc->primary->crtc. This is only
        really an issue on crtcs never before used or when userspace
        explicitly disabled the primary plane.
      
      - The plane helper glue code short-circuits because of that and leaves
        a non-NULL fb behind in plane->state->fb and plane->fb. The state
        fb isn't a real problem (it's properly refcounted on its own), it's
        just the canary.
      
      - Load detect code drops the reference for that fb, but doesn't set
        plane->fb = NULL. This is ok since it's still living in that old
        world where drivers had to clear the pointer but the core/callers
        handled the refcounting.
      
      - On the next modeset the drm core notices plane->fb and takes care of
        refcounting it properly by doing another unref. This drops the
        refcount to zero, leaving state->plane now pointing at freed memory.
      
      - intel_plane_duplicate_state still assume it owns a reference to that
        very state->fb and bad things start to happen.
      
      Fix this all by applying the same duct-tape as for the legacy setcrtc
      ioctl code and set crtc->primary->crtc properly.
      
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Paul Bolle <pebolle@tiscali.nl>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Reported-and-tested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Reported-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9128b040
  5. 03 3月, 2015 4 次提交
    • L
      Merge tag 'gpio-v4.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio · 023a6007
      Linus Torvalds 提交于
      Pull GPIO fixes from Linus Walleij:
       "Two GPIO fixes:
      
         - Fix a translation problem in of_get_named_gpiod_flags()
      
         - Fix a long standing container_of() mistake in the TPS65912 driver"
      
      * tag 'gpio-v4.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
        gpio: tps65912: fix wrong container_of arguments
        gpiolib: of: allow of_gpiochip_find_and_xlate to find more than one chip per node
      023a6007
    • L
      Merge branch 'fixes-for-4.0-rc2' of... · 10d6dfc1
      Linus Torvalds 提交于
      Merge branch 'fixes-for-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal
      
      Pull thermal management fixes from Eduardo Valentin:
       "Specifics:
      
         - Several fixes in tmon tool.
      
         - Fixes in intel int340x for _ART and _TRT tables.
      
         - Add id for Avoton SoC into powerclamp driver.
      
         - Fixes in RCAR thermal driver to remove race conditions and fix fail
           path
      
         - Fixes in TI thermal driver: removal of unnecessary code and build
           fix if !CONFIG_PM_SLEEP
      
         - Cleanups in exynos thermal driver
      
         - Add stubs for include/linux/thermal.h.  Now drivers using thermal
           calls but that also work without CONFIG_THERMAL will be able to
           compile for systems that don't care about thermal.
      
        Note: I am sending this pull on Rui's behalf while he fixes issues in
        his Linux box"
      
      * 'fixes-for-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal:
        thermal: int340x_thermal: Ignore missing _ART, _TRT tables
        thermal/intel_powerclamp: add id for Avoton SoC
        tools/thermal: tmon: silence 'set but not used' warnings
        tools/thermal: tmon: use pkg-config to determine library dependencies
        tools/thermal: tmon: support cross-compiling
        tools/thermal: tmon: add .gitignore
        tools/thermal: tmon: fixup tui windowing calculations
        tools/thermal: tmon: tui: don't hard-code dialog window size assumptions
        tools/thermal: tmon: add min/max macros
        tools/thermal: tmon: add --target-temp parameter
        thermal: exynos: Clean-up code to use oneline entry for exynos compatible table
        thermal: rcar: Make error and remove paths symmetrical with init
        thermal: rcar: Fix race condition between init and interrupt
        thermal: Introduce dummy functions when thermal is not defined
        ti-soc-thermal: Delete an unnecessary check before the function call "cpufreq_cooling_unregister"
        thermal: ti-soc-thermal: bandgap: Fix build warning if !CONFIG_PM_SLEEP
      10d6dfc1
    • L
      Merge tag 'md/4.0-fixes' of git://neil.brown.name/md · 1a6f77ab
      Linus Torvalds 提交于
      Pull md fixes from Neil Brown:
       "Three md fixes:
      
         - fix a read-balance problem that was reported 2 years ago, but that
           I never noticed the report :-(
      
         - fix for rare RAID6 problem causing incorrect bitmap updates when
           two devices fail.
      
         - add __ATTR_PREALLOC annotation now that it is possible"
      
      * tag 'md/4.0-fixes' of git://neil.brown.name/md:
        md: mark some attributes as pre-alloc
        raid5: check faulty flag for array status during recovery.
        md/raid1: fix read balance when a drive is write-mostly.
      1a6f77ab
    • L
      Merge tag 'metag-fixes-v4.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/metag · 49db1f0e
      Linus Torvalds 提交于
      Pull arch/metag fix from James Hogan:
       "This is just a single patch to fix the KSTK_EIP() and KSTK_ESP()
        macros for metag which have always been erronously returning the PC
        and stack pointer of the task's kernel context rather than from its
        user context saved at entry from userland into the kernel, which
        affects the contents of /proc/<pid>/maps and /proc/<pid>/stat"
      
      * tag 'metag-fixes-v4.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/metag:
        metag: Fix KSTK_EIP() and KSTK_ESP() macros
      49db1f0e
  6. 02 3月, 2015 5 次提交
  7. 01 3月, 2015 18 次提交
    • S
      locking/rtmutex: Set state back to running on error · 9d3e2d02
      Sebastian Andrzej Siewior 提交于
      The "usual" path is:
      
       - rt_mutex_slowlock()
       - set_current_state()
       - task_blocks_on_rt_mutex() (ret 0)
       - __rt_mutex_slowlock()
         - sleep or not but do return with __set_current_state(TASK_RUNNING)
       - back to caller.
      
      In the early error case where task_blocks_on_rt_mutex() return
      -EDEADLK we never change the task's state back to RUNNING. I
      assume this is intended. Without this change after ww_mutex
      using rt_mutex the selftest passes but later I get plenty of:
      
        | bad: scheduling from the idle thread!
      
      backtraces.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Acked-by: NMike Galbraith <umgwanakikbuti@gmail.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: afffc6c1 ("locking/rtmutex: Optimize setting task running after being blocked")
      Link: http://lkml.kernel.org/r/1425056229-22326-4-git-send-email-bigeasy@linutronix.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
      9d3e2d02
    • L
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · ae1aa797
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "Just general fixes: radeon, i915, atmel, tegra, amdkfd and one core
        fix"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (28 commits)
        drm: atmel-hlcdc: remove clock polarity from crtc driver
        drm/radeon: only enable DP audio if the monitor supports it
        drm/radeon: fix atom aux payload size check for writes (v2)
        drm/radeon: fix 1 RB harvest config setup for TN/RL
        drm/radeon: enable SRBM timeout interrupt on EG/NI
        drm/radeon: enable SRBM timeout interrupt on SI
        drm/radeon: enable SRBM timeout interrupt on CIK v2
        drm/radeon: dump full IB if we hit a packet error
        drm/radeon: disable mclk switching with 120hz+ monitors
        drm/radeon: use drm_mode_vrefresh() rather than mode->vrefresh
        drm/radeon: enable native backlight control on old macs
        drm/i915: Fix frontbuffer false positve.
        drm/i915: Align initial plane backing objects correctly
        drm/i915: avoid processing spurious/shared interrupts in low-power states
        drm/i915: Check obj->vma_list under the struct_mutex
        drm/i915: Fix a use after free, and unbalanced refcounting
        drm: atmel-hlcdc: remove useless pm_runtime_put_sync in probe
        drm: atmel-hlcdc: reset layer A2Q and UPDATE bits when disabling it
        drm: Fix deadlock due to getconnector locking changes
        drm/i915: Dell Chromebook 11 has PWM backlight
        ...
      ae1aa797
    • L
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · a015d33c
      Linus Torvalds 提交于
      Pull block layer fixes from Jens Axboe:
       "Two smaller fixes for this cycle:
      
         - A fixup from Keith so that NVMe compiles without BLK_INTEGRITY,
           basically just moving the code around appropriately.
      
         - A fixup for shm, fixing an oops in shmem_mapping() for mapping with
           no inode.  From Sasha"
      
      [ The shmem fix doesn't look block-layer-related, but fixes a bug that
        happened due to the backing_dev_info removal..  - Linus ]
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        mm: shmem: check for mapping owner before dereferencing
        NVMe: Fix for BLK_DEV_INTEGRITY not set
      a015d33c
    • L
      Merge tag 'xfs-for-linus-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs · 2aaeb784
      Linus Torvalds 提交于
      Pull xfs fixes from Dave Chinner:
       "These are fixes for regressions/bugs introduced in the 4.0 merge cycle
        and problems discovered during the merge window that need to be pushed
        back to stable kernels ASAP.
      
        This contains:
         - ensure quota type is reset in on-disk dquots
         - fix missing partial EOF block data flush on truncate extension
         - fix transaction leak in error handling for new pnfs block layout
           support
         - add missing target_ip check to RENAME_EXCHANGE"
      
      * tag 'xfs-for-linus-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs:
        xfs: cancel failed transaction in xfs_fs_commit_blocks()
        xfs: Ensure we have target_ip for RENAME_EXCHANGE
        xfs: ensure truncate forces zeroed blocks to disk
        xfs: Fix quota type in quota structures when reusing quota file
      2aaeb784
    • L
      Merge branch 'akpm' (patches from Andrew) · e9738946
      Linus Torvalds 提交于
      Merge misc fixes from Andrew Morton:
       "13 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm: add missing __PAGETABLE_{PUD,PMD}_FOLDED defines
        mm: page_alloc: revert inadvertent !__GFP_FS retry behavior change
        kernel/sys.c: fix UNAME26 for 4.0
        mm: memcontrol: use "max" instead of "infinity" in control knobs
        zram: use proper type to update max_used_pages
        drivers/rtc/rtc-ds1685.c: fix conditional in ds1685_rtc_sysfs_time_regs_{show,store}
        nilfs2: fix potential memory overrun on inode
        scripts/gdb: add empty package initialization script
        rtc: ds1685: remove superfluous checks for out-of-range u8 values
        rtc: ds1685: fix ds1685_rtc_alarm_irq_enable build error
        memcg: fix low limit calculation
        mm/nommu: fix memory leak
        ocfs2: update web page + git tree in documentation
      e9738946
    • K
      mm: add missing __PAGETABLE_{PUD,PMD}_FOLDED defines · c07af4f1
      Kirill A. Shutemov 提交于
      Core mm expects __PAGETABLE_{PUD,PMD}_FOLDED to be defined if these page
      table levels folded.  Usually, these defines are provided by
      <asm-generic/pgtable-nopmd.h> and <asm-generic/pgtable-nopud.h>.
      
      But some architectures fold page table levels in a custom way.  They
      need to define these macros themself.  This patch adds missing defines.
      
      The patch fixes mm->nr_pmds underflow and eliminates dead __pmd_alloc()
      and __pud_alloc() on architectures without these page table levels.
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c07af4f1
    • J
      mm: page_alloc: revert inadvertent !__GFP_FS retry behavior change · cc873177
      Johannes Weiner 提交于
      Historically, !__GFP_FS allocations were not allowed to invoke the OOM
      killer once reclaim had failed, but nevertheless kept looping in the
      allocator.
      
      Commit 9879de73 ("mm: page_alloc: embed OOM killing naturally into
      allocation slowpath"), which should have been a simple cleanup patch,
      accidentally changed the behavior to aborting the allocation at that
      point.  This creates problems with filesystem callers (?) that currently
      rely on the allocator waiting for other tasks to intervene.
      
      Revert the behavior as it shouldn't have been changed as part of a
      cleanup patch.
      
      Fixes: 9879de73 ("mm: page_alloc: embed OOM killing naturally into allocation slowpath")
      Signed-off-by: NJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: NMichal Hocko <mhocko@suse.cz>
      Reported-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: Dave Chinner <david@fromorbit.com>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: <stable@vger.kernel.org>	[3.19.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cc873177
    • J
      kernel/sys.c: fix UNAME26 for 4.0 · 39afb5ee
      Jon DeVree 提交于
      There's a uname workaround for broken userspace which can't handle kernel
      versions of 3.x.  Update it for 4.x.
      Signed-off-by: NJon DeVree <nuxi@vault24.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      39afb5ee
    • J
      mm: memcontrol: use "max" instead of "infinity" in control knobs · d2973697
      Johannes Weiner 提交于
      The memcg control knobs indicate the highest possible value using the
      symbolic name "infinity", which is long and awkward to type.
      
      Switch to the string "max", which is just as descriptive but shorter and
      sweeter.
      
      This changes a user interface, so do it before the release and before
      the development flag is dropped from the default hierarchy.
      Signed-off-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Vladimir Davydov <vdavydov@parallels.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d2973697
    • J
      zram: use proper type to update max_used_pages · 2ea55a2c
      Joonsoo Kim 提交于
      max_used_pages is defined as atomic_long_t so we need to use unsigned
      long to keep temporary value for it rather than int which is smaller
      than unsigned long in a 64 bit system.
      Signed-off-by: NJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2ea55a2c
    • J
      drivers/rtc/rtc-ds1685.c: fix conditional in ds1685_rtc_sysfs_time_regs_{show,store} · b00eeaed
      Joshua Kinard 提交于
      Fix a conditional statement checking for NULL in both
      ds1685_rtc_sysfs_time_regs_show and ds1685_rtc_sysfs_time_regs_store
      that was using a logical AND when it should be using a logical OR so
      that we fail out of the function properly if the condition ever
      evaluates to true.
      
      Fixes: aaaf5fbf ("rtc: add driver for DS1685 family of real time clocks")
      Signed-off-by: NJoshua Kinard <kumba@gentoo.org>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b00eeaed
    • R
      nilfs2: fix potential memory overrun on inode · 957ed60b
      Ryusuke Konishi 提交于
      Each inode of nilfs2 stores a root node of a b-tree, and it turned out to
      have a memory overrun issue:
      
      Each b-tree node of nilfs2 stores a set of key-value pairs and the number
      of them (in "bn_nchildren" member of nilfs_btree_node struct), as well as
      a few other "bn_*" members.
      
      Since the value of "bn_nchildren" is used for operations on the key-values
      within the b-tree node, it can cause memory access overrun if a large
      number is incorrectly set to "bn_nchildren".
      
      For instance, nilfs_btree_node_lookup() function determines the range of
      binary search with it, and too large "bn_nchildren" leads
      nilfs_btree_node_get_key() in that function to overrun.
      
      As for intermediate b-tree nodes, this is prevented by a sanity check
      performed when each node is read from a drive, however, no sanity check
      has been done for root nodes stored in inodes.
      
      This patch fixes the issue by adding missing sanity check against b-tree
      root nodes so that it's called when on-memory inodes are read from ifile,
      inode metadata file.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      957ed60b
    • J
      scripts/gdb: add empty package initialization script · 586a1a12
      Jan Kiszka 提交于
      This got lost during the initial merge process: Python requires an
      __init__.py script, even if empty, in order to accept a directory as
      package.  Add it, this time as a non-empty file.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      586a1a12
    • G
      rtc: ds1685: remove superfluous checks for out-of-range u8 values · 39ea34cc
      Geert Uytterhoeven 提交于
      drivers/rtc/rtc-ds1685.c: In function `ds1685_rtc_read_alarm':
      drivers/rtc/rtc-ds1685.c:402: warning: comparison is always true due to limited range of data type
      drivers/rtc/rtc-ds1685.c:409: warning: comparison is always true due to limited range of data type
      drivers/rtc/rtc-ds1685.c:416: warning: comparison is always true due to limited range of data type
      drivers/rtc/rtc-ds1685.c: In function `ds1685_rtc_set_alarm':
      drivers/rtc/rtc-ds1685.c:475: warning: comparison is always true due to limited range of data type
      drivers/rtc/rtc-ds1685.c:478: warning: comparison is always true due to limited range of data type
      drivers/rtc/rtc-ds1685.c:481: warning: comparison is always true due to limited range of data type
      
      u8 cannot contain a value larger than 0xff, hence drop the checks.
      Wrapping the checks in unlikely() indicated some sense of humor, though ;-)
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: NJoshua Kinard <kumba@gentoo.org>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      39ea34cc
    • A
      rtc: ds1685: fix ds1685_rtc_alarm_irq_enable build error · 682354d4
      Arnd Bergmann 提交于
      The newly added ds1685 driver causes a build error when enabled without
      CONFIG_RTC_INTF_DEV:
      
        drivers/rtc/rtc-ds1685.c:919:22: error: 'ds1685_rtc_alarm_irq_enable' undeclared here (not in a function)
          .alarm_irq_enable = ds1685_rtc_alarm_irq_enable,
      
      Apparently the driver was incorrectly changed to reflect the interface
      change from 16380c15 ("RTC: Convert rtc drivers to use the
      alarm_irq_enable method"), which removed the respective #ifdef from all
      other rtc drivers.
      
      This does the same change that was merged for the other drivers before and
      removes the #ifdef, allowing the interrupts to be enabled through the
      in-kernel rtc interface independent of the existence of /dev/rtc.
      
      Fixes: aaaf5fbf ("rtc: add driver for DS1685 family of real time clocks")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NJoshua Kinard <kumba@gentoo.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      682354d4
    • M
      memcg: fix low limit calculation · 4e54dede
      Michal Hocko 提交于
      A memcg is considered low limited even when the current usage is equal to
      the low limit.  This leads to interesting side effects e.g.
      groups/hierarchies with no memory accounted are considered protected and
      so the reclaim will emit MEMCG_LOW event when encountering them.
      
      Another and much bigger issue was reported by Joonsoo Kim.  He has hit a
      NULL ptr dereference with the legacy cgroup API which even doesn't have
      low limit exposed.  The limit is 0 by default but the initial check fails
      for memcg with 0 consumption and parent_mem_cgroup() would return NULL if
      use_hierarchy is 0 and so page_counter_read would try to dereference NULL.
      
      I suppose that the current implementation is just an overlook because the
      documentation in Documentation/cgroups/unified-hierarchy.txt says:
      
        "The memory.low boundary on the other hand is a top-down allocated
        reserve.  A cgroup enjoys reclaim protection when it and all its
        ancestors are below their low boundaries"
      
      Fix the usage and the low limit comparision in mem_cgroup_low accordingly.
      
      Fixes: 241994ed (mm: memcontrol: default hierarchy interface for memory)
      Reported-by: NJoonsoo Kim <js1304@gmail.com>
      Signed-off-by: NMichal Hocko <mhocko@suse.cz>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4e54dede
    • J
      mm/nommu: fix memory leak · da616534
      Joonsoo Kim 提交于
      Maxime reported the following memory leak regression due to commit
      dbc8358c ("mm/nommu: use alloc_pages_exact() rather than its own
      implementation").
      
      On v3.19, I am facing a memory leak.  Each time I run a command one page
      is lost.  Here an example with busybox's free command:
      
        / # free
                     total       used       free     shared    buffers     cached
        Mem:          7928       1972       5956          0          0        492
        -/+ buffers/cache:       1480       6448
        / # free
                     total       used       free     shared    buffers     cached
        Mem:          7928       1976       5952          0          0        492
        -/+ buffers/cache:       1484       6444
        / # free
                     total       used       free     shared    buffers     cached
        Mem:          7928       1980       5948          0          0        492
        -/+ buffers/cache:       1488       6440
        / # free
                     total       used       free     shared    buffers     cached
        Mem:          7928       1984       5944          0          0        492
        -/+ buffers/cache:       1492       6436
        / # free
                     total       used       free     shared    buffers     cached
        Mem:          7928       1988       5940          0          0        492
        -/+ buffers/cache:       1496       6432
      
      At some point, the system fails to sastisfy 256KB allocations:
      
        free: page allocation failure: order:6, mode:0xd0
        CPU: 0 PID: 67 Comm: free Not tainted 3.19.0-05389-gacf2cf1-dirty #64
        Hardware name: STM32 (Device Tree Support)
          show_stack+0xb/0xc
          warn_alloc_failed+0x97/0xbc
          __alloc_pages_nodemask+0x295/0x35c
          __get_free_pages+0xb/0x24
          alloc_pages_exact+0x19/0x24
          do_mmap_pgoff+0x423/0x658
          vm_mmap_pgoff+0x3f/0x4e
          load_flat_file+0x20d/0x4f8
          load_flat_binary+0x3f/0x26c
          search_binary_handler+0x51/0xe4
          do_execveat_common+0x271/0x35c
          do_execve+0x19/0x1c
          ret_fast_syscall+0x1/0x4a
        Mem-info:
        Normal per-cpu:
        CPU    0: hi:    0, btch:   1 usd:   0
        active_anon:0 inactive_anon:0 isolated_anon:0
         active_file:0 inactive_file:0 isolated_file:0
         unevictable:123 dirty:0 writeback:0 unstable:0
         free:1515 slab_reclaimable:17 slab_unreclaimable:139
         mapped:0 shmem:0 pagetables:0 bounce:0
         free_cma:0
        Normal free:6060kB min:352kB low:440kB high:528kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:492kB isolated(anon):0ks
        lowmem_reserve[]: 0 0
        Normal: 23*4kB (U) 22*8kB (U) 24*16kB (U) 23*32kB (U) 23*64kB (U) 23*128kB (U) 1*256kB (U) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 6060kB
        123 total pagecache pages
        2048 pages of RAM
        1538 free pages
        66 reserved pages
        109 slab pages
        -46 pages shared
        0 pages swap cached
        nommu: Allocation of length 221184 from process 67 (free) failed
        Normal per-cpu:
        CPU    0: hi:    0, btch:   1 usd:   0
        active_anon:0 inactive_anon:0 isolated_anon:0
         active_file:0 inactive_file:0 isolated_file:0
         unevictable:123 dirty:0 writeback:0 unstable:0
         free:1515 slab_reclaimable:17 slab_unreclaimable:139
         mapped:0 shmem:0 pagetables:0 bounce:0
         free_cma:0
        Normal free:6060kB min:352kB low:440kB high:528kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:492kB isolated(anon):0ks
        lowmem_reserve[]: 0 0
        Normal: 23*4kB (U) 22*8kB (U) 24*16kB (U) 23*32kB (U) 23*64kB (U) 23*128kB (U) 1*256kB (U) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 6060kB
        123 total pagecache pages
        Unable to allocate RAM for process text/data, errno 12 SEGV
      
      This problem happens because we allocate ordered page through
      __get_free_pages() in do_mmap_private() in some cases and we try to free
      individual pages rather than ordered page in free_page_series().  In
      this case, freeing pages whose refcount is not 0 won't be freed to the
      page allocator so memory leak happens.
      
      To fix the problem, this patch changes __get_free_pages() to
      alloc_pages_exact() since alloc_pages_exact() returns
      physically-contiguous pages but each pages are refcounted.
      
      Fixes: dbc8358c ("mm/nommu: use alloc_pages_exact() rather than its own implementation").
      Reported-by: NMaxime Coquelin <mcoquelin.stm32@gmail.com>
      Tested-by: NMaxime Coquelin <mcoquelin.stm32@gmail.com>
      Signed-off-by: NJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: <stable@vger.kernel.org>	[3.19]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      da616534
    • M
      ocfs2: update web page + git tree in documentation · 01945fa2
      Mark Fasheh 提交于
      We (the Ocfs2 project) recently moved the location of our ocfs2-tools
      git tree and project web page.  The pertinent discussion can be seen
      here:
      
        https://oss.oracle.com/pipermail/ocfs2-devel/2015-February/010579.html
      
      The following patch updates the Ocfs2 documentation in MAINTAINERS,
      ocfs2.txt, and dlmfs.txt.  I added our new official web page, changed
      the location of our tools git tree and removed the link to Joel's
      ancient kernel git tree - Andrew has handled our patches for a while
      now.
      Signed-off-by: NMark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      01945fa2
  8. 28 2月, 2015 7 次提交