1. 02 4月, 2015 4 次提交
    • D
      FS-Cache: Synchronise object death state change vs operation submission · f09b443d
      David Howells 提交于
      When an object is being marked as no longer live, do this under the object
      spinlock to prevent a race with operation submission targeted on that object.
      
      The problem occurs due to the following pair of intertwined sequences when the
      cache tries to create an object that would take it over the hard available
      space limit:
      
       NETFS INTERFACE
       ===============
       (A) The netfs calls fscache_acquire_cookie().  object creation is deferred to
           the object state machine and the netfs is allowed to continue.
      
      	OBJECT STATE MACHINE KTHREAD
      	============================
      	(1) The object is looked up on disk by fscache_look_up_object()
      	    calling cachefiles_walk_to_object().  The latter finds that the
      	    object is not yet represented on disk and calls
      	    fscache_object_lookup_negative().
      
      	(2) fscache_object_lookup_negative() sets FSCACHE_COOKIE_NO_DATA_YET
      	    and clears FSCACHE_COOKIE_LOOKING_UP, thus allowing the netfs to
      	    start queuing read operations.
      
       (B) The netfs calls fscache_read_or_alloc_pages().  This calls
           fscache_wait_for_deferred_lookup() which sees FSCACHE_COOKIE_LOOKING_UP
           become clear, allowing the read to begin.
      
       (C) A read operation is set up and passed to fscache_submit_op() to deal
           with.
      
      	(3) cachefiles_walk_to_object() calls cachefiles_has_space(), which
      	    fails (or one of the file operations to create stuff fails).
      	    cachefiles returns an error to fscache.
      
      	(4) fscache_look_up_object() transits to the LOOKUP_FAILURE state,
      
      	(5) fscache_lookup_failure() sets FSCACHE_OBJECT_LOOKED_UP and
      	    FSCACHE_COOKIE_UNAVAILABLE and clears FSCACHE_COOKIE_LOOKING_UP
      	    then transits to the KILL_OBJECT state.
      
      	(6) fscache_kill_object() clears FSCACHE_OBJECT_IS_LIVE in an attempt
      	    to reject any further requests from the netfs.
      
      	(7) object->n_ops is examined and found to be 0.
      	    fscache_kill_object() transits to the DROP_OBJECT state.
      
       (D) fscache_submit_op() locks the object spinlock, sees if it can dispatch
           the op immediately by calling fscache_object_is_active() - which fails
           since FSCACHE_OBJECT_IS_AVAILABLE has not yet been set.
      
       (E) fscache_submit_op() then tests FSCACHE_OBJECT_LOOKED_UP - which is set.
           It then queues the object and increments object->n_ops.
      
      	(8) fscache_drop_object() releases the object and eventually
      	    fscache_put_object() calls cachefiles_put_object() which suffers
      	    an assertion failure here:
      
      		ASSERTCMP(object->fscache.n_ops, ==, 0);
      
      Locking the object spinlock in step (6) around the clearance of
      FSCACHE_OBJECT_IS_LIVE ensures that the the decision trees in
      fscache_submit_op() and fscache_submit_exclusive_op() don't see the IS_LIVE
      flag being cleared mid-decision: either the op is queued before step (7) - in
      which case fscache_kill_object() will see n_ops>0 and will deal with the op -
      or the op will be rejected.
      
      This, combined with rejecting op submission if the target object is dying, fix
      the problem.
      
      The problem shows up as the following oops:
      
      CacheFiles: Assertion failed
      CacheFiles: 1 == 0 is false
      ------------[ cut here ]------------
      kernel BUG at ../fs/cachefiles/interface.c:339!
      ...
      RIP: 0010:[<ffffffffa014fd9c>]  [<ffffffffa014fd9c>] cachefiles_put_object+0x2a4/0x301 [cachefiles]
      ...
      Call Trace:
       [<ffffffffa008674b>] fscache_put_object+0x18/0x21 [fscache]
       [<ffffffffa00883e6>] fscache_object_work_func+0x3ba/0x3c9 [fscache]
       [<ffffffff81054dad>] process_one_work+0x226/0x441
       [<ffffffff81055d91>] worker_thread+0x273/0x36b
       [<ffffffff81055b1e>] ? rescuer_thread+0x2e1/0x2e1
       [<ffffffff81059b9d>] kthread+0x10e/0x116
       [<ffffffff81059a8f>] ? kthread_create_on_node+0x1bb/0x1bb
       [<ffffffff815579ac>] ret_from_fork+0x7c/0xb0
       [<ffffffff81059a8f>] ? kthread_create_on_node+0x1bb/0x1bb
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NSteve Dickson <steved@redhat.com>
      Acked-by: NJeff Layton <jeff.layton@primarydata.com>
      f09b443d
    • D
      FS-Cache: Handle a new operation submitted against a killed object · 6515d1db
      David Howells 提交于
      Reject new operations that are being submitted against an object if that
      object has failed its lookup or creation states or has been killed by the
      cache backend for some other reason, such as having been culled.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NSteve Dickson <steved@redhat.com>
      Acked-by: NJeff Layton <jeff.layton@primarydata.com>
      6515d1db
    • D
      FS-Cache: When submitting an op, cancel it if the target object is dying · 30ceec62
      David Howells 提交于
      When submitting an operation, prefer to cancel the operation immediately
      rather than queuing it for later processing if the object is marked as dying
      (ie. the object state machine has reached the KILL_OBJECT state).
      
      Whilst we're at it, change the series of related test_bit() calls into a
      READ_ONCE() and bitwise-AND operators to reduce the number of load
      instructions (test_bit() has a volatile address).
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NSteve Dickson <steved@redhat.com>
      Acked-by: NJeff Layton <jeff.layton@primarydata.com>
      30ceec62
    • D
      FS-Cache: Move fscache_report_unexpected_submission() to make it more available · 3c305984
      David Howells 提交于
      Move fscache_report_unexpected_submission() up within operation.c so that it
      can be called from fscache_submit_exclusive_op() too.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NSteve Dickson <steved@redhat.com>
      Acked-by: NJeff Layton <jeff.layton@primarydata.com>
      3c305984
  2. 24 2月, 2015 1 次提交
  3. 19 2月, 2015 10 次提交
    • L
      Merge tag 'locks-v3.20-2' of git://git.samba.org/jlayton/linux · b2b89ebf
      Linus Torvalds 提交于
      Pull file locking fixes from Jeff Layton:
       "A small set of patches to fix problems with the recent file locking
        changes that we discussed earlier this week"
      "
      
      * tag 'locks-v3.20-2' of git://git.samba.org/jlayton/linux:
        locks: fix list insertion when lock is split in two
        locks: remove conditional lock release in middle of flock_lock_file
        locks: only remove leases associated with the file being closed
        Revert "locks: keep a count of locks on the flctx lists"
      b2b89ebf
    • L
      Merge tag 'asm-generic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic · eaa0eda5
      Linus Torvalds 提交于
      Pull asm-generic uaccess.h cleanup from Arnd Bergmann:
       "Like in 3.19, I once more have a multi-stage cleanup for one
        asm-generic header file, this time the work was done by Michael
        Tsirkin and cleans up the uaccess.h file in asm-generic, as well as
        all architectures for which the respective maintainers did not pick up
        his patches directly"
      
      * tag 'asm-generic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: (37 commits)
        sparc32: nocheck uaccess coding style tweaks
        sparc64: nocheck uaccess coding style tweaks
        xtensa: macro whitespace fixes
        sh: macro whitespace fixes
        parisc: macro whitespace fixes
        m68k: macro whitespace fixes
        m32r: macro whitespace fixes
        frv: macro whitespace fixes
        cris: macro whitespace fixes
        avr32: macro whitespace fixes
        arm64: macro whitespace fixes
        arm: macro whitespace fixes
        alpha: macro whitespace fixes
        blackfin: macro whitespace fixes
        sparc64: uaccess_64 macro whitespace fixes
        sparc32: uaccess_32 macro whitespace fixes
        avr32: whitespace fix
        sh: fix put_user sparse errors
        metag: fix put_user sparse errors
        ia64: fix put_user sparse errors
        ...
      eaa0eda5
    • L
      Merge tag 'pci-v3.20-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · cad3ab58
      Linus Torvalds 提交于
      Pull PCI resource management fix from Bjorn Helgaas:
       "This fixes a double kfree in code we merged for v3.20:
      
        Remove duplicate kfree in of_pci_get_host_bridge_resources() (Lorenzo
        Pieralisi)"
      
      * tag 'pci-v3.20-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        of/pci: Remove duplicate kfree in of_pci_get_host_bridge_resources()
      cad3ab58
    • L
      Merge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux · 53861af9
      Linus Torvalds 提交于
      Pull virtio updates from Rusty Russell:
       "OK, this has the big virtio 1.0 implementation, as specified by OASIS.
      
        On top of tht is the major rework of lguest, to use PCI and virtio
        1.0, to double-check the implementation.
      
        Then comes the inevitable fixes and cleanups from that work"
      
      * tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (80 commits)
        virtio: don't set VIRTIO_CONFIG_S_DRIVER_OK twice.
        virtio_net: unconditionally define struct virtio_net_hdr_v1.
        tools/lguest: don't use legacy definitions for net device in example launcher.
        virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined.
        tools/lguest: use common error macros in the example launcher.
        tools/lguest: give virtqueues names for better error messages
        tools/lguest: more documentation and checking of virtio 1.0 compliance.
        lguest: don't look in console features to find emerg_wr.
        tools/lguest: don't start devices until DRIVER_OK status set.
        tools/lguest: handle indirect partway through chain.
        tools/lguest: insert driver references from the 1.0 spec (4.1 Virtio Over PCI)
        tools/lguest: insert device references from the 1.0 spec (4.1 Virtio Over PCI)
        tools/lguest: rename virtio_pci_cfg_cap field to match spec.
        tools/lguest: fix features_accepted logic in example launcher.
        tools/lguest: handle device reset correctly in example launcher.
        virtual: Documentation: simplify and generalize paravirt_ops.txt
        lguest: remove NOTIFY call and eventfd facility.
        lguest: remove NOTIFY facility from demonstration launcher.
        lguest: use the PCI console device's emerg_wr for early boot messages.
        lguest: always put console in PCI slot #1.
        ...
      53861af9
    • L
      Merge tag 'mfd-for-linus-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd · 5c277007
      Linus Torvalds 提交于
      Pull MFD updates from Lee Jones:
       "Changes to existing drivers:
         - fixr platform device collision; da9052, wm8994-core
         - regmap configuration amendments; tps65218
         - fix runtime PM deadlock; rtsx_usb
         - remove unused/superfluous code; db8500-prcmu, omap-usb-host
         - enable watchdog timer; lpc_sch
         - add start/stop RX URBs helpers; dln2
         - remove platform device (DT only); max77686, max77802
         - support suspend and resume; dln2
         - add Device Tree support; da9063
         - extra error checking; intel_soc_pmic
         - const'ify all the things; 88pm860x, hi6421-pmic, intel_soc_pmic,
                                     max77686, lm3533, retu, pcf50633,
                                     davinci_voicecodec, smsc-ece1099,
                                     tps65218, mc13xxx, tps65217, twl-core,
                                     twl6040
      
        New drivers/supported devices:
         - new driver for Richtek RT5033
         - new driver for DA9150 Charger and FuelGauge
         - new driver for Qualcomm Resource Power Manager (RPM)
         - add support for the ir-clk into sun6i-prcm
         - add support for FuelGauge into axp20x"
      
      * tag 'mfd-for-linus-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (32 commits)
        mfd: intel_soc_pmic: Add missing error check for devm_kzalloc
        mfd: rtsx_usb: Defer autosuspend while card exists
        mfd: devicetree: Add bindings for DA9063
        mfd: da9063: Add device tree support
        regulator: qcom-rpm: Add missing state flag in call to RPM
        mfd: qcom-rpm: Driver for the Qualcomm RPM
        mfd: devicetree: bindings: Add Qualcomm RPM DT binding
        mfd: max77686/802: Remove support for board files
        mfd: omap-usb-host: Remove some unused functions
        mfd: twl6040: Constify struct regmap_config and reg_default array
        mfd: twl-core: Constify struct regmap_config and reg_default array
        mfd: tps65217: Constify struct regmap_config
        mfd: mc13xxx: i2c/spi: Constify struct regmap_config
        mfd: tps65218: Constify struct regmap_config
        mfd: smsc-ece1099: Constify struct regmap_config
        mfd: davinci_voicecodec: Constify struct regmap_config
        mfd: pcf50633: Constify struct regmap_config
        mfd: retu: Constify struct regmap_config
        mfd: lm3533: Constify struct regmap_config
        mfd: max77686: Constify struct regmap_config
        ...
      5c277007
    • L
      Merge tag 'pwm/for-3.20-rc1' of... · 9a8b2aa5
      Linus Torvalds 提交于
      Merge tag 'pwm/for-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
      
      Pull pwm updates from Thierry Reding:
       "This contains two new drivers, one for Allwinner SoCs and the other
        for Imagination Technologies' Pistachio SoC.
      
        Complementing this are a couple of fixes to the Atmel HLCDC PWM and
        STi PWM drivers as well as minor cleanups to the core and the Tegra
        driver"
      
      * tag 'pwm/for-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
        pwm: tegra: Use NSEC_PER_SEC
        pwm: Remove unnecessary check before of_node_put()
        pwm: Add device tree binding document for IMG PWM DAC
        pwm: Imagination Technologies PWM DAC driver
        pwm: sti: Maintain a bitmap of configured devices
        pwm: sunxi: document OF bindings
        pwm: Add Allwinner SoC support
        pwm: atmel-hlcdc: Prevent division by zero
        pwm: atmel-hlcdc: Depend on HAVE_CLK
      9a8b2aa5
    • L
      Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma · ce1d3fde
      Linus Torvalds 提交于
      Pull dmaengine updates from Vinod Koul:
       "This update brings:
      
         - the big cleanup up by Maxime for device control and slave
           capabilities.  This makes the API much cleaner.
      
         - new IMG MDC driver by Andrew
      
         - new Renesas R-Car Gen2 DMA Controller driver by Laurent along with
           bunch of fixes on rcar drivers
      
         - odd fixes and updates spread over driver"
      
      * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (130 commits)
        dmaengine: pl330: add DMA_PAUSE feature
        dmaengine: pl330: improve pl330_tx_status() function
        dmaengine: rcar-dmac: Disable channel 0 when using IOMMU
        dmaengine: rcar-dmac: Work around descriptor mode IOMMU errata
        dmaengine: rcar-dmac: Allocate hardware descriptors with DMAC device
        dmaengine: rcar-dmac: Fix oops due to unintialized list in error ISR
        dmaengine: rcar-dmac: Fix spinlock issues in interrupt
        dmaenegine: edma: fix sparse warnings
        dmaengine: rcar-dmac: Fix uninitialized variable usage
        dmaengine: shdmac: extend PM methods
        dmaengine: shdmac: use SET_RUNTIME_PM_OPS()
        dmaengine: pl330: fix bug that cause start the same descs in cyclic
        dmaengine: at_xdmac: allow muliple dwidths when doing slave transfers
        dmaengine: at_xdmac: simplify channel configuration stuff
        dmaengine: at_xdmac: introduce save_cc field
        dmaengine: at_xdmac: wait for in-progress transaction to complete after pausing a channel
        ioat: fail self-test if wait_for_completion times out
        dmaengine: dw: define DW_DMA_MAX_NR_MASTERS
        dmaengine: dw: amend description of dma_dev field
        dmatest: move src_off, dst_off, len inside loop
        ...
      ce1d3fde
    • L
      Merge git://www.linux-watchdog.org/linux-watchdog · 928fce2f
      Linus Torvalds 提交于
      Pull watchdog updates from Wim Van Sebroeck:
       "This adds the following new drivers:
      
         - ImgTec PDC Watchdog Timer Driver,
         - Mediatek SoC integrated watchdog
      
        Add support for BCM5301X, IT8783, NCT6791 and NCT6792 WDT's
      
        Add bcm47xx_wdt and da9063 restart handlers and contains overall
        improvements and fixes"
      
      * git://www.linux-watchdog.org/linux-watchdog:
        watchdog: bcm47xx_wdt.c: allow enabling on BCM5301X arch
        watchdog: jz4740: Add DT support
        dt: watchdog: Add DT binding documentation for jz4740 watchdog timer
        watchdog: dw_wdt: Try to get a 30 second watchdog by default
        watchdog: dw_wdt: pat the watchdog before enabling it
        watchdog: w83627hf_wdt: Add support for NCT6791 and NCT6792
        watchdog: bcm47xx_wdt.c: add restart handler support
        watchdog: gpio_wdt: Add "always_running" feature to GPIO watchdog
        watchdog: da9063: Add restart handler support
        ARM: mediatek: dts: Add bindings for watchdog
        watchdog: Add driver for Mediatek watchdog
        watchdog: Fix omap watchdogs to enable the magic close bit
        watchdog: rt2880_wdt: minor clean up
        watchdog: hpwdt: Fix initialization message in hpwdt.c
        watchdog: it87_wdt: add IT8783 ID
        watchdog: imx2: Constify struct regmap_config and watchdog_ops
        DT: watchdog: Add ImgTec PDC Watchdog Timer binding documentation
        watchdog: ImgTec PDC Watchdog Timer Driver
      928fce2f
    • L
      Merge tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394 · a5ac1fb1
      Linus Torvalds 提交于
      Pull fireware updates from Stefan Richter:
       "IEEE 1394 subsystem updates:
      
         - Replace made-up, unallocated Vendor and Model values of
           firewire-core's Configuration ROM register root directory by
           properly registered IDs.  (These IDs are visible to peer nodes on
           the bus and locally via sysfs, but they are not involved in
           protocol matching or driver matching, nor are they used in stock
           udev rules)
      
         - Remove some unneccessary code"
      
      * tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
        firewire: core: use correct vendor/model IDs
        firewire: sbp2: remove redundant check for bidi command
        firewire: ohci: Remove unused function
      a5ac1fb1
    • L
      Merge tag 'for-linus-20150216' of git://git.infradead.org/linux-mtd · 402521b8
      Linus Torvalds 提交于
      Pull MTD updates from Brian Norris:
       "NAND:
      
         - Add new Hisilicon NAND driver for Hip04
         - Add default reboot handler, to ensure all outstanding erase
           transactions complete in time
         - jz4740: convert to use GPIO descriptor API
         - Atmel: add support for sama5d4
         - Change default bitflip threshold to 75% of correction strength
         - Miscellaneous cleanups and bugfixes
      
        SPI NOR:
      
         - Freescale QuadSPI:
         - Fix a few probe() and remove() issues
         - Add a MAINTAINERS entry for this driver
         - Tweak transfer size to increase read performance
         - Add suspend/resume support
         - Add Micron quad I/O support
         - ST FSM SPI: miscellaneous fixes
      
        JFFS2:
      
         - gracefully handle corrupted 'offset' field found on flash
      
        Other:
      
         - bcm47xxpart: add tweaks for a few new devices
         - mtdconcat: set return lengths properly for mtd_write_oob()
         - map_ram: enable use with mtdoops
         - maps: support fallback to ROM/UBI for write-protected NOR flash"
      
      * tag 'for-linus-20150216' of git://git.infradead.org/linux-mtd: (46 commits)
        mtd: hisilicon: && vs & typo
        jffs2: fix handling of corrupted summary length
        mtd: hisilicon: add device tree binding documentation
        mtd: hisilicon: add a new NAND controller driver for hisilicon hip04 Soc
        mtd: avoid registering reboot notifier twice
        mtd: concat: set the return lengths properly
        mtd: kconfig: replace PPC_OF with PPC
        mtd: denali: remove unnecessary stubs
        mtd: nand: remove redundant local variable
        MAINTAINERS: add maintainer entry for FREESCALE QUAD SPI driver
        mtd: fsl-quadspi: improve read performance by increase AHB transfer size
        mtd: fsl-quadspi: Remove unnecessary 'map_failed' label
        mtd: fsl-quadspi: Remove unneeded success/error messages
        mtd: fsl-quadspi: Fix the error paths
        mtd: nand: omap: drop condition with no effect
        mtd: nand: jz4740: Convert to GPIO descriptor API
        mtd: nand: Request strength instead of bytes for soft BCH
        mtd: nand: default bitflip-reporting threshold to 75% of correction strength
        mtd: atmel_nand: introduce a new compatible string for sama5d4 chip
        mtd: atmel_nand: return max bitflips in all sectors in pmecc_correction()
        ...
      402521b8
  4. 18 2月, 2015 25 次提交