20 Oct, 2007

40 commits

  • Convert kmalloc() + memset() to kzalloc().

    Signed-off-by: Dmitry Monakhov
    Signed-off-by: Alasdair G Kergon

    Dmitry Monakhov
     
  • Replacing n & (n - 1) for power of 2 check by is_power_of_2(n)

    Signed-off-by: vignesh babu
    Signed-off-by: Alasdair G Kergon

    vignesh babu
     
  • This patch fixes a bd_mount_sem counter corruption bug in device-mapper.

    thaw_bdev() should be called only when freeze_bdev() was called for the
    device.
    Otherwise, thaw_bdev() will up bd_mount_sem and corrupt the semaphore counter.
    struct block_device with the corrupted semaphore may remain in slab cache
    and be reused later.

    Attached patch will fix it by calling unlock_fs() instead.
    unlock_fs() will determine whether it should call thaw_bdev()
    by checking the device is frozen or not.

    Easy reproducer is:
    #!/bin/sh
    while [ 1 ]; do
    dmsetup --notable create a
    dmsetup --nolockfs suspend a
    dmsetup remove a
    done

    It's not easy to see the effect of corrupted semaphore.
    So I have tested with putting printk below in bdev_alloc_inode():
    if (atomic_read(&ei->bdev.bd_mount_sem.count) != 1)
    printk(KERN_DEBUG "Incorrect semaphore count = %d (%p)\n",
    atomic_read(&ei->bdev.bd_mount_sem.count),
    &ei->bdev);

    Without the patch, I saw something like:
    Incorrect semaphore count = 17 (f2ab91c0)

    With the patch, the message didn't appear.

    The bug was introduced in 2.6.16 with this bug fix:

    commit d9dde59ba03095e526640988c0fedd75e93bc8b7
    Date: Fri Feb 24 13:04:24 2006 -0800

    [PATCH] dm: missing bdput/thaw_bdev at removal

    Need to unfreeze and release bdev otherwise the bdev inode with
    inconsistent state is reused later and cause problem.

    and backported to 2.6.15.5.

    It occurs only in free_dev(), which is called only when the dm device is
    removed. The buggy code is executed only if md->suspended_bdev is
    non-NULL and that can happen only when the device was suspended without
    noflush.

    Signed-off-by: Jun'ichi Nomura
    Signed-off-by: Alasdair G Kergon
    Cc: stable@kernel.org

    Jun'ichi Nomura
     
  • Fix missing space in dm-delay target status output
    if separate read and write delay are configured.

    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon

    Milan Broz
     
  • Add missing 'dm_put_device' to dm-delay target constructor.

    Signed-off-by: Dmitry Monakhov
    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon

    Dmitry Monakhov
     
  • Add missing 'dm_io_client_destroy' to alloc_context error path.
    Reorganize mirror constructor error path in order to prevent
    workqueue leakage.

    Signed-off-by: Dmitry Monakhov
    Signed-off-by: Alasdair G Kergon

    Dmitry Monakhov
     
  • Insert missing kfree() in crypt_iv_essiv_ctr() error path.

    Signed-off-by: Dmitry Monakhov
    Signed-off-by: Alasdair G Kergon

    Dmitry Monakhov
     
  • Add a missing 'dm_put_device' in an error path in crypt target constructor.

    Signed-off-by: Dmitry Monakhov
    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon

    Dmitry Monakhov
     
  • Make size of dm_ioctl struct always 312 bytes on all supported
    architectures.

    This change retains compatibility with already-compiled code because
    it uses an embedded offset to locate the payload that follows the
    structure.

    On 64-bit architectures there is no change at all; on 32-bit
    we are increasing the size of dm-ioctl from 308 to 312 bytes.

    Currently with 32-bit userspace / 64-bit kernel on x86_64
    some ioctls (including rename, message) are incorrectly rejected
    by the comparison against 'param + 1'. This breaks userspace
    lvrename and multipath 'fail_if_no_path' changes, for example.

    (BTW Device-mapper uses its own versioning and ignores the ioctl
    size bits. Only the generic ioctl compat code on mixed arches
    checks them, and that will continue to accept both sizes for now,
    but we intend to list 308 as deprecated and eventually remove it.)

    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon
    Cc: Guido Guenther
    Cc: Kevin Corry
    Cc: stable@kernel.org

    Milan Broz
     
  • Re-order the initialisation of dm-rdac to avoid registering the hw
    handler before the workqueue has been initialised. Closes a race
    that would potentially give an oops.

    Signed-off-by: Bryn M. Reeves
    Signed-off-by: Alasdair G Kergon

    Bryn M. Reeves
     
  • * ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-x86: (33 commits)
    x86: convert cpuinfo_x86 array to a per_cpu array
    x86: introduce frame_pointer() and stack_pointer()
    x86 & generic: change to __builtin_prefetch()
    i386: do not BUG_ON() when MSR is unknown
    x86: acpi use cpu_physical_id
    x86: convert cpu_llc_id to be a per cpu variable
    x86: convert cpu_to_apicid to be a per cpu variable
    i386: introduce "used_vectors" bitmap which can be used to reserve vectors.
    x86: use raw locks during oopses
    x86: honor _PAGE_PSE bit on page walks
    i386: do cpuid_device_create() in CPU_UP_PREPARE instead of CPU_ONLINE.
    x86: implement missing x86_64 function smp_call_function_mask()
    x86: use descriptor's functions instead of inline assembly
    i386: consolidate show_regs and show_registers for i386
    i386: make callgraph use dump_trace() on i386/x86_64
    x86: enable iommu_merge by default
    i386: i386 add AMD64 Barcelona PMU MSR definitions to msr.h
    x86: Unify i386 and x86-64 early quirks
    x86: enable HPET on ICH3 and ICH4
    x86: force enable HPET on VT8235/8237 chipsets
    ...

    Manually fix trivial conflict with task pid container helper changes in
    arch/x86/kernel/process_32.c

    Linus Torvalds
     
  • * git://git.linux-nfs.org/pub/linux/nfs-2.6:
    NFSv4: Fix an rpc_cred reference leakage in fs/nfs/delegation.c
    NFSv4: Ensure that we wait for the CLOSE request to complete
    NFS: Fix a race in sillyrename
    NFS: Fix a writeback race...

    Linus Torvalds
     
  • Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Otherwise, we do end up breaking close-to-open semantics. We also end up
    breaking some of the silly-rename tests in Connectathon on some setups.

    Please refer to the bug-report at
    http://bugzilla.linux-nfs.org/show_bug.cgi?id=150

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • lookup() and sillyrename() can race one another because the sillyrename()
    completion cannot take the parent directory's inode->i_mutex since the
    latter may be held by whoever is calling dput().

    We therefore have little option but to add extra locking to ensure that
    nfs_lookup() and nfs_atomic_open() do not race with the sillyrename
    completion.
    If somebody has looked up the sillyrenamed file in the meantime, we just
    transfer the sillydelete information to the new dentry.

    Please refer to the bug-report at
    http://bugzilla.linux-nfs.org/show_bug.cgi?id=150

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • This patch fixes a regression that was introduced by commit
    44dd151d5c21234cc534c47d7382f5c28c3143cd

    We cannot zero the user page in nfs_mark_uptodate() any more, since

    a) We'd be modifying the page without holding the page lock
    b) We can race with other updates of the page, most notably
    because of the call to nfs_wb_page() in nfs_writepage_setup().

    Instead, we do the zeroing in nfs_update_request() if we see that we're
    creating a request that might potentially be marked as up to date.

    Thanks to Olivier Paquet for reporting the bug and providing a test-case.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
    kbuild: fix first module build
    kconfig: update kconfig-language text
    kbuild: introduce cc-cross-prefix
    kbuild: disable depmod in cross-compile kernel build
    kbuild: make deb-pkg - add 'Provides:' line
    kconfig: comment typo in scripts/kconfig/Makefile.
    kbuild: stop docproc segfaulting when SRCTREE isn't set.
    kbuild: modpost problem when symbols move from one module to another
    kbuild: cscope - filter out .tmp_* in find_sources
    kbuild: mailing list has moved
    kbuild: check asm symlink when building a kernel

    Linus Torvalds
     
  • When building a specific module before doing a total kernel
    build it failed because $(MORVERDIR) were missing.
    Creating the MODVERDIR explicit (independent of KBUILD_MODULES)
    fixed this. As a side-effect the MODVERDIR will be created
    also for a non-module build - but no harm done by that.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (41 commits)
    ACPICA: hw: Don't carry spinlock over suspend
    ACPICA: hw: remove use_lock flag from acpi_hw_register_{read, write}
    ACPI: cpuidle: port idle timer suspend/resume workaround to cpuidle
    ACPI: clean up acpi_enter_sleep_state_prep
    Hibernation: Make sure that ACPI is enabled in acpi_hibernation_finish
    ACPI: suppress uninitialized var warning
    cpuidle: consolidate 2.6.22 cpuidle branch into one patch
    ACPI: thinkpad-acpi: skip blanks before the data when parsing sysfs
    ACPI: AC: Add sysfs interface
    ACPI: SBS: Add sysfs alarm
    ACPI: SBS: Add ACPI_PROCFS around procfs handling code.
    ACPI: SBS: Add support for power_supply class (and sysfs)
    ACPI: SBS: Make SBS reads table-driven.
    ACPI: SBS: Simplify data structures in SBS
    ACPI: SBS: Split host controller (ACPI0001) from SBS driver (ACPI0002)
    ACPI: EC: Add new query handler to list head.
    ACPI: Add acpi_bus_generate_event4() function
    ACPI: Battery: add sysfs alarm
    ACPI: Battery: Add sysfs support
    ACPI: Battery: Misc clean-ups, no functional changes
    ...

    Fix up conflicts in drivers/misc/thinkpad_acpi.[ch] manually

    Linus Torvalds
     
  • Add kconfig-language docs for mainmenu, def_bool, and def_tristate.
    Remove "requires" as a synonym of "depends on" since it was removed
    from the parser in commit 247537b9a270b52cc0375adcb0fb2605a160cba5.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Sam Ravnborg

    Randy Dunlap
     
  • cc-cross-prefix is useful for the architecture that like
    to provide a default CROSS_COMPILE value,
    but may have several to select between.

    Sample usage:

    ifneq ($(SUBARCH),$(ARCH))
    ifeq ($(CROSS_COMPILE),)
    CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-)
    endif
    endif

    Actual usage by the different archs will taken care of later.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
    sched: fix guest time accounting going faster than user time accounting

    Linus Torvalds
     
  • * 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
    [MIPS] Delete totally outdated Documentation/mips/time.README
    [MIPS] Kill duplicated setup_irq() for cp0 timer
    [MIPS] Sibyte: Finish conversion to modern time APIs.
    [MIPS] time: Helpers to compute clocksource/event shift and mult values.
    [MIPS] SMTC: Build fix.
    [MIPS] time: Delete dead code.
    [MIPS] MIPSsim: Strip defconfig file to the bones.

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (51 commits)
    [CIFS] log better errors on failed mounts
    [CIFS] Return better error when server requires signing but client forbids
    [CIFS] fix typo
    [CIFS] acl support part 4
    [CIFS] Fix minor problems noticed by scan
    [CIFS] fix bad handling of EAGAIN error on kernel_recvmsg in cifs_demultiplex_thread
    [CIFS] build break
    [CIFS] endian fixes
    [CIFS] endian fixes in new acl code
    [CIFS] Fix some endianness problems in new acl code
    [CIFS] missing #endif from a previous patch
    [CIFS] formatting fixes
    [CIFS] Break up unicode_sessetup string functions
    [CIFS] parse server_GUID in SPNEGO negProt response
    [CIFS]
    [CIFS] Fix endian conversion problem in posix mkdir
    [CIFS] fix build break when lanman not enabled
    [CIFS] remove two sparse warnings
    [CIFS] remove compile warnings when debug disabled
    [CIFS] CIFS ACL support part 3
    ...

    Linus Torvalds
     
  • * ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-x86:
    x86: fix global_flush_tlb() bug

    Linus Torvalds
     
  • * 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6:
    [XFS] cleanup fid types mess
    [XFS] fixups after behavior removal merge into mainline git

    Linus Torvalds
     
  • * 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
    [NET]: Fix possible dev_deactivate race condition
    [INET]: Justification for local port range robustness.
    [PACKET]: Kill unused pg_vec_endpage() function
    [NET]: QoS/Sched as menuconfig
    [NET]: Fix bug in sk_filter race cures.
    [PATCH] mac80211: make ieee802_11_parse_elems return void

    Linus Torvalds
     
  • Fixes:
    drivers/edac/pasemi_edac: struct pci_device_id is 32 bytes. The last of 1 is:
    0x00 0x00 0x19 0x59 0x00 0x00 0xa0 0x0a 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
    FATAL: drivers/edac/pasemi_edac: struct pci_device_id is not terminated with a NULL entry!

    Signed-off-by: Stephen Rothwell
    Cc: Douglas Thompson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     
  • Save ~650 bytes here.

    add/remove: 4/0 grow/shrink: 0/7 up/down: 430/-1088 (-658)
    function old new delta
    __copy_fs_struct - 202 +202
    __put_fs_struct - 112 +112
    __exit_fs - 58 +58
    __exit_files - 58 +58
    exit_files 58 2 -56
    put_fs_struct 112 5 -107
    exit_fs 161 2 -159
    sys_unshare 774 590 -184
    copy_process 4031 3840 -191
    do_exit 1791 1597 -194
    copy_fs_struct 202 5 -197

    No difference in lmbench lat_proc tests on 2-way Opteron 246.
    Smaaaal degradation on UP P4 (within errors).

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Alexey Dobriyan
    Cc: Arjan van de Ven
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • This initialization of is not needed so just remove it.

    Signed-off-by: Mariusz Kozlowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mariusz Kozlowski
     
  • Here is some documentation explaining what is/how to use the Linux
    Kernel Markers.

    Signed-off-by: Mathieu Desnoyers
    Acked-by: "Frank Ch. Eigler"
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     
  • Module example showing how to use the Linux Kernel Markers.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Mathieu Desnoyers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     
  • Begin infrastructure for kernel code samples in the samples/ directory.
    Add its Kconfig and Kbuild files.
    Source its Kconfig file in all arch/ Kconfigs.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Mathieu Desnoyers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     
  • The marker activation functions sits in kernel/marker.c. A hash table is used
    to keep track of the registered probes and armed markers, so the markers
    within a newly loaded module that should be active can be activated at module
    load time.

    marker_query has been removed. marker_get_first, marker_get_next and
    marker_release should be used as iterators on the markers.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Mathieu Desnoyers
    Acked-by: "Frank Ch. Eigler"
    Cc: Christoph Hellwig
    Cc: Rusty Russell
    Cc: Mike Mason
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     
  • Quoting Randy:

    "It seems sad that this patch sources Kconfig.marker, a 7-line file,
    20-something times. Yes, you (we) don't want to put those 7 lines into
    20-something different files, so sourcing is the right thing.

    However, what you did for avr32 seems more on the right track to me: make
    _one_ Instrumentation support menu that includes PROFILING, OPROFILE, KPROBES,
    and MARKERS and then use (source) that in all of the arches."

    Signed-off-by: Mathieu Desnoyers
    Acked-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     
  • Prior to use struct marker in the linux kernel markers, we need to clean
    two drivers which use this structure name.

    Change bonding driver types :
    - struct marker to struct bond_marker.
    - marker_t to bond_marker_t.
    - marker_header to bond_marker_header.
    - marker_header_t to bond_marker_header_t.

    Change qla4xxx struct marker_entry usage :
    - Change struct marker_entry for struct qla4_marker_entry.

    Signed-off-by: Mathieu Desnoyers
    Cc: Chad Tindel
    Cc: Jay Vosburgh
    Cc: David Somayajulu
    Cc: James Bottomley
    Cc: Ravi Anand
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     
  • Enable "cgroup" (formerly containers) based fair group scheduling. This
    will let administrator create arbitrary groups of tasks (using "cgroup"
    pseudo filesystem) and control their cpu bandwidth usage.

    [akpm@linux-foundation.org: fix cpp condition]
    Signed-off-by: Srivatsa Vaddagiri
    Signed-off-by: Dhaval Giani
    Cc: Randy Dunlap
    Cc: Balbir Singh
    Cc: Paul Menage
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Srivatsa Vaddagiri
     
  • This adds the documentation for the extended crashkernel syntax into
    Documentation/kdump/kdump.txt.

    Signed-off-by: Bernhard Walle
    Cc: Andi Kleen
    Cc: "Luck, Tony"
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mundt
    Cc: Vivek Goyal
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bernhard Walle
     
  • This patch removes the crashkernel parsing from arch/sh/kernel/machine_kexec.c
    and calls the generic function, introduced in the generic patch, in
    setup_bootmem_allocator().

    This is necessary because the amount of System RAM must be known in this
    function now because of the new syntax.

    Signed-off-by: Bernhard Walle
    Acked-by: Paul Mundt
    Cc: Vivek Goyal
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bernhard Walle
     
  • This patch adapts the ppc64 code to use the generic parse_crashkernel()
    function introduced in the generic patch of that series.

    Signed-off-by: Bernhard Walle
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Vivek Goyal
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bernhard Walle