1. 30 Jan, 2015 8 commits
  2. 28 Jan, 2015 2 commits
    • Jan Kara's avatar
      quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units · 14bf61ff
      Jan Kara authored
      Currently ->get_dqblk() and ->set_dqblk() use struct fs_disk_quota which
      tracks space limits and usage in 512-byte blocks. However VFS quotas
      track usage in bytes (as some filesystems require that) and we need to
      somehow pass this information. Upto now it wasn't a problem because we
      didn't do any unit conversion (thus VFS quota routines happily stuck
      number of bytes into d_bcount field of struct fd_disk_quota). Only if
      you tried to use Q_XGETQUOTA or Q_XSETQLIM for VFS quotas (or Q_GETQUOTA
      / Q_SETQUOTA for XFS quotas), you got bogus results. Hardly anyone
      tried this but reportedly some Samba users hit the problem in practice.
      So when we want interfaces compatible we need to fix this.
      
      We bite the bullet and define another quota structure used for passing
      information from/to ->get_dqblk()/->set_dqblk. It's somewhat sad we have
      to have more conversion routines in fs/quota/quota.c and another copying
      of quota structure slows down getting of quota information by about 2%
      but it seems cleaner than overloading e.g. units of d_bcount to bytes.
      
      CC: stable@vger.kernel.org
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      14bf61ff
    • Jan Kara's avatar
      udf: Release preallocation on last writeable close · b07ef352
      Jan Kara authored
      Commit 6fb1ca92 "udf: Fix race between write(2) and close(2)"
      changed the condition when preallocation is released. The idea was that
      we don't want to release the preallocation for an inode on close when
      there are other writeable file descriptors for the inode. However the
      condition was written in the opposite way so we released preallocation
      only if there were other writeable file descriptors. Fix the problem by
      changing the condition properly.
      
      CC: stable@vger.kernel.org
      Fixes: 6fb1ca92Reported-by: default avatarFabian Frederick <fabf@skynet.be>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      b07ef352
  3. 21 Jan, 2015 7 commits
    • Jan Kara's avatar
      xfs: Remove some pointless quota checks · a3942700
      Jan Kara authored
      xfs_fs_get_xstate() and xfs_fs_get_xstatev() check whether there's quota
      running before calling xfs_qm_scall_getqstat() or
      xfs_qm_scall_getqstatv(). Thus we are certain that superblock supports
      quota and xfs_sb_version_hasquota() check is pointless. Similarly we
      know that when quota is running, mp->m_quotainfo will be allocated.
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      a3942700
    • Jan Kara's avatar
      xfs: Remove some useless flags tests · fbf64b3d
      Jan Kara authored
      'flags' have XFS_ALL_QUOTA_ACCT cleared immediately on function entry.
      There's no point in checking these bits later in the function. Also
      because we check something is going to change, we know some enforcement
      bits are being added and thus there's no point in testing that later.
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      fbf64b3d
    • Jan Kara's avatar
      xfs: Remove useless test · 8a2fdd4a
      Jan Kara authored
      Q_XQUOTARM is never passed to xfs_fs_set_xstate() so remove the test.
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      8a2fdd4a
    • Jan Kara's avatar
      quota: Verify flags passed to Q_SETINFO · ca6cb091
      Jan Kara authored
      Currently flags passed via Q_SETINFO were just stored. This makes it
      hard to add new flags since in theory userspace could be just setting /
      clearing random flags. Since currently there is only one userspace
      settable flag and that is somewhat obscure flags only for ancient v1
      quota format, I'm reasonably sure noone operates these flags and
      hopefully we are fine just adding the check that passed flags are sane.
      If we indeed find some userspace program that gets broken by the strict
      check, we can always remove it again.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      ca6cb091
    • Jan Kara's avatar
      quota: Cleanup flags definitions · 9c45101e
      Jan Kara authored
      Currently all quota flags were defined just in kernel-private headers.
      Export flags readable / writeable from userspace to userspace via
      include/uapi/linux/quota.h.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      9c45101e
    • Jan Kara's avatar
      ocfs2: Move OLQF_CLEAN flag out of generic quota flags · 96827adc
      Jan Kara authored
      OLQF_CLEAN flag is used by OCFS2 on disk to recognize whether quota
      recovery is needed or not. We also somewhat abuse mem_dqinfo->dqi_flags
      to pass this flag around. Use private flags for this to avoid clashes
      with other quota flags / not pollute generic quota flag namespace.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      96827adc
    • Jan Kara's avatar
      quota: Don't store flags for v2 quota format · c119c5b9
      Jan Kara authored
      Currently, v2 quota format blindly stored flags from in-memory dqinfo on
      disk, although there are no flags supported. Since it is stupid to store
      flags which have no effect, just store 0 unconditionally and don't
      bother loading it from disk.
      
      Note that userspace could have stored some flags there via Q_SETINFO
      quotactl and then later read them (although flags have no effect) but
      I'm pretty sure noone does that (most definitely quota-tools don't and
      quota interface doesn't have too much other users).
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      c119c5b9
  4. 15 Jan, 2015 1 commit
  5. 13 Jan, 2015 12 commits
  6. 12 Jan, 2015 10 commits
    • Juergen Gross's avatar
      xen: check for zero sized area when invalidating memory · 9a17ad7f
      Juergen Gross authored
      With the introduction of the linear mapped p2m list setting memory
      areas to "invalid" had to be delayed. When doing the invalidation
      make sure no zero sized areas are processed.
      Signed-off-by: default avatarJuegren Gross <jgross@suse.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      9a17ad7f
    • Juergen Gross's avatar
      xen: use correct type for physical addresses · e86f9496
      Juergen Gross authored
      When converting a pfn to a physical address be sure to use 64 bit
      wide types or convert the physical address to a pfn if possible.
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Tested-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      e86f9496
    • Juergen Gross's avatar
      xen: correct race in alloc_p2m_pmd() · f241b0b8
      Juergen Gross authored
      When allocating a new pmd for the linear mapped p2m list a check is
      done for not introducing another pmd when this just happened on
      another cpu. In this case the old pte pointer was returned which
      points to the p2m_missing or p2m_identity page. The correct value
      would be the pointer to the found new page.
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      f241b0b8
    • Juergen Gross's avatar
      xen: correct error for building p2m list on 32 bits · 82c92ed1
      Juergen Gross authored
      In xen_rebuild_p2m_list() for large areas of invalid or identity
      mapped memory the pmd entries on 32 bit systems are initialized
      wrong. Correct this error.
      Suggested-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      82c92ed1
    • Fabian Frederick's avatar
      udf: destroy sbi mutex in put_super · bbe48dd8
      Fabian Frederick authored
      Call mutex_destroy() on superblock mutex in udf_put_super()
      otherwise mutex debugging code isn't able to detect that
      mutex is used after being freed.
      (thanks to Jan Kara for complete definition).
      Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      bbe48dd8
    • Adrian Hunter's avatar
      mmc: sdhci-pci: Add support for Intel SPT · 1f7f2652
      Adrian Hunter authored
      Add PCI IDs for SPT eMMC, SDIO and SD card.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      1f7f2652
    • Adrian Hunter's avatar
      mmc: sdhci-acpi: Add ACPI HID INT344D · d0ed8e6b
      Adrian Hunter authored
      Add ACPI HID INT344D for an Intel SDIO host controller.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      d0ed8e6b
    • Krzysztof Kozlowski's avatar
      mmc: sdhci: Fix sleep in atomic after inserting SD card · 2836766a
      Krzysztof Kozlowski authored
      Sleep in atomic context happened on Trats2 board after inserting or
      removing SD card because mmc_gpio_get_cd() was called under spin lock.
      
      Fix this by moving card detection earlier, before acquiring spin lock.
      The mmc_gpio_get_cd() call does not have to be protected by spin lock
      because it does not access any sdhci internal data.
      The sdhci_do_get_cd() call access host flags (SDHCI_DEVICE_DEAD). After
      moving it out side of spin lock it could theoretically race with driver
      removal but still there is no actual protection against manual card
      eject.
      
      Dmesg after inserting SD card:
      [   41.663414] BUG: sleeping function called from invalid context at drivers/gpio/gpiolib.c:1511
      [   41.670469] in_atomic(): 1, irqs_disabled(): 128, pid: 30, name: kworker/u8:1
      [   41.677580] INFO: lockdep is turned off.
      [   41.681486] irq event stamp: 61972
      [   41.684872] hardirqs last  enabled at (61971): [<c0490ee0>] _raw_spin_unlock_irq+0x24/0x5c
      [   41.693118] hardirqs last disabled at (61972): [<c04907ac>] _raw_spin_lock_irq+0x18/0x54
      [   41.701190] softirqs last  enabled at (61648): [<c0026fd4>] __do_softirq+0x234/0x2c8
      [   41.708914] softirqs last disabled at (61631): [<c00273a0>] irq_exit+0xd0/0x114
      [   41.716206] Preemption disabled at:[<  (null)>]   (null)
      [   41.721500]
      [   41.722985] CPU: 3 PID: 30 Comm: kworker/u8:1 Tainted: G        W      3.18.0-rc5-next-20141121 #883
      [   41.732111] Workqueue: kmmcd mmc_rescan
      [   41.735945] [<c0014d2c>] (unwind_backtrace) from [<c0011c80>] (show_stack+0x10/0x14)
      [   41.743661] [<c0011c80>] (show_stack) from [<c0489d14>] (dump_stack+0x70/0xbc)
      [   41.750867] [<c0489d14>] (dump_stack) from [<c0228b74>] (gpiod_get_raw_value_cansleep+0x18/0x30)
      [   41.759628] [<c0228b74>] (gpiod_get_raw_value_cansleep) from [<c03646e8>] (mmc_gpio_get_cd+0x38/0x58)
      [   41.768821] [<c03646e8>] (mmc_gpio_get_cd) from [<c036d378>] (sdhci_request+0x50/0x1a4)
      [   41.776808] [<c036d378>] (sdhci_request) from [<c0357934>] (mmc_start_request+0x138/0x268)
      [   41.785051] [<c0357934>] (mmc_start_request) from [<c0357cc8>] (mmc_wait_for_req+0x58/0x1a0)
      [   41.793469] [<c0357cc8>] (mmc_wait_for_req) from [<c0357e68>] (mmc_wait_for_cmd+0x58/0x78)
      [   41.801714] [<c0357e68>] (mmc_wait_for_cmd) from [<c0361c00>] (mmc_io_rw_direct_host+0x98/0x124)
      [   41.810480] [<c0361c00>] (mmc_io_rw_direct_host) from [<c03620f8>] (sdio_reset+0x2c/0x64)
      [   41.818641] [<c03620f8>] (sdio_reset) from [<c035a3d8>] (mmc_rescan+0x254/0x2e4)
      [   41.826028] [<c035a3d8>] (mmc_rescan) from [<c003a0e0>] (process_one_work+0x180/0x3f4)
      [   41.833920] [<c003a0e0>] (process_one_work) from [<c003a3bc>] (worker_thread+0x34/0x4b0)
      [   41.841991] [<c003a3bc>] (worker_thread) from [<c003fed8>] (kthread+0xe4/0x104)
      [   41.849285] [<c003fed8>] (kthread) from [<c000f268>] (ret_from_fork+0x14/0x2c)
      [   42.038276] mmc0: new high speed SDHC card at address 1234
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Fixes: 94144a46 ("mmc: sdhci: add get_cd() implementation")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      2836766a
    • Thomas Petazzoni's avatar
      mmc: sdhci-pxav3: do the mbus window configuration after enabling clocks · aa8165f9
      Thomas Petazzoni authored
      In commit 5491ce3f ("mmc: sdhci-pxav3: add support for the Armada
      38x SDHCI controller"), the sdhci-pxav3 driver was extended to include
      support for the SDHCI controller found in the Armada 38x
      processor. This mainly involved adding some MBus window related
      configuration.
      
      However, this configuration is currently done too early in ->probe():
      it is done before clocks are enabled, while this configuration
      involves touching the registers of the controller, which will hang the
      SoC if the clock is disabled. It wasn't noticed until now because the
      bootloader typically leaves gatable clocks enabled, but in situations
      where we have a deferred probe (due to a CD GPIO that cannot be taken,
      for example), then the probe will be re-tried later, after a clock
      disable has been done in the exit path of the failed probe attempt of
      the device. This second probe() will hang the system due to the clock
      being disabled.
      
      This can for example be produced on Armada 385 GP, which has a CD GPIO
      connected to an I2C PCA9555. If the driver for the PCA9555 is not
      compiled into the kernel, then we will have the following sequence of
      events:
      
        1. The SDHCI probes
        2. It does the MBus configuration (which works, because the clock is
           left enabled by the bootloader)
        3. It enables the clock
        4. It tries to get the CD GPIO, which fails due to the driver being
           missing, so -EPROBE_DEFER is returned.
        5. Before returning -EPROBE_DEFER, the driver cleans up what was
           done, which includes disabling the clock.
        6. Later on, the SDHCI probe is tried again.
        7. It does the MBus configuration, which hangs because the clock is
           no longer enabled.
      
      This commit does the obvious fix of doing the MBus configuration after
      the clock has been enabled by the driver.
      
      Fixes: 5491ce3f ("mmc: sdhci-pxav3: add support for the Armada 38x SDHCI controller")
      Cc: <stable@vger.kernel.org> # v3.15+
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      aa8165f9
    • Adrian Hunter's avatar
      mmc: sdhci: Disable re-tuning for HS400 · b5540ce1
      Adrian Hunter authored
      Re-tuning for HS400 mode must be done in HS200
      mode. Currently there is no support for that.
      That needs to be reflected in the code.
      Specifically, if tuning is executed in HS400 mode
      then return an error, and do not start the
      tuning timer if HS200 tuning is being done prior
      to switching to HS400.
      
      Note that periodic re-tuning is not expected
      to be needed for HS400 but re-tuning is still
      needed after the host controller has lost power.
      In the case of suspend/resume that is not necessary
      because the card is fully re-initialised. That
      just leaves runtime suspend/resume with no support
      for HS400 re-tuning.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      b5540ce1