1. 14 Mar, 2013 8 commits
    • Konrad Rzeszutek Wilk's avatar
      xen/pci: We don't do multiple MSI's. · ee74fecf
      Konrad Rzeszutek Wilk authored
      commit 884ac297 upstream.
      
      There is no hypercall to setup multiple MSI per PCI device.
      As such with these two new commits:
      -  08261d87
         PCI/MSI: Enable multiple MSIs with pci_enable_msi_block_auto()
      - 5ca72c4f
         AHCI: Support multiple MSIs
      
      we would call the PHYSDEVOP_map_pirq 'nvec' times with the same
      contents of the PCI device. Sander discovered that we would get
      the same PIRQ value 'nvec' times and return said values to the
      caller. That of course meant that the device was configured only
      with one MSI and AHCI would fail with:
      
      ahci 0000:00:11.0: version 3.0
      xen: registering gsi 19 triggering 0 polarity 1
      xen: --> pirq=19 -> irq=19 (gsi=19)
      (XEN) [2013-02-27 19:43:07] IOAPIC[0]: Set PCI routing entry (6-19 -> 0x99 -> IRQ 19 Mode:1 Active:1)
      ahci 0000:00:11.0: AHCI 0001.0200 32 slots 4 ports 6 Gbps 0xf impl SATA mode
      ahci 0000:00:11.0: flags: 64bit ncq sntf ilck pm led clo pmp pio slum part
      ahci: probe of 0000:00:11.0 failed with error -22
      
      That is b/c in ahci_host_activate the second call to
      devm_request_threaded_irq  would return -EINVAL as we passed in
      (on the second run) an IRQ that was never initialized.
      Reported-and-Tested-by: default avatarSander Eikelenboom <linux@eikelenboom.it>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ee74fecf
    • Konrad Rzeszutek Wilk's avatar
      xen/pat: Disable PAT using pat_enabled value. · ca47ff97
      Konrad Rzeszutek Wilk authored
      commit c79c4982 upstream.
      
      The git commit 8eaffa67
      (xen/pat: Disable PAT support for now) explains in details why
      we want to disable PAT for right now. However that
      change was not enough and we should have also disabled
      the pat_enabled value. Otherwise we end up with:
      
      mmap-example:3481 map pfn expected mapping type write-back for
      [mem 0x00010000-0x00010fff], got uncached-minus
       ------------[ cut here ]------------
      WARNING: at /build/buildd/linux-3.8.0/arch/x86/mm/pat.c:774 untrack_pfn+0xb8/0xd0()
      mem 0x00010000-0x00010fff], got uncached-minus
      ------------[ cut here ]------------
      WARNING: at /build/buildd/linux-3.8.0/arch/x86/mm/pat.c:774
      untrack_pfn+0xb8/0xd0()
      ...
      Pid: 3481, comm: mmap-example Tainted: GF 3.8.0-6-generic #13-Ubuntu
      Call Trace:
       [<ffffffff8105879f>] warn_slowpath_common+0x7f/0xc0
       [<ffffffff810587fa>] warn_slowpath_null+0x1a/0x20
       [<ffffffff8104bcc8>] untrack_pfn+0xb8/0xd0
       [<ffffffff81156c1c>] unmap_single_vma+0xac/0x100
       [<ffffffff81157459>] unmap_vmas+0x49/0x90
       [<ffffffff8115f808>] exit_mmap+0x98/0x170
       [<ffffffff810559a4>] mmput+0x64/0x100
       [<ffffffff810560f5>] dup_mm+0x445/0x660
       [<ffffffff81056d9f>] copy_process.part.22+0xa5f/0x1510
       [<ffffffff81057931>] do_fork+0x91/0x350
       [<ffffffff81057c76>] sys_clone+0x16/0x20
       [<ffffffff816ccbf9>] stub_clone+0x69/0x90
       [<ffffffff816cc89d>] ? system_call_fastpath+0x1a/0x1f
      ---[ end trace 4918cdd0a4c9fea4 ]---
      
      (a similar message shows up if you end up launching 'mcelog')
      
      The call chain is (as analyzed by Liu, Jinsong):
      do_fork
        --> copy_process
          --> dup_mm
            --> dup_mmap
             	--> copy_page_range
                --> track_pfn_copy
                  --> reserve_pfn_range
                    --> line 624: flags != want_flags
      It comes from different memory types of page table (_PAGE_CACHE_WB) and MTRR
      (_PAGE_CACHE_UC_MINUS).
      
      Stefan Bader dug in this deep and found out that:
      "That makes it clearer as this will do
      
      reserve_memtype(...)
      --> pat_x_mtrr_type
        --> mtrr_type_lookup
          --> __mtrr_type_lookup
      
      And that can return -1/0xff in case of MTRR not being enabled/initialized. Which
      is not the case (given there are no messages for it in dmesg). This is not equal
      to MTRR_TYPE_WRBACK and thus becomes _PAGE_CACHE_UC_MINUS.
      
      It looks like the problem starts early in reserve_memtype:
      
             	if (!pat_enabled) {
                      /* This is identical to page table setting without PAT */
                      if (new_type) {
                              if (req_type == _PAGE_CACHE_WC)
                                      *new_type = _PAGE_CACHE_UC_MINUS;
                              else
                                     	*new_type = req_type & _PAGE_CACHE_MASK;
                     	}
                      return 0;
              }
      
      This would be what we want, that is clearing the PWT and PCD flags from the
      supported flags - if pat_enabled is disabled."
      
      This patch does that - disabling PAT.
      Reported-by: default avatarSander Eikelenboom <linux@eikelenboom.it>
      Reported-and-Tested-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reported-and-Tested-by: default avatarStefan Bader <stefan.bader@canonical.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ca47ff97
    • Steven Noonan's avatar
      xenbus: fix compile failure on ARM with Xen enabled · a1c9ea40
      Steven Noonan authored
      commit 45e27161 upstream.
      
      Adding an include of linux/mm.h resolves this:
      	drivers/xen/xenbus/xenbus_client.c: In function ‘xenbus_map_ring_valloc_hvm’:
      	drivers/xen/xenbus/xenbus_client.c:532:66: error: implicit declaration of function ‘page_to_section’ [-Werror=implicit-function-declaration]
      Signed-off-by: default avatarSteven Noonan <steven@uplinklabs.net>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a1c9ea40
    • Alan Stern's avatar
      USB: EHCI: revert "remove ASS/PSS polling timeout" · 83bdd77f
      Alan Stern authored
      commit 221f8dfc upstream.
      
      This patch (as1649) reverts commit
      55bcdce8 (USB: EHCI: remove ASS/PSS
      polling timeout).  That commit was written under the assumption that
      some controllers may take a very long time to turn off their async and
      periodic schedules.  It now appears that in fact the schedules do get
      turned off reasonably quickly, but some controllers occasionally leave
      the schedules' status bits turned on and consequently ehci-hcd can't
      tell that the schedules are off.
      
      VIA controllers in particular have this problem.  ehci-hcd tells the
      hardware to turn off the async schedule, the schedule does get turned
      off, but the status bit remains on.  Since the EHCI spec requires that
      the schedules not be re-enabled until the previous disable has taken
      effect, with an unlimited timeout the async schedule never gets turned
      back on.  The resulting symptom is that the system is unable to
      communicate with USB devices.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: default avatarRonald <ronald645@gmail.com>
      Reported-and-tested-by: default avatarPaul Hartman <paul.hartman@gmail.com>
      Reported-and-tested-by: default avatarDieter Nützel <dieter@nuetzel-hh.de>
      Reported-and-tested-by: default avatarJean Delvare <khali@linux-fr.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      83bdd77f
    • Catalin Marinas's avatar
      ARM: 7654/1: Preserve L_PTE_VALID in pte_modify() · df97c726
      Catalin Marinas authored
      commit 69dde4c5 upstream.
      
      Following commit 26ffd0d4 (ARM: mm: introduce present, faulting entries
      for PAGE_NONE), if a page has been mapped as PROT_NONE, the L_PTE_VALID
      bit is cleared by the set_pte_ext() code. With LPAE the software and
      hardware pte share the same location and subsequent modifications of pte
      range (change_protection()) will leave the L_PTE_VALID bit cleared.
      
      This patch adds the L_PTE_VALID bit to the newprot mask in pte_modify().
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Reported-by: default avatarSubash Patel <subash.rp@samsung.com>
      Tested-by: default avatarSubash Patel <subash.rp@samsung.com>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      df97c726
    • Nicolas Pitre's avatar
      ARM: 7653/2: do not scale loops_per_jiffy when using a constant delay clock · 13cfc757
      Nicolas Pitre authored
      commit 70264367 upstream.
      
      When udelay() is implemented using an architected timer, it is wrong
      to scale loops_per_jiffy when changing the CPU clock frequency since
      the timer clock remains constant.
      
      The lpj should probably become an implementation detail relevant to
      the CPU loop based delay routine only and more confined to it. In the
      mean time this is the minimal fix needed to have expected delays with
      the timer based implementation when cpufreq is also in use.
      Reported-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarNicolas Pitre <nico@linaro.org>
      Tested-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Acked-by: default avatarLiviu Dudau <Liviu.Dudau@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      13cfc757
    • Russell King's avatar
      ARM: fix scheduling while atomic warning in alignment handling code · 69ac92ed
      Russell King authored
      commit b255188f upstream.
      
      Paolo Pisati reports that IPv6 triggers this warning:
      
      BUG: scheduling while atomic: swapper/0/0/0x40000100
      Modules linked in:
      [<c001b1c4>] (unwind_backtrace+0x0/0xf0) from [<c0503c5c>] (__schedule_bug+0x48/0x5c)
      [<c0503c5c>] (__schedule_bug+0x48/0x5c) from [<c0508608>] (__schedule+0x700/0x740)
      [<c0508608>] (__schedule+0x700/0x740) from [<c007007c>] (__cond_resched+0x24/0x34)
      [<c007007c>] (__cond_resched+0x24/0x34) from [<c05086dc>] (_cond_resched+0x3c/0x44)
      [<c05086dc>] (_cond_resched+0x3c/0x44) from [<c0021f6c>] (do_alignment+0x178/0x78c)
      [<c0021f6c>] (do_alignment+0x178/0x78c) from [<c00083e0>] (do_DataAbort+0x34/0x98)
      [<c00083e0>] (do_DataAbort+0x34/0x98) from [<c0509a60>] (__dabt_svc+0x40/0x60)
      Exception stack(0xc0763d70 to 0xc0763db8)
      3d60:                                     e97e805e e97e806e 2c000000 11000000
      3d80: ea86bb00 0000002c 00000011 e97e807e c076d2a8 e97e805e e97e806e 0000002c
      3da0: 3d000000 c0763dbc c04b98fc c02a8490 00000113 ffffffff
      [<c0509a60>] (__dabt_svc+0x40/0x60) from [<c02a8490>] (__csum_ipv6_magic+0x8/0xc8)
      
      Fix this by using probe_kernel_address() stead of __get_user().
      Reported-by: default avatarPaolo Pisati <p.pisati@gmail.com>
      Tested-by: default avatarPaolo Pisati <p.pisati@gmail.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      69ac92ed
    • Russell King's avatar
      ARM: VFP: fix emulation of second VFP instruction · 908e88f2
      Russell King authored
      commit 5e4ba617 upstream.
      
      Martin Storsjö reports that the sequence:
      
              ee312ac1        vsub.f32        s4, s3, s2
              ee702ac0        vsub.f32        s5, s1, s0
              e59f0028        ldr             r0, [pc, #40]
              ee111a90        vmov            r1, s3
      
      on Raspberry Pi (implementor 41 architecture 1 part 20 variant b rev 5)
      where s3 is a denormal and s2 is zero results in incorrect behaviour -
      the instruction "vsub.f32 s5, s1, s0" is not executed:
      
              VFP: bounce: trigger ee111a90 fpexc d0000780
              VFP: emulate: INST=0xee312ac1 SCR=0x00000000
              ...
      
      As we can see, the instruction triggering the exception is the "vmov"
      instruction, and we emulate the "vsub.f32 s4, s3, s2" but fail to
      properly take account of the FPEXC_FP2V flag in FPEXC.  This is because
      the test for the second instruction register being valid is bogus, and
      will always skip emulation of the second instruction.
      Reported-by: default avatarMartin Storsjö <martin@martin.st>
      Tested-by: default avatarMartin Storsjö <martin@martin.st>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      908e88f2
  2. 03 Mar, 2013 32 commits
    • Greg Kroah-Hartman's avatar
      Linux 3.8.2 · 19b00d2d
      Greg Kroah-Hartman authored
      19b00d2d
    • Dave Chinner's avatar
      xfs: xfs_bmap_add_attrfork_local is too generic · 2cd182d6
      Dave Chinner authored
      commit 1e82379b upstream.
      
      When we are converting local data to an extent format as a result of
      adding an attribute, the type of data contained in the local fork
      determines the behaviour that needs to occur.
      
      xfs_bmap_add_attrfork_local() already handles the directory data
      case specially by using S_ISDIR() and calling out to
      xfs_dir2_sf_to_block(), but with verifiers we now need to handle
      each different type of metadata specially and different metadata
      formats require different verifiers (and eventually block header
      initialisation).
      
      There is only a single place that we add and attribute fork to
      the inode, but that is in the attribute code and it knows nothing
      about the specific contents of the data fork. It is only the case of
      local data that is the issue here, so adding code to hadnle this
      case in the attribute specific code is wrong. Hence we are really
      stuck trying to detect the data fork contents in
      xfs_bmap_add_attrfork_local() and performing the correct callout
      there.
      
      Luckily the current cases can be determined by S_IS* macros, and we
      can push the work off to data specific callouts, but each of those
      callouts does a lot of work in common with
      xfs_bmap_local_to_extents(). The only reason that this fails for
      symlinks right now is is that xfs_bmap_local_to_extents() assumes
      the data fork contains extent data, and so attaches a a bmap extent
      data verifier to the buffer and simply copies the data fork
      information straight into it.
      
      To fix this, allow us to pass a "formatting" callback into
      xfs_bmap_local_to_extents() which is responsible for setting the
      buffer type, initialising it and copying the data fork contents over
      to the new buffer. This allows callers to specify how they want to
      format the new buffer (which is necessary for the upcoming CRC
      enabled metadata blocks) and hence make xfs_bmap_local_to_extents()
      useful for any type of data fork content.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarMark Tinguely <tinguely@sgi.com>
      Signed-off-by: default avatarBen Myers <bpm@sgi.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      2cd182d6
    • Matt Fleming's avatar
      efivarfs: guid part of filenames are case-insensitive · 688289c4
      Matt Fleming authored
      commit da27a243 upstream.
      
      It makes no sense to treat the following filenames as unique,
      
      	VarName-abcdefab-abcd-abcd-abcd-abcdefabcdef
      	VarName-ABCDEFAB-ABCD-ABCD-ABCD-ABCDEFABCDEF
      	VarName-ABcDEfAB-ABcD-ABcD-ABcD-ABcDEfABcDEf
      	VarName-aBcDEfAB-aBcD-aBcD-aBcD-aBcDEfaBcDEf
      	... etc ...
      
      since the guid will be converted into a binary representation, which
      has no case.
      
      Roll our own dentry operations so that we can treat the variable name
      part of filenames ("VarName" in the above example) as case-sensitive,
      but the guid portion as case-insensitive. That way, efivarfs will
      refuse to create the above files if any one already exists.
      Reported-by: default avatarLingzhu Xiang <lxiang@redhat.com>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      688289c4
    • Matt Fleming's avatar
      efivarfs: Validate filenames much more aggressively · 70afdfc6
      Matt Fleming authored
      commit 47f531e8 upstream.
      
      The only thing that efivarfs does to enforce a valid filename is
      ensure that the name isn't too short. We need to strongly sanitise any
      filenames, not least because variable creation is delayed until
      efivarfs_file_write(), which means we can't rely on the firmware to
      inform us of an invalid name, because if the file is never written to
      we'll never know it's invalid.
      
      Perform a couple of steps before agreeing to create a new file,
      
        * hex_to_bin() returns a value indicating whether or not it was able
          to convert its arguments to a binary representation - we should
          check it.
      
        * Ensure that the GUID portion of the filename is the correct length
          and format.
      
        * The variable name portion of the filename needs to be at least one
          character in size.
      Reported-by: default avatarLingzhu Xiang <lxiang@redhat.com>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      70afdfc6
    • Thomas Renninger's avatar
      ACPI: Overriding ACPI tables via initrd only works with an initrd and on X86 · 595aa2af
      Thomas Renninger authored
      commit 565d956a upstream.
      
      Reflect this dependency in Kconfig, to prevent build failures.
      
      Shorten the config description as suggested by Borislav Petkov.
      
      Finding a suitable memory area to store the modified table(s) has been
      taken over from arch/x86/kernel/setup.c and makes use of max_low_pfn_mapped:
      memblock_find_in_range(0, max_low_pfn_mapped,...)
      This one is X86 specific. It may not be hard to extend this functionality
      for other ACPI aware architectures if there is need for.
      
      For now make this feature only available for X86 to avoid build failures on
      IA64, compare with:
      https://bugzilla.kernel.org/show_bug.cgi?id=54091Signed-off-by: default avatarThomas Renninger <trenn@suse.de>
      Link: http://lkml.kernel.org/r/1361538742-67599-3-git-send-email-trenn@suse.deSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      595aa2af
    • Lee, Chun-Yi's avatar
      x86, efi: Allow slash in file path of initrd · c5d6774c
      Lee, Chun-Yi authored
      commit deb94101 upstream.
      
      When initrd file didn't put at the same place with stub kernel, we
      need give the file path of initrd, but need use backslash to separate
      directory and file. It's not friendly to unix/linux user, and not so
      intuitive for bootloader forward paramters to efi stub kernel by
      chainloading.
      
      This patch add support to handle_ramdisks for allow slash in file path
      of initrd, it convert slash to backlash when parsing path.
      
      In additional, this patch also separates print code of efi_char16_t from
      efi_printk, and print out the path/filename of initrd when failed to open
      initrd file. It's good for debug and discover typo.
      Signed-off-by: default avatarLee, Chun-Yi <jlee@suse.com>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c5d6774c
    • Alexey Klimov's avatar
      usb hid quirks for Masterkit MA901 usb radio · 9b48ad4a
      Alexey Klimov authored
      commit 0322bd39 upstream.
      
      Don't let Masterkit MA901 USB radio be handled by usb hid drivers.
      This device will be handled by radio-ma901.c driver.
      Signed-off-by: default avatarAlexey Klimov <klimov.linux@gmail.com>
      Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9b48ad4a
    • James Ralston's avatar
      ahci: Add Device IDs for Intel Wellsburg PCH · 58a24bbc
      James Ralston authored
      commit 151743fd upstream.
      
      This patch adds the AHCI-mode SATA Device IDs for the Intel Wellsburg PCH
      Signed-off-by: default avatarJames Ralston <james.d.ralston@intel.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      58a24bbc
    • Seth Heasley's avatar
      ahci: AHCI-mode SATA patch for Intel Avoton DeviceIDs · f5248a1f
      Seth Heasley authored
      commit 29e674dd upstream.
      
      This patch adds the AHCI and RAID-mode SATA DeviceIDs for the Intel Avoton SOC.
      Signed-off-by: default avatarSeth Heasley <seth.heasley@intel.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f5248a1f
    • James Ralston's avatar
      ata_piix: Add Device IDs for Intel Wellsburg PCH · 19be8a03
      James Ralston authored
      commit 3aee8bc5 upstream.
      
      This patch adds the IDE-mode SATA Device IDs for the Intel Wellsburg PCH
      Signed-off-by: default avatarJames Ralston <james.d.ralston@intel.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      19be8a03
    • Seth Heasley's avatar
      ata_piix: IDE-mode SATA patch for Intel Avoton DeviceIDs · 1b6a883f
      Seth Heasley authored
      commit aaa51527 upstream.
      
      This patch adds the IDE-mode SATA DeviceIDs for the Intel Avoton SOC.
      Signed-off-by: default avatarSeth Heasley <seth.heasley@intel.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1b6a883f
    • Ian Abbott's avatar
      staging: comedi: check s->async for poll(), read() and write() · 9cb9a591
      Ian Abbott authored
      commit cc400e18 upstream.
      
      Some low-level comedi drivers (incorrectly) point `dev->read_subdev` or
      `dev->write_subdev` to a subdevice that does not support asynchronous
      commands.  Comedi's poll(), read() and write() file operation handlers
      assume these subdevices do support asynchronous commands.  In
      particular, they assume `s->async` is valid (where `s` points to the
      read or write subdevice), which it won't be if it has been set
      incorrectly.  This can lead to a NULL pointer dereference.
      
      Check `s->async` is non-NULL in `comedi_poll()`, `comedi_read()` and
      `comedi_write()` to avoid the bug.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9cb9a591
    • Joseph Salisbury's avatar
      ACPI: Add DMI entry for Sony VGN-FW41E_H · 30f3a0a7
      Joseph Salisbury authored
      commit 66f2fda9 upstream.
      
      This patch adds a quirk to allow the Sony VGN-FW41E_H to suspend/resume
      properly.
      
      References: http://bugs.launchpad.net/bugs/1113547Signed-off-by: default avatarJoseph Salisbury <joseph.salisbury@canonical.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      30f3a0a7
    • Rajanikanth H.V's avatar
      ab8500_btemp: Demote initcall sequence · 15642204
      Rajanikanth H.V authored
      commit eeb0751c upstream.
      
      Power supply subsystem creates thermal zone device for the property
      'POWER_SUPPLY_PROP_TEMP' which requires thermal subsystem to be ready
      before 'ab8500 battery temperature monitor' driver is initialized. ab8500
      btemp driver is initialized with subsys_initcall whereas thermal subsystem
      is initialized with fs_initcall which causes
      thermal_zone_device_register(...) to crash since the required structure
      'thermal_class' is not initialized yet:
      
      Unable to handle kernel NULL pointer dereference at virtual address 000000a4
      pgd = c0004000
      [000000a4] *pgd=00000000
      Internal error: Oops: 5 [#1] PREEMPT SMP ARM
      Modules linked in:
      CPU: 0    Tainted: G        W     (3.8.0-rc4-00001-g632fda8-dirty #1)
      PC is at _raw_spin_lock+0x18/0x54
      LR is at get_device_parent+0x50/0x1b8
      pc : [<c02f1dd0>]    lr : [<c01cb248>]    psr: 60000013
      sp : ef04bdc8  ip : 00000000  fp : c0446180
      r10: ef216e38  r9 : c03af5d0  r8 : ef275c18
      r7 : 00000000  r6 : c0476c14  r5 : ef275c18  r4 : ef095840
      r3 : ef04a000  r2 : 00000001  r1 : 00000000  r0 : 000000a4
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c5787d  Table: 0000404a  DAC: 00000015
      Process swapper/0 (pid: 1, stack limit = 0xef04a238)
      Stack: (0xef04bdc8 to 0xef04c000)
      [...]
      [<c02f1dd0>] (_raw_spin_lock+0x18/0x54) from [<c01cb248>] (get_device_parent+0x50/0x1b8)
      [<c01cb248>] (get_device_parent+0x50/0x1b8) from [<c01cb8d8>] (device_add+0xa4/0x574)
      [<c01cb8d8>] (device_add+0xa4/0x574) from [<c020b91c>] (thermal_zone_device_register+0x118/0x938)
      [<c020b91c>] (thermal_zone_device_register+0x118/0x938) from [<c0202030>] (power_supply_register+0x170/0x1f8)
      [<c0202030>] (power_supply_register+0x170/0x1f8) from [<c02055ec>] (ab8500_btemp_probe+0x208/0x47c)
      [<c02055ec>] (ab8500_btemp_probe+0x208/0x47c) from [<c01cf0dc>] (platform_drv_probe+0x14/0x18)
      [<c01cf0dc>] (platform_drv_probe+0x14/0x18) from [<c01cde70>] (driver_probe_device+0x74/0x20c)
      [<c01cde70>] (driver_probe_device+0x74/0x20c) from [<c01ce094>] (__driver_attach+0x8c/0x90)
      [<c01ce094>] (__driver_attach+0x8c/0x90) from [<c01cc640>] (bus_for_each_dev+0x4c/0x80)
      [<c01cc640>] (bus_for_each_dev+0x4c/0x80) from [<c01cd6b4>] (bus_add_driver+0x16c/0x23c)
      [<c01cd6b4>] (bus_add_driver+0x16c/0x23c) from [<c01ce54c>] (driver_register+0x78/0x14c)
      [<c01ce54c>] (driver_register+0x78/0x14c) from [<c00086ac>] (do_one_initcall+0xfc/0x164)
      [<c00086ac>] (do_one_initcall+0xfc/0x164) from [<c02e89c8>] (kernel_init+0x120/0x2b8)
      [<c02e89c8>] (kernel_init+0x120/0x2b8) from [<c000e358>] (ret_from_fork+0x14/0x3c)
      Code: e3c3303f e5932004 e2822001 e5832004 (e1903f9f)
      ---[ end trace ed9df72941b5bada ]---
      Signed-off-by: default avatarRajanikanth H.V <rajanikanth.hv@stericsson.com>
      Signed-off-by: default avatarAnton Vorontsov <anton@enomsg.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      15642204
    • Lee Jones's avatar
      ab8500-chargalg: Only root should have write permission on sysfs file · 71b9101a
      Lee Jones authored
      commit e3455002 upstream.
      
      Only root should have write permission on sysfs file ab8500_chargalg/chargalg.
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      71b9101a
    • NeilBrown's avatar
      bq27x00_battery: Fix bugs introduced with BQ27425 support · eddf61b2
      NeilBrown authored
      commit bde83b9a upstream.
      
      commit a66f59ba
      
          bq27x00_battery: Add support for BQ27425 chip
      
      introduced 2 bugs.
      
      1/ 'chip' was set to BQ27425 unconditionally - breaking support for
         other devices;
      
      2/ BQ27425 does not support cycle count, how the code still tries to
         get the cycle count for BQ27425, and now does it twice for other chips.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Cc: Saranya Gopal <saranya.gopal@intel.com>
      Signed-off-by: default avatarAnton Vorontsov <anton@enomsg.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eddf61b2
    • Li Zefan's avatar
      cgroup: fix exit() vs rmdir() race · ec463f0c
      Li Zefan authored
      commit 71b5707e upstream.
      
      In cgroup_exit() put_css_set_taskexit() is called without any lock,
      which might lead to accessing a freed cgroup:
      
      thread1                           thread2
      ---------------------------------------------
      exit()
        cgroup_exit()
          put_css_set_taskexit()
            atomic_dec(cgrp->count);
                                         rmdir();
            /* not safe !! */
            check_for_release(cgrp);
      
      rcu_read_lock() can be used to make sure the cgroup is alive.
      Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ec463f0c
    • Li Zefan's avatar
      cpuset: fix cpuset_print_task_mems_allowed() vs rename() race · b19c8d0b
      Li Zefan authored
      commit 63f43f55 upstream.
      
      rename() will change dentry->d_name. The result of this race can
      be worse than seeing partially rewritten name, but we might access
      a stale pointer because rename() will re-allocate memory to hold
      a longer name.
      
      It's safe in the protection of dentry->d_lock.
      
      v2: check NULL dentry before acquiring dentry lock.
      Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b19c8d0b
    • Seiji Aguchi's avatar
      pstore: Avoid deadlock in panic and emergency-restart path · 225234a2
      Seiji Aguchi authored
      commit 9f244e9c upstream.
      
      [Issue]
      
      When pstore is in panic and emergency-restart paths, it may be blocked
      in those paths because it simply takes spin_lock.
      
      This is an example scenario which pstore may hang up in a panic path:
      
       - cpuA grabs psinfo->buf_lock
       - cpuB panics and calls smp_send_stop
       - smp_send_stop sends IRQ to cpuA
       - after 1 second, cpuB gives up on cpuA and sends an NMI instead
       - cpuA is now in an NMI handler while still holding buf_lock
       - cpuB is deadlocked
      
      This case may happen if a firmware has a bug and
      cpuA is stuck talking with it more than one second.
      
      Also, this is a similar scenario in an emergency-restart path:
      
       - cpuA grabs psinfo->buf_lock and stucks in a firmware
       - cpuB kicks emergency-restart via either sysrq-b or hangcheck timer.
         And then, cpuB is deadlocked by taking psinfo->buf_lock again.
      
      [Solution]
      
      This patch avoids the deadlocking issues in both panic and emergency_restart
      paths by introducing a function, is_non_blocking_path(), to check if a cpu
      can be blocked in current path.
      
      With this patch, pstore is not blocked even if another cpu has
      taken a spin_lock, in those paths by changing from spin_lock_irqsave
      to spin_trylock_irqsave.
      
      In addition, according to a comment of emergency_restart() in kernel/sys.c,
      spin_lock shouldn't be taken in an emergency_restart path to avoid
      deadlock. This patch fits the comment below.
      
      <snip>
      /**
       *      emergency_restart - reboot the system
       *
       *      Without shutting down any hardware or taking any locks
       *      reboot the system.  This is called when we know we are in
       *      trouble so this is our best effort to reboot.  This is
       *      safe to call in interrupt context.
       */
      void emergency_restart(void)
      <snip>
      Signed-off-by: default avatarSeiji Aguchi <seiji.aguchi@hds.com>
      Acked-by: default avatarDon Zickus <dzickus@redhat.com>
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
      Cc: CAI Qian <caiqian@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      225234a2
    • Tejun Heo's avatar
      workqueue: consider work function when searching for busy work items · e50e7d63
      Tejun Heo authored
      commit a2c1c57b upstream.
      
      To avoid executing the same work item concurrenlty, workqueue hashes
      currently busy workers according to their current work items and looks
      up the the table when it wants to execute a new work item.  If there
      already is a worker which is executing the new work item, the new item
      is queued to the found worker so that it gets executed only after the
      current execution finishes.
      
      Unfortunately, a work item may be freed while being executed and thus
      recycled for different purposes.  If it gets recycled for a different
      work item and queued while the previous execution is still in
      progress, workqueue may make the new work item wait for the old one
      although the two aren't really related in any way.
      
      In extreme cases, this false dependency may lead to deadlock although
      it's extremely unlikely given that there aren't too many self-freeing
      work item users and they usually don't wait for other work items.
      
      To alleviate the problem, record the current work function in each
      busy worker and match it together with the work item address in
      find_worker_executing_work().  While this isn't complete, it ensures
      that unrelated work items don't interact with each other and in the
      very unlikely case where a twisted wq user triggers it, it's always
      onto itself making the culprit easy to spot.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarAndrey Isakov <andy51@gmx.ru>
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=51701
      Cc: stable@vger.kernel.org
      e50e7d63
    • Miklos Szeredi's avatar
      fuse: don't WARN when nlink is zero · c205ae0e
      Miklos Szeredi authored
      commit dfca7ceb upstream.
      
      drop_nlink() warns if nlink is already zero.  This is triggerable by a buggy
      userspace filesystem.  The cure, I think, is worse than the disease so disable
      the warning.
      Reported-by: default avatarTero Roponen <tero.roponen@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c205ae0e
    • Fernando Luis Vázquez Cao's avatar
      HID: clean up quirk for Sony RF receivers · d62365d1
      Fernando Luis Vázquez Cao authored
      commit 99d24902 upstream.
      
      Document what the fix-up is does and make it more robust by ensuring
      that it is only applied to the USB interface that corresponds to the
      mouse (sony_report_fixup() is called once per interface during probing).
      Signed-off-by: default avatarFernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d62365d1
    • Fernando Luis Vázquez Cao's avatar
      HID: add support for Sony RF receiver with USB product id 0x0374 · 9637341b
      Fernando Luis Vázquez Cao authored
      commit a4649184 upstream.
      
      Some Vaio desktop computers, among them the VGC-LN51JGB multimedia PC, have
      a RF receiver, multi-interface USB device 054c:0374, that is used to connect
      a wireless keyboard and a wireless mouse.
      
      The keyboard works flawlessly, but the mouse (VGP-WMS3 in my case) does not
      seem to be generating any pointer events. The problem is that the mouse pointer
      is wrongly declared as a constant non-data variable in the report descriptor
      (see lsusb and usbhid-dump output below), with the consequence that it is
      ignored by the HID code.
      
      Add this device to the have-special-driver list and fix up the report
      descriptor in the Sony-specific driver which happens to already have a fixup
      for a similar firmware bug.
      
      # lsusb -vd 054C:0374
      Bus 003 Device 002: ID 054c:0374 Sony Corp.
      Device Descriptor:
        bLength                18
        bDescriptorType         1
        bcdUSB               2.00
        bDeviceClass            0 (Defined at Interface level)
        bDeviceSubClass         0
        bDeviceProtocol         0
        bMaxPacketSize0         8
        idVendor           0x054c Sony Corp.
        idProduct          0x0374
        iSerial                 0
      [...]
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        1
            bAlternateSetting       0
            bNumEndpoints           1
            bInterfaceClass         3 Human Interface Device
            bInterfaceSubClass      1 Boot Interface Subclass
            bInterfaceProtocol      2 Mouse
            iInterface              2 RF Receiver
      [...]
                Report Descriptor: (length is 100)
      [...]
                  Item(Global): Usage Page, data= [ 0x01 ] 1
                                  Generic Desktop Controls
                  Item(Local ): Usage, data= [ 0x30 ] 48
                                  Direction-X
                  Item(Local ): Usage, data= [ 0x31 ] 49
                                  Direction-Y
                  Item(Global): Report Count, data= [ 0x02 ] 2
                  Item(Global): Report Size, data= [ 0x08 ] 8
                  Item(Global): Logical Minimum, data= [ 0x81 ] 129
                  Item(Global): Logical Maximum, data= [ 0x7f ] 127
                  Item(Main  ): Input, data= [ 0x07 ] 7
                                  Constant Variable Relative No_Wrap Linear
                                  Preferred_State No_Null_Position Non_Volatile Bitfield
      
      # usbhid-dump
      003:002:001:DESCRIPTOR         1357910009.758544
       05 01 09 02 A1 01 05 01 09 02 A1 02 85 01 09 01
       A1 00 05 09 19 01 29 05 95 05 75 01 15 00 25 01
       81 02 75 03 95 01 81 01 05 01 09 30 09 31 95 02
       75 08 15 81 25 7F 81 07 A1 02 85 01 09 38 35 00
       45 00 15 81 25 7F 95 01 75 08 81 06 C0 A1 02 85
       01 05 0C 15 81 25 7F 95 01 75 08 0A 38 02 81 06
       C0 C0 C0 C0
      Signed-off-by: default avatarFernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9637341b
    • J. Bruce Fields's avatar
      svcrpc: fix rpc server shutdown races · acb9bc5f
      J. Bruce Fields authored
      commit cc630d9f upstream.
      
      Rewrite server shutdown to remove the assumption that there are no
      longer any threads running (no longer true, for example, when shutting
      down the service in one network namespace while it's still running in
      others).
      
      Do that by doing what we'd do in normal circumstances: just CLOSE each
      socket, then enqueue it.
      
      Since there may not be threads to handle the resulting queued xprts,
      also run a simplified version of the svc_recv() loop run by a server to
      clean up any closed xprts afterwards.
      Tested-by: default avatarJason Tibbitts <tibbs@math.uh.edu>
      Tested-by: default avatarPaweł Sikora <pawel.sikora@agmk.net>
      Acked-by: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      acb9bc5f
    • J. Bruce Fields's avatar
      svcrpc: make svc_age_temp_xprts enqueue under sv_lock · cc5e7bc7
      J. Bruce Fields authored
      commit e75bafbf upstream.
      
      svc_age_temp_xprts expires xprts in a two-step process: first it takes
      the sv_lock and moves the xprts to expire off their server-wide list
      (sv_tempsocks or sv_permsocks) to a local list.  Then it drops the
      sv_lock and enqueues and puts each one.
      
      I see no reason for this: svc_xprt_enqueue() will take sp_lock, but the
      sv_lock and sp_lock are not otherwise nested anywhere (and documentation
      at the top of this file claims it's correct to nest these with sp_lock
      inside.)
      Tested-by: default avatarJason Tibbitts <tibbs@math.uh.edu>
      Tested-by: default avatarPaweł Sikora <pawel.sikora@agmk.net>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cc5e7bc7
    • majianpeng's avatar
      nfsd: Fix memleak · d7bfb000
      majianpeng authored
      commit 2d32b29a upstream.
      
      When free nfs-client, it must free the ->cl_stateids.
      Signed-off-by: default avatarJianpeng Ma <majianpeng@gmail.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d7bfb000
    • Lukas Czerner's avatar
      ext4: fix free clusters calculation in bigalloc filesystem · 0ff827cf
      Lukas Czerner authored
      commit 304e220f upstream.
      
      ext4_has_free_clusters() should tell us whether there is enough free
      clusters to allocate, however number of free clusters in the file system
      is converted to blocks using EXT4_C2B() which is not only wrong use of
      the macro (we should have used EXT4_NUM_B2C) but it's also completely
      wrong concept since everything else is in cluster units.
      
      Moreover when calculating number of root clusters we should be using
      macro EXT4_NUM_B2C() instead of EXT4_B2C() otherwise the result might be
      off by one. However r_blocks_count should always be a multiple of the
      cluster ratio so doing a plain bit shift should be enough here. We
      avoid using EXT4_B2C() because it's confusing.
      
      As a result of the first problem number of free clusters is much bigger
      than it should have been and ext4_has_free_clusters() would return 1 even
      if there is really not enough free clusters available.
      
      Fix this by removing the EXT4_C2B() conversion of free clusters and
      using bit shift when calculating number of root clusters. This bug
      affects number of xfstests tests covering file system ENOSPC situation
      handling. With this patch most of the ENOSPC problems with bigalloc file
      system disappear, especially the errors caused by delayed allocation not
      having enough space when the actual allocation is finally requested.
      Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0ff827cf
    • Lukas Czerner's avatar
      ext4: fix xattr block allocation/release with bigalloc · 808b5ab0
      Lukas Czerner authored
      commit 1231b3a1 upstream.
      
      Currently when new xattr block is created or released we we would call
      dquot_free_block() or dquot_alloc_block() respectively, among the else
      decrementing or incrementing the number of blocks assigned to the
      inode by one block.
      
      This however does not work for bigalloc file system because we always
      allocate/free the whole cluster so we have to count with that in
      dquot_free_block() and dquot_alloc_block() as well.
      
      Use the clusters-to-blocks conversion EXT4_C2B() when passing number of
      blocks to the dquot_alloc/free functions to fix the problem.
      
      The problem has been revealed by xfstests #117 (and possibly others).
      Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      808b5ab0
    • Niu Yawei's avatar
      ext4: fix race in ext4_mb_add_n_trim() · 8a6a8f04
      Niu Yawei authored
      commit f1167009 upstream.
      
      In ext4_mb_add_n_trim(), lg_prealloc_lock should be taken when
      changing the lg_prealloc_list.
      Signed-off-by: default avatarNiu Yawei <yawei.niu@intel.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8a6a8f04
    • Theodore Ts'o's avatar
      ext4: release sysfs kobject when failing to enable quotas on mount · bcd7f174
      Theodore Ts'o authored
      commit 72ba7450 upstream.
      
      In addition, print the error returned from ext4_enable_quotas()
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: default avatarCarlos Maiolino <cmaiolino@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bcd7f174
    • Eryu Guan's avatar
      ext4: check bh in ext4_read_block_bitmap() · 70d31ea8
      Eryu Guan authored
      commit 15b49132 upstream.
      
      Validate the bh pointer before using it, since
      ext4_read_block_bitmap_nowait() might return NULL.
      
      I've seen this in fsfuzz testing.
      
       EXT4-fs error (device loop0): ext4_read_block_bitmap_nowait:385: comm touch: Cannot get buffer for block bitmap - block_group = 0, block_bitmap = 3925999616
       BUG: unable to handle kernel NULL pointer dereference at           (null)
       IP: [<ffffffff8121de25>] ext4_wait_block_bitmap+0x25/0xe0
       ...
       Call Trace:
        [<ffffffff8121e1e5>] ext4_read_block_bitmap+0x35/0x60
        [<ffffffff8125e9c6>] ext4_free_blocks+0x236/0xb80
        [<ffffffff811d0d36>] ? __getblk+0x36/0x70
        [<ffffffff811d0a5f>] ? __find_get_block+0x8f/0x210
        [<ffffffff81191ef3>] ? kmem_cache_free+0x33/0x140
        [<ffffffff812678e5>] ext4_xattr_release_block+0x1b5/0x1d0
        [<ffffffff812679be>] ext4_xattr_delete_inode+0xbe/0x100
        [<ffffffff81222a7c>] ext4_free_inode+0x7c/0x4d0
        [<ffffffff812277b8>] ? ext4_mark_inode_dirty+0x88/0x230
        [<ffffffff8122993c>] ext4_evict_inode+0x32c/0x490
        [<ffffffff811b8cd7>] evict+0xa7/0x1c0
        [<ffffffff811b8ed3>] iput_final+0xe3/0x170
        [<ffffffff811b8f9e>] iput+0x3e/0x50
        [<ffffffff812316fd>] ext4_add_nondir+0x4d/0x90
        [<ffffffff81231d0b>] ext4_create+0xeb/0x170
        [<ffffffff811aae9c>] vfs_create+0xac/0xd0
        [<ffffffff811ac845>] lookup_open+0x185/0x1c0
        [<ffffffff8129e3b9>] ? selinux_inode_permission+0xa9/0x170
        [<ffffffff811acb54>] do_last+0x2d4/0x7a0
        [<ffffffff811af743>] path_openat+0xb3/0x480
        [<ffffffff8116a8a1>] ? handle_mm_fault+0x251/0x3b0
        [<ffffffff811afc49>] do_filp_open+0x49/0xa0
        [<ffffffff811bbaad>] ? __alloc_fd+0xdd/0x150
        [<ffffffff8119da28>] do_sys_open+0x108/0x1f0
        [<ffffffff8119db51>] sys_open+0x21/0x30
        [<ffffffff81618959>] system_call_fastpath+0x16/0x1b
      
      Also fix comment for ext4_read_block_bitmap_nowait()
      Signed-off-by: default avatarEryu Guan <guaneryu@gmail.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      70d31ea8
    • Theodore Ts'o's avatar
      ext4: return ENOMEM if sb_getblk() fails · 94bd696b
      Theodore Ts'o authored
      commit 860d21e2 upstream.
      
      The only reason for sb_getblk() failing is if it can't allocate the
      buffer_head.  So ENOMEM is more appropriate than EIO.  In addition,
      make sure that the file system is marked as being inconsistent if
      sb_getblk() fails.
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      94bd696b