1. 21 Jan, 2009 6 commits
    • H. Peter Anvin's avatar
      x86: add MSR_IA32_MISC_ENABLE bits to <asm/msr-index.h> · bdf21a49
      H. Peter Anvin authored
      Impact: None (new bit definitions currently unused)
      
      Add bit definitions for the MSR_IA32_MISC_ENABLE MSRs to
      <asm/msr-index.h>.
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      bdf21a49
    • Suresh Siddha's avatar
      x86: fix PTE corruption issue while mapping RAM using /dev/mem · 95971342
      Suresh Siddha authored
      Beschorner Daniel reported:
      > hwinfo problem since 2.6.28, showing this in the oops:
      >	Corrupted page table at address 7fd04de3ec00
      
      Also, PaX Team reported a regression with this commit:
      
      >	commit 9542ada8
      >	Author: Suresh Siddha <suresh.b.siddha@intel.com>
      >	Date:   Wed Sep 24 08:53:33 2008 -0700
      >
      >	    x86: track memtype for RAM in page struct
      
      This commit breaks mapping any RAM page through /dev/mem, as the
      reserve_memtype() was not initializing the return attribute type and as such
      corrupting the PTE entry that was setup with the return attribute type.
      
      Because of this bug, application mapping this RAM page through /dev/mem
      will die with "Corrupted page table at address xxxx" message in the kernel
      log and also the kernel identity mapping which maps the underlying RAM
      page gets converted to UC.
      
      Fix this by initializing the return attribute type before calling
      reserve_ram_pages_type()
      Reported-by: default avatarPaX Team <pageexec@freemail.hu>
      Reported-and-tested-by: default avatarBeschorner Daniel <Daniel.Beschorner@facton.com>
      Tested-and-Acked-by: default avatarPaX Team <pageexec@freemail.hu>
      Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      95971342
    • Thomas Renninger's avatar
      x86: mtrr fix debug boot parameter · 731f1872
      Thomas Renninger authored
      while looking at:
      
        http://bugzilla.kernel.org/show_bug.cgi?id=11541
      
      I realized that the mtrr.show param cannot work, because
      the code is processed much too early.
      
      This patch:
       - Declares mtrr.show as early_param
       - Stays consistent with the previous param (which I doubt
         that it ever worked), so mtrr.show=1 would still work
       - Declares mtrr_show as initdata
      Signed-off-by: default avatarThomas Renninger <trenn@suse.de>
      Acked-by: default avatarJan Beulich <jbeulich@novell.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      731f1872
    • Suresh Siddha's avatar
      x86: fix page attribute corruption with cpa() · a1e46212
      Suresh Siddha authored
      Impact: fix sporadic slowdowns and warning messages
      
      This patch fixes a performance issue reported by Linus on his
      Nehalem system. While Linus reverted the PAT patch (commit
      58dab916) which exposed the issue,
      existing cpa() code can potentially still cause wrong(page attribute
      corruption) behavior.
      
      This patch also fixes the "WARNING: at arch/x86/mm/pageattr.c:560" that
      various people reported.
      
      In 64bit kernel, kernel identity mapping might have holes depending
      on the available memory and how e820 reports the address range
      covering the RAM, ACPI, PCI reserved regions. If there is a 2MB/1GB hole
      in the address range that is not listed by e820 entries, kernel identity
      mapping will have a corresponding hole in its 1-1 identity mapping.
      
      If cpa() happens on the kernel identity mapping which falls into these holes,
      existing code fails like this:
      
      	__change_page_attr_set_clr()
      		__change_page_attr()
      			returns 0 because of if (!kpte). But doesn't
      			set cpa->numpages and cpa->pfn.
      		cpa_process_alias()
      			uses uninitialized cpa->pfn (random value)
      			which can potentially lead to changing the page
      			attribute of kernel text/data, kernel identity
      			mapping of RAM pages etc. oops!
      
      This bug was easily exposed by another PAT patch which was doing
      cpa() more often on kernel identity mapping holes (physical range between
      max_low_pfn_mapped and 4GB), where in here it was setting the
      cache disable attribute(PCD) for kernel identity mappings aswell.
      
      Fix cpa() to handle the kernel identity mapping holes. Retain
      the WARN() for cpa() calls to other not present address ranges
      (kernel-text/data, ioremap() addresses)
      Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      a1e46212
    • Ingo Molnar's avatar
      Revert "x86: signal: change type of paramter for sys_rt_sigreturn()" · 552b8aa4
      Ingo Molnar authored
      This reverts commit 4217458d.
      
      Justin Madru bisected this commit, it was causing weird Firefox
      crashes.
      
      The reason is that GCC mis-optimizes (re-uses) the on-stack parameters of
      the calling frame, which corrupts the syscall return pt_regs state and
      thus corrupts user-space register state.
      
      So we go back to the slightly less clean but more optimization-safe
      method of getting to pt_regs. Also add a comment to explain this.
      
      Resolves: http://bugzilla.kernel.org/show_bug.cgi?id=12505Reported-and-bisected-by: default avatarJustin Madru <jdm64@gawab.com>
      Tested-by: default avatarJustin Madru <jdm64@gawab.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      552b8aa4
    • Andi Kleen's avatar
      x86: use early clobbers in usercopy*.c · e0a96129
      Andi Kleen authored
      Impact: fix rare (but currently harmless) miscompile with certain configs and gcc versions
      
      Hugh Dickins noticed that strncpy_from_user() was miscompiled
      in some circumstances with gcc 4.3.
      
      Thanks to Hugh's excellent analysis it was easy to track down.
      
      Hugh writes:
      
      > Try building an x86_64 defconfig 2.6.29-rc1 kernel tree,
      > except not quite defconfig, switch CONFIG_PREEMPT_NONE=y
      > and CONFIG_PREEMPT_VOLUNTARY off (because it expands a
      > might_fault() there, which hides the issue): using a
      > gcc 4.3.2 (I've checked both openSUSE 11.1 and Fedora 10).
      >
      > It generates the following:
      >
      > 0000000000000000 <__strncpy_from_user>:
      >    0:   48 89 d1                mov    %rdx,%rcx
      >    3:   48 85 c9                test   %rcx,%rcx
      >    6:   74 0e                   je     16 <__strncpy_from_user+0x16>
      >    8:   ac                      lods   %ds:(%rsi),%al
      >    9:   aa                      stos   %al,%es:(%rdi)
      >    a:   84 c0                   test   %al,%al
      >    c:   74 05                   je     13 <__strncpy_from_user+0x13>
      >    e:   48 ff c9                dec    %rcx
      >   11:   75 f5                   jne    8 <__strncpy_from_user+0x8>
      >   13:   48 29 c9                sub    %rcx,%rcx
      >   16:   48 89 c8                mov    %rcx,%rax
      >   19:   c3                      retq
      >
      > Observe that "sub %rcx,%rcx; mov %rcx,%rax", whereas gcc 4.2.1
      > (and many other configs) say "sub %rcx,%rdx; mov %rdx,%rax".
      > Isn't it returning 0 when it ought to be returning strlen?
      
      The asm constraints for the strncpy_from_user() result were missing an
      early clobber, which tells gcc that the last output arguments
      are written before all input arguments are read.
      
      Also add more early clobbers in the rest of the file and fix 32-bit
      usercopy.c in the same way.
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      [ since this API is rarely used and no in-kernel user relies on a 'len'
        return value (they only rely on negative return values) this miscompile
        was never noticed in the field. But it's worth fixing it nevertheless. ]
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e0a96129
  2. 19 Jan, 2009 5 commits
    • Gary Hade's avatar
      x86: remove kernel_physical_mapping_init() from init section · f5495506
      Gary Hade authored
      Impact: fix crash with memory hotplug enabled
      
      kernel_physical_mapping_init() is called during memory hotplug
      so it does not belong in the init section.
      
      If the kernel is built with CONFIG_DEBUG_SECTION_MISMATCH=y on
      the make command line, arch/x86/mm/init_64.c is compiled with
      the -fno-inline-functions-called-once gcc option defeating
      inlining of kernel_physical_mapping_init() within init_memory_mapping().
      
      When kernel_physical_mapping_init() is not inlined it is placed
      in the .init.text section according to the __init in it's current
      declaration.  A later call to kernel_physical_mapping_init() during
      a memory hotplug operation encounters an int3 trap because the
      .init.text section memory has been freed.
      
      This patch eliminates the crash caused by the int3 trap by moving the
      non-inlined kernel_physical_mapping_init() from .init.text to .meminit.text.
      Signed-off-by: default avatarGary Hade <garyhade@us.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f5495506
    • Ingo Molnar's avatar
      fix: crash: IP: __bitmap_intersects+0x48/0x73 · bfa318ad
      Ingo Molnar authored
      -tip testing found this crash:
      
      > [   35.258515] calling  acpi_cpufreq_init+0x0/0x127 @ 1
      > [   35.264127] BUG: unable to handle kernel NULL pointer dereference at (null)
      > [   35.267554] IP: [<ffffffff80478092>] __bitmap_intersects+0x48/0x73
      > [   35.267554] PGD 0
      > [   35.267554] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
      
      arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c is still broken: there's no
      allocation of the variable mask, so we pass in an uninitialized cmd.mask
      field to drv_read(), which then passes it to the scheduler which then
      crashes ...
      
      Switch it over to the much simpler constant-cpumask-pointers approach.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      bfa318ad
    • Mike Travis's avatar
      cpufreq: use work_on_cpu in acpi-cpufreq.c for drv_read and drv_write · 72859081
      Mike Travis authored
      Impact: use new work_on_cpu function to reduce stack usage
      
      Replace the saving of current->cpus_allowed and set_cpus_allowed_ptr() with
      a work_on_cpu function for drv_read() and drv_write().
      
      Basically converts do_drv_{read,write} into "work_on_cpu" functions that
      are now called by drv_read and drv_write.
      
      Note: This patch basically reverts 50c668d6 which reverted 7503bfba, now
      that the work_on_cpu() function is more stable.
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Acked-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Tested-by: default avatarDieter Ries <clip2@gmx.de>
      Tested-by: default avatarMaciej Rutecki <maciej.rutecki@gmail.com>
      Cc: Dave Jones <davej@redhat.com>
      Cc: <cpufreq@vger.kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      72859081
    • Rusty Russell's avatar
      work_on_cpu: Use our own workqueue. · 8ccad40d
      Rusty Russell authored
      Impact: remove potential clashes with generic kevent workqueue
      
      Annoyingly, some places we want to use work_on_cpu are already in
      workqueues.  As per Ingo's suggestion, we create a different workqueue
      for work_on_cpu.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      8ccad40d
    • Rusty Russell's avatar
      work_on_cpu: don't try to get_online_cpus() in work_on_cpu. · 31ad9081
      Rusty Russell authored
      Impact: remove potential circular lock dependency with cpu hotplug lock
      
      This has caused more problems than it solved, with a pile of cpu
      hotplug locking issues.
      
      Followup patches will get_online_cpus() in callers that need it, but
      if they don't do it they're no worse than before when they were using
      set_cpus_allowed without locking.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      31ad9081
  3. 18 Jan, 2009 3 commits
    • Leonardo Potenza's avatar
      x86: fix section mismatch warnings in kernel/setup_percpu.c · c7f8562a
      Leonardo Potenza authored
      The function setup_cpu_local_masks() has been marked __init, in
      order to remove the following section mismatch messages:
      
      WARNING: vmlinux.o(.text+0x3c2c7): Section mismatch in reference from the function setup_cpu_local_masks() to the function .init.text:alloc_bootmem_cpumask_var()
      The function setup_cpu_local_masks() references
      the function __init alloc_bootmem_cpumask_var().
      This is often because setup_cpu_local_masks lacks a __init
      annotation or the annotation of alloc_bootmem_cpumask_var is wrong.
      
      WARNING: vmlinux.o(.text+0x3c2d3): Section mismatch in reference from the function setup_cpu_local_masks() to the function .init.text:alloc_bootmem_cpumask_var()
      The function setup_cpu_local_masks() references
      the function __init alloc_bootmem_cpumask_var().
      This is often because setup_cpu_local_masks lacks a __init
      annotation or the annotation of alloc_bootmem_cpumask_var is wrong.
      
      WARNING: vmlinux.o(.text+0x3c2df): Section mismatch in reference from the function setup_cpu_local_masks() to the function .init.text:alloc_bootmem_cpumask_var()
      The function setup_cpu_local_masks() references
      the function __init alloc_bootmem_cpumask_var().
      This is often because setup_cpu_local_masks lacks a __init
      annotation or the annotation of alloc_bootmem_cpumask_var is wrong.
      
      WARNING: vmlinux.o(.text+0x3c2eb): Section mismatch in reference from the function setup_cpu_local_masks() to the function .init.text:alloc_bootmem_cpumask_var()
      The function setup_cpu_local_masks() references
      the function __init alloc_bootmem_cpumask_var().
      This is often because setup_cpu_local_masks lacks a __init
      annotation or the annotation of alloc_bootmem_cpumask_var is wrong.
      Signed-off-by: default avatarLeonardo Potenza <lpotenza@inwind.it>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      c7f8562a
    • Mike Travis's avatar
      x86: put trigger in to detect mismatched apic versions · b2b815d8
      Mike Travis authored
      Impact: add debug warning
      
      Fire off one message if two apic's discovered with different
      apic versions. (this code is only called during CPU init)
      
      The goal of this is to pave the way of the removal of the apic_version[]
      array. We dont expect any apic version incompatibilities in the x86
      landscape of systems [if so we dont handle them very well and probably
      never will handle deep apic version assymetries well], but it's prudent
      to have a debug check for one kernel cycle nevertheless.
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      b2b815d8
    • Jeff Mahoney's avatar
      x86: define ARCH_WANT_FRAME_POINTERS · 64dec40d
      Jeff Mahoney authored
      Commit da4276b8 changed a dependency
      for FRAME_POINTER from X86 to ARCH_WANT_FRAME_POINTERS, but didn't
      actually define it.
      
      This patch adds the definition for ARCH_WANT_FRAME_POINTERS. Without it,
      FRAME_POINTER can't be enabled on x86.
      Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      64dec40d
  4. 16 Jan, 2009 1 commit
    • Jan Beulich's avatar
      x86: fix assumed to be contiguous leaf page tables for kmap_atomic region (take 2) · a3c6018e
      Jan Beulich authored
      Debugging and original patch from Nick Piggin <npiggin@suse.de>
      
      The early fixmap pmd entry inserted at the very top of the KVA is causing the
      subsequent fixmap mapping code to not provide physically linear pte pages over
      the kmap atomic portion of the fixmap (which relies on said property to
      calculate pte addresses).
      
      This has caused weird boot failures in kmap_atomic much later in the boot
      process (initial userspace faults) on a 32-bit PAE system with a larger number
      of CPUs (smaller CPU counts tend not to run over into the next page so don't
      show up the problem).
      
      Solve this by attempting to clear out the page table, and copy any of its
      entries to the new one. Also, add a bug if a nonlinear condition is encountered
      and can't be resolved, which might save some hours of debugging if this fragile
      scheme ever breaks again...
      
      Once we have such logic, we can also use it to eliminate the early ioremap
      trickery around the page table setup for the fixmap area. This also fixes
      potential issues with FIX_* entries sharing the leaf page table with the early
      ioremap ones getting discarded by early_ioremap_clear() and not restored by
      early_ioremap_reset(). It at once eliminates the temporary (and configuration,
      namely NR_CPUS, dependent) unavailability of early fixed mappings during the
      time the fixmap area page tables get constructed.
      
      Finally, also replace the hard coded calculation of the initial table space
      needed for the fixmap area with a proper one, allowing kernels configured for
      large CPU counts to actually boot.
      
      Based-on: Nick Piggin <npiggin@suse.de>
      Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      a3c6018e
  5. 15 Jan, 2009 2 commits
  6. 14 Jan, 2009 1 commit
  7. 13 Jan, 2009 2 commits
    • Andi Kleen's avatar
      x86, generic: mark complex bitops.h inlines as __always_inline · c8399943
      Andi Kleen authored
      Impact: reduce kernel image size
      
      Hugh Dickins noticed that older gcc versions when the kernel
      is built for code size didn't inline some of the bitops.
      
      Mark all complex x86 bitops that have more than a single
      asm statement or two as always inline to avoid this problem.
      
      Probably should be done for other architectures too.
      
      Ingo then found a better fix that only requires
      a single line change, but it unfortunately only
      works on gcc 4.3.
      
      On older gccs the original patch still makes a ~0.3% defconfig
      difference with CONFIG_OPTIMIZE_INLINING=y.
      
      With gcc 4.1 and a defconfig like build:
      
          61169987 1138540  883788 8139326  7c323e vmlinux-oi-with-patch
          6137043 1138540  883788 8159371  7c808b vmlinux-optimize-inlining
      
      ~20k / 0.3% difference.
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      c8399943
    • Ingo Molnar's avatar
      x86, cpufreq: remove leftover copymask_copy() · 4a922a96
      Ingo Molnar authored
      Impact: fix potential boot crash on MAXSMP
      
      Remove code left over by:
      
        50c668d6: Revert "cpumask: use work_on_cpu in acpi-cpufreq.c for drv_read
      
      That cmd.cpumask is not allocated anymore. No impact on default !MAXSMP
      kernels.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      4a922a96
  8. 12 Jan, 2009 5 commits
  9. 11 Jan, 2009 1 commit
  10. 10 Jan, 2009 14 commits
    • Linus Torvalds's avatar
      Linux 2.6.29-rc1 · c5976504
      Linus Torvalds authored
      c5976504
    • Arjan van de Ven's avatar
      bootgraph: make the bootgraph script show async waiting time · d3f8ddea
      Arjan van de Ven authored
      It is useful for diagnosing boot performance to see where async function
      calls are waiting on serialization...  this patch adds this
      functionality to the bootgraph.pl script.
      
      The waiting time is shown as a half transparent, gray bar through the
      block that is waiting.
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d3f8ddea
    • Arjan van de Ven's avatar
      libata: only ports >= 0 need to synchronize · fa853a48
      Arjan van de Ven authored
      In a discussio with Jeff Garzik, he mentioned that the serialization
      for the libata port probes only needs to be within the domain of a host.
      This means that for the first port of each host (with ID 0), we don't
      need to wait, so we can relax our serialization a little.
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fa853a48
    • Arjan van de Ven's avatar
      libata: Add a per-host flag to opt-in into parallel port probes · 886ad09f
      Arjan van de Ven authored
      This patch adds a per host flag that allows drivers to opt in into
      having its busses scanned in parallel.
      
      Drivers that do not set this flag get their ports scanned in
      the "original" sequence.
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      886ad09f
    • Linus Torvalds's avatar
      Merge branch 'x86-fixes-for-linus' of... · 3d14bdad
      Linus Torvalds authored
      Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
      
      * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (36 commits)
        x86: fix section mismatch warnings in mcheck/mce_amd_64.c
        x86: offer frame pointers in all build modes
        x86: remove duplicated #include's
        x86: k8 numa register active regions later
        x86: update Alan Cox's email addresses
        x86: rename all fields of mpc_table mpc_X to X
        x86: rename all fields of mpc_oemtable oem_X to X
        x86: rename all fields of mpc_bus mpc_X to X
        x86: rename all fields of mpc_cpu mpc_X to X
        x86: rename all fields of mpc_intsrc mpc_X to X
        x86: rename all fields of mpc_lintsrc mpc_X to X
        x86: rename all fields of mpc_iopic mpc_X to X
        x86: irqinit_64.c init_ISA_irqs should be static
        Documentation/x86/boot.txt: payload length was changed to payload_length
        x86: setup_percpu.c fix style problems
        x86: irqinit_64.c fix style problems
        x86: irqinit_32.c fix style problems
        x86: i8259.c fix style problems
        x86: irq_32.c fix style problems
        x86: ioport.c fix style problems
        ...
      3d14bdad
    • Linus Torvalds's avatar
      Merge branch 'cpus4096-for-linus' of... · 4e9b1c18
      Linus Torvalds authored
      Merge branch 'cpus4096-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
      
      * 'cpus4096-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
        [IA64] fix typo in cpumask_of_pcibus()
        x86: fix x86_32 builds for summit and es7000 arch's
        cpumask: use work_on_cpu in acpi-cpufreq.c for read_measured_perf_ctrs
        cpumask: use work_on_cpu in acpi-cpufreq.c for drv_read and drv_write
        cpumask: use cpumask_var_t in acpi-cpufreq.c
        cpumask: use work_on_cpu in acpi/cstate.c
        cpumask: convert struct cpufreq_policy to cpumask_var_t
        cpumask: replace CPUMASK_ALLOC etc with cpumask_var_t
        x86: cleanup remaining cpumask_t ops in smpboot code
        cpumask: update pci_bus_show_cpuaffinity to use new cpumask API
        cpumask: update local_cpus_show to use new cpumask API
        ia64: cpumask fix for is_affinity_mask_valid()
      4e9b1c18
    • Linus Torvalds's avatar
      btrfs: fix for write_super_lockfs/unlockfs error handling · 0176260f
      Linus Torvalds authored
      Commit c4be0c1d added the ability for
      write_super_lockfs to return errors, and renamed them to match.  But
      btrfs didn't get converted.
      
      Do the minimal conversion to make it compile again.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0176260f
    • Artem Bityutskiy's avatar
      rbtree: add const qualifier to some functions · f4b477c4
      Artem Bityutskiy authored
      The 'rb_first()', 'rb_last()', 'rb_next()' and 'rb_prev()' calls
      take a pointer to an RB node or RB root. They do not change the
      pointed objects, so add a 'const' qualifier in order to make life
      of the users of these functions easier.
      
      Indeed, if I have my own constant pointer &const struct my_type *p,
      and I call 'rb_next(&p->rb)', I get a GCC warning:
      
      warning: passing argument 1 of ‘rb_next’ discards qualifiers from pointer target type
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f4b477c4
    • Eric Piel's avatar
      LIS3LV02D: separate the core from HP ACPI API · cfce41a6
      Eric Piel authored
      The sensor can be accessed via various buses.  In particular, SPI, I²C
      and, on HP laptops, via a specific ACPI API (the only one currently
      supported).  Separate this latest platform from the core of the sensor
      driver to allow support for the other bus type.  The second, and more
      direct goal is actually to be able to merge this part with the
      hp-disk-leds driver, which has the same ACPI PNP number.
      Signed-off-by: default avatarPavel Machek <pavel@suse.cz>
      Signed-off-by: default avatarEric Piel <eric.piel@tremplin-utc.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cfce41a6
    • Takashi Sato's avatar
      filesystem freeze: remove XFS specific ioctl interfaces for freeze feature · 8e961870
      Takashi Sato authored
      It removes XFS specific ioctl interfaces and request codes
      for freeze feature.
      
      This patch has been supplied by David Chinner.
      Signed-off-by: default avatarDave Chinner <dgc@sgi.com>
      Signed-off-by: default avatarTakashi Sato <t-sato@yk.jp.nec.com>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: <xfs-masters@oss.sgi.com>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dave Kleikamp <shaggy@austin.ibm.com>
      Cc: Alasdair G Kergon <agk@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8e961870
    • Takashi Sato's avatar
      filesystem freeze: implement generic freeze feature · fcccf502
      Takashi Sato authored
      The ioctls for the generic freeze feature are below.
      o Freeze the filesystem
        int ioctl(int fd, int FIFREEZE, arg)
          fd: The file descriptor of the mountpoint
          FIFREEZE: request code for the freeze
          arg: Ignored
          Return value: 0 if the operation succeeds. Otherwise, -1
      
      o Unfreeze the filesystem
        int ioctl(int fd, int FITHAW, arg)
          fd: The file descriptor of the mountpoint
          FITHAW: request code for unfreeze
          arg: Ignored
          Return value: 0 if the operation succeeds. Otherwise, -1
          Error number: If the filesystem has already been unfrozen,
                        errno is set to EINVAL.
      
      [akpm@linux-foundation.org: fix CONFIG_BLOCK=n]
      Signed-off-by: default avatarTakashi Sato <t-sato@yk.jp.nec.com>
      Signed-off-by: default avatarMasayuki Hamaguchi <m-hamaguchi@ys.jp.nec.com>
      Cc: <xfs-masters@oss.sgi.com>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dave Kleikamp <shaggy@austin.ibm.com>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Alasdair G Kergon <agk@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fcccf502
    • Takashi Sato's avatar
      filesystem freeze: add error handling of write_super_lockfs/unlockfs · c4be0c1d
      Takashi Sato authored
      Currently, ext3 in mainline Linux doesn't have the freeze feature which
      suspends write requests.  So, we cannot take a backup which keeps the
      filesystem's consistency with the storage device's features (snapshot and
      replication) while it is mounted.
      
      In many case, a commercial filesystem (e.g.  VxFS) has the freeze feature
      and it would be used to get the consistent backup.
      
      If Linux's standard filesystem ext3 has the freeze feature, we can do it
      without a commercial filesystem.
      
      So I have implemented the ioctls of the freeze feature.
      I think we can take the consistent backup with the following steps.
      1. Freeze the filesystem with the freeze ioctl.
      2. Separate the replication volume or create the snapshot
         with the storage device's feature.
      3. Unfreeze the filesystem with the unfreeze ioctl.
      4. Take the backup from the separated replication volume
         or the snapshot.
      
      This patch:
      
      VFS:
      Changed the type of write_super_lockfs and unlockfs from "void"
      to "int" so that they can return an error.
      Rename write_super_lockfs and unlockfs of the super block operation
      freeze_fs and unfreeze_fs to avoid a confusion.
      
      ext3, ext4, xfs, gfs2, jfs:
      Changed the type of write_super_lockfs and unlockfs from "void"
      to "int" so that write_super_lockfs returns an error if needed,
      and unlockfs always returns 0.
      
      reiserfs:
      Changed the type of write_super_lockfs and unlockfs from "void"
      to "int" so that they always return 0 (success) to keep a current behavior.
      Signed-off-by: default avatarTakashi Sato <t-sato@yk.jp.nec.com>
      Signed-off-by: default avatarMasayuki Hamaguchi <m-hamaguchi@ys.jp.nec.com>
      Cc: <xfs-masters@oss.sgi.com>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dave Kleikamp <shaggy@austin.ibm.com>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Alasdair G Kergon <agk@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c4be0c1d
    • Harvey Harrison's avatar
      memstick: annotate endianness of attribute structs · 69347a23
      Harvey Harrison authored
      The code was shifting the endianness appropriately everywhere, annotate
      the structs to avoid the sparse warnings when assigning the endian types
      to the struct members, or passing them to be[16|32]_to_cpu:
      
      drivers/memstick/core/mspro_block.c:331:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:333:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:335:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:337:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:341:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:347:4: warning: cast to restricted __be32
      drivers/memstick/core/mspro_block.c:356:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:358:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:364:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:367:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:369:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:371:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:377:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:478:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:480:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:482:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:484:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:486:4: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:689:22:    expected unsigned int [unsigned] [assigned] data_address
      drivers/memstick/core/mspro_block.c:689:22:    got restricted __be32 [usertype] <noident>
      drivers/memstick/core/mspro_block.c:697:3: warning: cast to restricted __be32
      drivers/memstick/core/mspro_block.c:960:17: warning: incorrect type in initializer (different base types)
      drivers/memstick/core/mspro_block.c:960:17:    expected unsigned short [unsigned] data_count
      drivers/memstick/core/mspro_block.c:960:17:    got restricted __be16 [usertype] <noident>
      drivers/memstick/core/mspro_block.c:993:6: warning: cast to restricted __be16
      drivers/memstick/core/mspro_block.c:995:28: warning: cast to restricted __be16
      Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
      Cc: Alex Dubov <oakad@yahoo.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      69347a23
    • Larry Finger's avatar
      hp-wmi: handle rfkill_register() failure · fe8e4e03
      Larry Finger authored
      Compilation of the HP WMI hotkeys code results in the following:
      
        CC [M]  drivers/platform/x86/hp-wmi.o
      drivers/platform/x86/hp-wmi.c: In function hp_wmi_bios_setup:
      drivers/platform/x86/hp-wmi.c:431: warning: ignoring return value of rfkill_register,
      	 declared with attribute warn_unused_result
      drivers/platform/x86/hp-wmi.c:441: warning: ignoring return value of rfkill_register,
      	 declared with attribute warn_unused_result
      drivers/platform/x86/hp-wmi.c:450: warning: ignoring return value of rfkill_register,
      	 declared with attribute warn_unused_result
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Len Brown <lenb@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fe8e4e03