17 Oct, 2007

40 commits

  • Hello, I fixed and tested a small bug in lib/sort.c file, heap sort
    function.

    The fix avoids unnecessary swap of contents when i is 0 (saves few loads
    and stores), which happens every time sort function is called. I felt the
    fix is worth bringing it to your attention given the importance and
    frequent use of the sort function.

    Acked-by: Matt Mackall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Subbaiah Venkata
     
  • Remove linux/consolemap.h from make headers_install

    It contains no user interfaces.
    The defines in this file are used only for kernel internal state.

    Signed-off-by: Olaf Hering
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Hering
     
  • Remove some remaining vestiges of the old hacks jsm had to work around the old
    tty buffering. With the new tty buffering it simply doesn't matter any more.

    [michal.k.k.piotrowski@gmail.com: fix warning]
    Signed-off-by: Alan Cox
    Acked-by: Scott Kilau
    Cc: Michal Piotrowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • We simply define it to the same value. Nowdays the TTY flip value is
    irrelevant but the value it used is as good as any so why risk breaking it

    Signed-off-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • There have been issues with non-latin1 diacritics and unicode.
    http://bugzilla.kernel.org/show_bug.cgi?id=7746

    Git 759448f459234bfcf34b82471f0dba77a9aca498 `Kernel utf-8 handling'
    partly resolved it by adding conversion between diacritics and
    unicode. The patch below goes further by just turning diacritics into
    unicode, hence providing better future support. The kbd support can be
    fetched from
    http://bugzilla.kernel.org/attachment.cgi?id=12313

    This was tested in all of latin1, latin9, latin2 and unicode with french
    and czech dead keys.

    Turn the kernel accent_table into unicode, and extend ioctls KDGKBDIACR
    and KDSKBDIACR into their equivalents KDGKBDIACRUC and KDSKBDIACR.

    New function int conv_uni_to_8bit(u32 uni) for converting unicode into 8bit
    _input_. No, we don't want to store the translation, as it is potentially
    sparse and large.

    Signed-off-by: Samuel Thibault
    Cc: Jan Engelhardt
    Cc: "Antonino A. Daplas"
    Cc: David Woodhouse
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samuel Thibault
     
  • We can just use skb_mac_header now, and we don't need a wrapper function to
    perform the cast. Instead of requiring the reader to check aoe.h to look
    up what an aoe_hdr function does, I'd rather do without it.

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

    Ed L. Cashin
     
  • When a new block bitmap is read from disk in read_block_bitmap() there are
    a few bits that should ALWAYS be set. In particular, the blocks given by
    ext4_blk_bitmap, ext4_inode_bitmap and ext4_inode_table. Validate the
    block bitmap against these blocks.

    [akpm@linux-foundation.org: cleanups]
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Andreas Dilger
    Acked-by: Mingming Cao
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aneesh Kumar K.V
     
  • This adds the MMF_DUMP_ELF_HEADERS option to /proc/pid/coredump_filter.
    This dumps the first page (only) of a private file mapping if it appears to
    be a mapping of an ELF file. Including these pages in the core dump may
    give sufficient identifying information to associate the original DSO and
    executable file images and their debugging information with a core file in
    a generic way just from its contents (e.g. when those binaries were built
    with ld --build-id). I expect this to become the default behavior
    eventually. Existing versions of gdb can be confused by the core dumps it
    creates, so it won't enabled by default for some time to come. Soon many
    people will have systems with a gdb that handle these dumps, so they can
    arrange to set the bit at boot and have it inherited system-wide.

    This also cleans up the checking of the MMF_DUMP_* flag bits, which did not
    need to be using atomic macros.

    Signed-off-by: Roland McGrath
    Cc: Hidehiro Kawai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     
  • /usr/include/scsi is provided by glibc.
    Remove the scsi export from make headers_install target.

    Signed-off-by: Olaf Hering
    Cc: David Woodhouse
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Hering
     
  • The child was found on ->children list under tasklist_lock, it must have a
    valid ->signal. __exit_signal() both removes the task from parent->children
    and clears ->signal "atomically" under write_lock(tasklist).

    Remove unneeded checks.

    Signed-off-by: Oleg Nesterov
    Acked-by: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Cleanup. __group_complete_signal() wakes up ->group_exit_task twice. The
    second wakeup's state includes TASK_UNINTERRUPTIBLE, which is not very
    appropriate.

    Change the code to pass the "correct" argument to signal_wake_up() and kill
    now unneeded wake_up_process().

    Signed-off-by: Oleg Nesterov
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • The "p->exit_signal == -1 && p->ptrace == 0" check and the comment are
    bogus. We already did exactly the same check in eligible_child(), we did
    not drop tasklist_lock since then, and both variables need
    write_lock(tasklist) to be changed.

    Signed-off-by: Oleg Nesterov
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Nowadays thread_group_empty() and next_thread() are simple list operations,
    this optimization doesn't make sense: we are doing exactly same check one
    line below.

    Signed-off-by: Oleg Nesterov
    Acked-by: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • ->siglock provides enough protection to iterate over the thread group.

    Signed-off-by: Oleg Nesterov
    Acked-by: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Two threads, T1 and T2. T2 ptraces P, and P is not a child of ptracer's
    thread group. P exits and goes to TASK_ZOMBIE.

    T1 does wait_task_zombie(P):

    P->exit_state = TASK_DEAD;
    ...
    read_unlock(&tasklist_lock);

    T2 does exit(), takes tasklist,
    forget_original_parent() does
    __ptrace_unlink(P) but doesn't
    call do_notify_parent(P) because
    p->exit_state == EXIT_DEAD.

    Now, P is not visible to our process: __ptrace_unlink() removed it from
    ->children. We should send notification to P->parent and release P if and
    only if SIGCHLD is ignored.

    And we have 3 bugs:

    1. P->parent does do_wait() and gets -ECHILD (P is on ->parent->children,
    but its state is TASK_DEAD).

    2. // wait_task_zombie() continues

    if (put_user(...)) {
    // TODO: is this safe?
    p->exit_state = EXIT_ZOMBIE;
    return;
    }

    we return without notification/release, task_struct leaked.

    Solution: ignore -EFAULT and proceed. It is an application's bug if
    we can't fill infop/stat_addr (in case of VM_FAULT_OOM we have much
    more problems).

    3. // wait_task_zombie() continues

    if (p->real_parent != p->parent) {
    // Not taken, it was untraced'ed
    ...
    }

    release_task(p);

    we released the task which we shouldn't.

    Solution: check ->real_parent != ->parent before, under tasklist_lock,
    but use ptrace_unlink() instead of __ptrace_unlink() to check ->ptrace.

    This patch hopefully solves 2 and 3, the 1st bug will be fixed later, we need
    some cleanups in forget_original_parent/reparent_thread.

    However, the first race is very unlikely and not critical, so I hope it makes
    sense to fix 1 and 2 for now.

    4. Small cleanup: don't "restore" EXIT_ZOMBIE unless we know we are not going
    to realease the child.

    Signed-off-by: Oleg Nesterov
    Cc: Ingo Molnar
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • A zombie must have a valid ->signal, we are going to release it and
    __exit_signal() starts with BUG_ON(!sig).

    Signed-off-by: Oleg Nesterov
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • There's a small and unlikely memory leak in
    drivers/pnp/pnpbios/proc.c::proc_read_escd(). It's inside a sanity check,
    so it probably won't trigger often (if at all), however it *is* a potential
    leak and it's easy to avoid, so let's just fix it :)

    Signed-off-by: Jesper Juhl
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • This makes powerpc64's compat code use the new linux/elfcore-compat.h,
    reducing some hand-copied duplication.

    Signed-off-by: Roland McGrath
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Andi Kleen
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     
  • This adds the linux/elfcore-compat.h header file, which is the CONFIG_COMPAT
    analog of the linux/elfcore.h header. Each arch that needs to fake out
    fs/binfmt_elf.c for its compat code can use this header to replace the
    hand-copied definitions of the compat variants of struct elf_prstatus et al.
    Only the pr_reg field varies by arch, so asm/{compat,elf}.h must define
    compat_elf_gregset_t before linux/elfcore-compat.h can be used.

    It's a clean-up that every arch with compat core dumping code can benefit
    from. I only touched the ones I have handy to test at home. Doing the same
    for each other arch should be straightforward, and I'm happy to offer tips.

    Signed-off-by: Roland McGrath
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Andi Kleen
    Cc: "Luck, Tony"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     
  • The current code skips the check to verify whether the filesystem was
    previously cleanly unmounted, if (flags & UFS_ST_MASK) == UFS_ST_44BSD or
    UFS_ST_OLD. This looks like an inadvertent bug that slipped in due to
    parantheses in the compound conditional to me, especially given that
    ufs_get_fs_state() handles the UFS_ST_44BSD case perfectly well. So, let's
    fix the compound condition appropriately.

    Signed-off-by: Satyam Sharma
    Cc: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Satyam Sharma
     
  • Move prototypes and in-core structures to fs/ufs/ similar to what most
    other filesystems already do.

    I made little modifications: move also ufs debug macros and
    mount options constants into fs/ufs/ufs.h, this stuff
    also private for ufs.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Evgeniy Dushistov
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Driver does
    proc_mkdir("ipmi", NULL);
    but
    remove_proc_entry(proc_ipmi_root->name, &proc_root);

    This is OK and working if only slightly inconsistent. Also changing
    proc_root to NULL will help OpenVZ which has multiple proc roots and, as we
    now know, requires matching parents in such cases.

    Signed-off-by: Alexey Dobriyan
    Cc: Corey Minyard
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • With or without this patch, multi-threaded init's are not fully supported,
    but do_exit() is completely wrong. This becomes a real problem when we
    support pid namespaces.

    1. do_exit() panics when the main thread of /sbin/init exits. It should not
    until the whole thread group exits. Move the code below, under the
    "if (group_dead)" check.

    Note: this means that forget_original_parent() can use an already dead
    child_reaper()'s task_struct. This is OK for /sbin/init because

    - do_wait() from alive sub-thread still can reap a zombie, we iterate
    over all sub-thread's ->children lists

    - do_notify_parent() will wakeup some alive sub-thread because it sends
    the group-wide signal

    However, we should remove choose_new_parent()->BUG_ON(reaper->exit_state)
    for this.

    2. We are playing games with ->nsproxy->pid_ns. This code is bogus today, and
    it has to be changed anyway when we really support pid namespaces, just
    remove it.

    Signed-off-by: Oleg Nesterov
    Roland McGrath
    Cc: "Eric W. Biederman"
    Cc: Sukadev Bhattiprolu
    Cc: Serge Hallyn
    Cc: Cedric Le Goater
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • The Linux ELF loader is quite complicated and messy code (that could
    probably need a rewrite, but that's a different chapter). One particular
    messy part in it is the support for non ELF a.out ld.sos. This was
    originally added to make transition from a.out to ELF easier because an
    a.out ELF ld.so could be still build using an older a.out toolkit. But by
    now that should be fully obsolete and removing it would clean up
    binfmt_elf.c up a bit.

    I propose to deprecate this support and remove for 2.6.25.

    Drawback is that someone still runs their system with a.out ld.so
    they would need to update the ld.so when updating to a new kernel.

    This patch just adds an entry to the deprecation file and a printk
    warning users.

    [akpm@linux-foundation.org: better warning message]
    Signed-off-by: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     
  • With the recent changes, do_sigaction()->recalc_sigpending_and_wake() can
    never clear TIF_SIGPENDING. Instead, it can set this flag and wake up the
    thread without any reason. Harmless, but unneeded and wastes CPU.

    Signed-off-by: Oleg Nesterov
    Acked-by: Roland McGrath
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • It is a bit annoying that do_exit() takes ->pi_lock to set PF_EXITING. All
    we need is to synchronize with lookup_pi_state() which saw this task
    without PF_EXITING under ->pi_lock.

    Change do_exit() to use spin_unlock_wait().

    Signed-off-by: Oleg Nesterov
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • If we discover the TIS TPM device via PNP, use the PNP IRQ information rather
    than probing for an IRQ. If PNP shows no IRQ, run the TPM in polling mode.

    Tested-by:
    Signed-off-by: Bjorn Helgaas
    Cc: Kylene Hall
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bjorn Helgaas
     
  • drivers/char/ip2/ip2main.c | 104398 -> 104346 (-52 bytes)
    drivers/char/ip2/ip2main.o | 210710 -> 210702 (-8 bytes)

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

    Mariusz Kozlowski
     
  • fs/autofs4/inode.c | 10467 -> 10435 (-32 bytes)
    fs/autofs4/inode.o | 98576 -> 98552 (-24 bytes)

    Signed-off-by: Mariusz Kozlowski
    Acked-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mariusz Kozlowski
     
  • Documentation/firmware_class/firmware_sample_firmware_class.c | 5246 -> 5211 (-35 bytes)

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

    Mariusz Kozlowski
     
  • drivers/char/consolemap.c | 22678 -> 22650 (-28 bytes)
    drivers/char/consolemap.o | 90113 -> 90029 (-84 bytes)

    Signed-off-by: Mariusz Kozlowski
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mariusz Kozlowski
     
  • Add two new functions for reading the kernel log buffer. The intention is for
    them to be used by recovery/dump/debug code so the kernel log can be easily
    retrieved/parsed in a crash scenario, but they are generic enough for other
    people to dream up other fun uses.

    [akpm@linux-foundation.org: buncha fixes]
    Signed-off-by: Mike Frysinger
    Cc: Robin Getz
    Cc: Greg Ungerer
    Cc: Russell King
    Cc: Paul Mundt
    Acked-by: Tim Bird
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • This patch makes two needlessly global functions static.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Every file should include the headers containing the prototypes for its global
    functions (in this case ioremap_page_range()).

    Signed-off-by: Adrian Bunk
    Acked-by: Haavard Skinnemoen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • This patch contains the following possible cleanups:
    - make the following needlessly global functions static:
    - rxrpc.c: afs_send_pages()
    - vlocation.c: afs_vlocation_queue_for_updates()
    - write.c: afs_writepages_region()
    - make the following needlessly global variables static:
    - mntpt.c: afs_mntpt_expiry_timeout
    - proc.c: afs_vlocation_states[]
    - server.c: afs_server_timeout
    - vlocation.c: afs_vlocation_timeout
    - vlocation.c: afs_vlocation_update_timeout
    - #if 0 the following unused function:
    - cell.c: afs_get_cell_maybe()
    - #if 0 the following unused variables:
    - callback.c: afs_vnode_update_timeout
    - cmservice.c: struct afs_cm_workqueue

    Signed-off-by: Adrian Bunk
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • This patch contains the following cleanups:
    - make the needlessly global variable rt_trace_on static
    - remove the unused global function deadlock_trace_off()

    Signed-off-by: Adrian Bunk
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • This patch adds the /sys/module//notes/ magic directory, which has a
    file for each allocated SHT_NOTE section that appears in .ko. This
    is the counterpart for each module of /sys/kernel/notes for vmlinux.
    Reading this delivers the contents of the module's SHT_NOTE sections. This
    lets userland easily glean any detailed information about that module's
    build that was stored there at compile time (e.g. by ld --build-id).

    Signed-off-by: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     
  • * Remove stupid comments, like, at the beginning of every function that
    function begins (twice per function) and at the end (once)
    * Remove trailing or otherwise broken whitespace as per let c_space_errors=1
    * Reformat comments to fit it into 80 columns and remove stupid ------------'s.
    * Indent case labels on the same column where switch begins
    * other minor CS tweaks not worth mentioning

    Signed-off-by: Alexey Dobriyan
    Cc: Jiri Slaby
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Fix do_coredump to detect a crash in the user mode helper process and abort
    the attempt to recursively dump core to another copy of the helper process,
    potentially ad-infinitum.

    [akpm@linux-foundation.org: cleanups]
    Signed-off-by: Neil Horman
    Cc:
    Cc:
    Cc: Jeremy Fitzhardinge
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Neil Horman
     
  • A rewrite of my previous post for this enhancement. It uses jeremy's
    split_argv/free_argv library functions to translate core_pattern into an argv
    array to be passed to the user mode helper process. It also adds a
    translation to format_corename such that the origional value of RLIMIT_CORE
    can be passed to userspace as an argument.

    Signed-off-by: Neil Horman
    Cc:
    Cc:
    Cc: Jeremy Fitzhardinge
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Neil Horman