12 Oct, 2006

40 commits

  • Signed-off-by: Jeff Garzik
    Acked-by: Matt Domsch
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     
  • Signed-off-by: Jeff Garzik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     
  • Signed-off-by: Jeff Garzik
    Acked-by: Corey Minyard
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     
  • Signed-off-by: Jeff Garzik
    Cc: Matt Domsch
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     
  • The attached patch destroys all the dentries attached to a superblock in one go
    by:

    (1) Destroying the tree rooted at s_root.

    (2) Destroying every entry in the anon list, one at a time.

    (3) Each entry in the anon list has its subtree consumed from the leaves
    inwards.

    This reduces the amount of work generic_shutdown_super() does, and avoids
    iterating through the dentry_unused list.

    Note that locking is almost entirely absent in the shrink_dcache_for_umount*()
    functions added by this patch. This is because:

    (1) at the point the filesystem calls generic_shutdown_super(), it is not
    permitted to further touch the superblock's set of dentries, and nor may
    it remove aliases from inodes;

    (2) the dcache memory shrinker now skips dentries that are being unmounted;
    and

    (3) the superblock no longer has any external references through which the VFS
    can reach it.

    Given these points, the only locking we need to do is when we remove dentries
    from the unused list and the name hashes, which we do a directory's worth at a
    time.

    We also don't need to guard against reference counts going to zero unexpectedly
    and removing bits of the tree we're working on as nothing else can call dput().

    A cut down version of dentry_iput() has been folded into
    shrink_dcache_for_umount_subtree() function. Apart from not needing to unlock
    things, it also doesn't need to check for inotify watches.

    In this version of the patch, the complaint about a dentry still being in use
    has been expanded from a single BUG_ON() and now gives much more information.

    Signed-off-by: David Howells
    Acked-by: NeilBrown
    Acked-by: Ian Kent
    Cc: Trond Myklebust
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Make sure all dentries refs are released before calling kill_anon_super() so
    that the assumption that generic_shutdown_super() can completely destroy the
    dentry tree for there will be no external references holds true.

    What was being done in the put_super() superblock op, is now done in the
    kill_sb() filesystem op instead, prior to calling kill_anon_super().

    This makes the struct autofs_sb_info::root member variable redundant (since
    sb->s_root is still available), and so that is removed. The calls to
    shrink_dcache_sb() are also removed since they're also redundant as
    shrink_dcache_for_umount() will now be called after the cleanup routine.

    Signed-off-by: David Howells
    Acked-by: Ian Kent
    Cc: Trond Myklebust
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Make sure all dentries refs are released before calling kill_block_super()
    so that the assumption that generic_shutdown_super() can completely destroy
    the dentry tree for there will be no external references holds true.

    What was being done in the put_super() superblock op, is now done in the
    kill_sb() filesystem op instead, prior to calling kill_block_super().

    Changes made in [try #2]:

    (*) reiserfs_kill_sb() now checks that the superblock FS info pointer is set
    before trying to dereference it.

    Signed-off-by: David Howells
    Cc: "Rafael J. Wysocki"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • drivers/firmware/dell_rbu.c: In function 'packetize_data':
    drivers/firmware/dell_rbu.c:252: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'int'

    Cc: Matt Domsch
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • - In parameter descriptions, strip all whitespace between the parameter
    name (e.g., @len) and its description so that the description is
    indented uniformly in text and man page modes. Previously, spaces
    or tabs (which are used for cleaner source code viewing) affected
    the produced output in a negative way.

    Before (man mode):
    to Destination address, in user space.
    from Source address, in kernel space.
    n Number of bytes to copy.

    After (man mode):
    to Destination address, in user space.
    from Source address, in kernel space.
    n Number of bytes to copy.

    - Fix/clarify a few function description comments.

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

    Randy Dunlap
     
  • The nbd header uses __be32 and such types but doesn't actually include the
    header that defines these things (linux/types.h); so let's include it.

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

    Mike Frysinger
     
  • Drop __inline, __always_inline, and noinline in the produced kernel-doc
    output, similar to other pseudo directives.

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

    Randy Dunlap
     
  • Place kernel-doc function comment header immediately before the function that
    is being documented.

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

    Randy Dunlap
     
  • Fix kernel-doc function name in usercopy.c.

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

    Randy Dunlap
     
  • Bug reported and fixed by Tilman Schmidt : if lockdep is
    enabled then log messages make it to /var/log/messages belatedly. The
    reason is a missed wakeup of klogd.

    Initially there was only a lockdep_internal() protection against lockdep
    recursion within vprintk() - it grew the 'outer' lockdep_off()/on()
    protection only later on. But that lockdep_off() made the
    release_console_sem() within vprintk() always happen under the
    lockdep_internal() condition, causing the bug.

    The right solution to remove the inner protection against recursion here -
    the outer one is enough.

    Signed-off-by: Ingo Molnar
    Cc: Tilman Schmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • I was looking at lockdep-desing.txt and i guess i am confused with the
    changes with respect to fd7bcea35e7efb108c34ee2b3840942a3749cadb. It
    says

    + '.' acquired while irqs enabled
    + '+' acquired in irq context
    + '-' acquired in process context with irqs disabled
    + '?' read-acquired both with irqs enabled and in irq context
    +

    But the get_usage_chars() function does this for '-'
    if (class->usage_mask & LOCKF_ENABLED_HARDIRQS)
    *c1 = '-';

    So i guess what would be correct would be
    '.' acquired while irqs disabled
    '+' acquired in irq context
    '-' acquired with irqs enabled
    '?' read acquired in irq context with irqs enabled.

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

    Aneesh Kumar
     
  • Signed-off-by: Alexey Dobriyan
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Signed-off-by: Alexey Dobriyan
    Cc: David Woodhouse
    Cc: David Howells
    Cc: Mark Fasheh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • CONFIG_PCI=n, CONFIG_HT_IRQ=y results in the following compile error:

    ...
    LD vmlinux
    arch/i386/mach-generic/built-in.o: In function `apicid_to_node':
    summit.c:(.text+0x53): undefined reference to `apicid_2_node'
    arch/i386/kernel/built-in.o: In function `arch_setup_ht_irq':
    (.text+0xcf79): undefined reference to `write_ht_irq_low'
    arch/i386/kernel/built-in.o: In function `arch_setup_ht_irq':
    (.text+0xcf85): undefined reference to `write_ht_irq_high'
    arch/i386/kernel/built-in.o: In function `k7nops':
    alternative.c:(.data+0x1358): undefined reference to `mask_ht_irq'
    alternative.c:(.data+0x1360): undefined reference to `unmask_ht_irq'
    make[1]: *** [vmlinux] Error 1

    Bug report by Jesper Juhl.

    Signed-off-by: Adrian Bunk
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

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

    Aneesh Kumar
     
  • There's nothing arch-specific about check_signature(), so move it to
    . Use a cross between the Alpha and i386 implementations as
    the generic one.

    Signed-off-by: Matthew Wilcox
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthew Wilcox
     
  • In preparation for moving check_signature, change these users from asm/io.h
    to linux/io.h

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

    Matthew Wilcox
     
  • A couple of flush_dcache_page()s are missing on the I/O-error paths.

    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Monakhov Dmitriy
     
  • Aince all callers dereference sb, and this function does so earlier too, we
    dont need the check.

    Signed-off-by: Eric Sesterhenn
    Acked-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sesterhenn
     
  • If try_to_release_page() is called with a zero gfp mask, then the
    filesystem is effectively denied the possibility of sleeping while
    attempting to release the page. There doesn't appear to be any valid
    reason why this should be banned, given that we're not calling this from a
    memory allocation context.

    For this reason, change the gfp_mask argument of the call to GFP_KERNEL.

    Signed-off-by: Trond Myklebust
    Cc: Steve Dickson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Trond Myklebust
     
  • The pipe-a-coredump-to-a-program feature was undocumented.
    *Grumble*.

    NB: a good enhancement to that patch would be: save all the stuff that a
    core file can get from the %x expansions in the environment.

    Signed-off-by: Matthias Urlichs
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthias Urlichs
     
  • lib/bitmap.c:bitmap_parse() is a library function that received as input a
    user buffer. This seemed to have originated from the way the write_proc
    function of the /proc filesystem operates.

    This has been reworked to not use kmalloc and eliminates a lot of
    get_user() overhead by performing one access_ok before using __get_user().

    We need to test if we are in kernel or user space (is_user) and access the
    buffer differently. We cannot use __get_user() to access kernel addresses
    in all cases, for example in architectures with separate address space for
    kernel and user.

    This function will be useful for other uses as well; for example, taking
    input for /sysfs instead of /proc, so it was changed to accept kernel
    buffers. We have this use for the Linux UWB project, as part as the
    upcoming bandwidth allocator code.

    Only a few routines used this function and they were changed too.

    Signed-off-by: Reinette Chatre
    Signed-off-by: Inaky Perez-Gonzalez
    Cc: Paul Jackson
    Cc: Joe Korty
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Reinette Chatre
     
  • A couple of HDIO IOCTLs are not yet handled and a few others are marked
    as using a pointer rather than an unsigned long. The formers include:

    HDIO_GET_WCACHE, HDIO_GET_ACOUSTIC, HDIO_GET_ADDRESS and
    HDIO_GET_BUSSTATE. The latters are: HDIO_SET_MULTCOUNT,
    HDIO_SET_UNMASKINTR, HDIO_SET_KEEPSETTINGS, HDIO_SET_32BIT,
    HDIO_SET_NOWERR, HDIO_SET_DMA, HDIO_SET_PIO_MODE and HDIO_SET_NICE.

    Additionally 0x330 used to be HDIO_GETGEO_BIG and may be issued by 32-bit
    `hdparm' run on a 64-bit kernel making Linux complain loudly.

    This is a fix for these issues.

    Signed-off-by: Maciej W. Rozycki
    Cc: Alan Cox
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Maciej W. Rozycki
     
  • Signed-off-by: Jeff Garzik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     
  • A failure in invalidate_inode_pages2_range() can result in unpleasant things
    happening in NFS (at least). Stick a WARN_ON_ONCE() in there so we can find
    out if it happens, and maybe why.

    (akpm: might be a -mm-only patch, we'll see..)

    Cc: Chuck Lever
    Cc: Trond Myklebust
    Cc: Steve Dickson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • This likely profiling is pretty fun. I found a few possible problems
    in sched.c.

    This patch may be not measurable, but when I did measure long ago,
    nooping (un)likely cost a couple of % on scheduler heavy benchmarks, so
    it all adds up.

    Tweak some branch hints:

    - the 2nd 64 bits in the bitmask is likely to be populated, because it
    contains the first 28 bits (nearly 3/4) of the normal priorities.
    (ratio of 669669:691 ~= 1000:1).

    - it isn't unlikely that context switching switches to another process. it
    might be very rapidly switching to and from the idle process (ratio of
    475815:419004 and 471330:423544). Let the branch predictor decide.

    - preempt_enable seems to be very often called in a nested preempt_disable
    or with interrupts disabled (ratio of 3567760:87965 ~= 40:1)

    Signed-off-by: Nick Piggin
    Acked-by: Ingo Molnar
    Cc: Daniel Walker
    Cc: Hua Zhong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • - handle sysfs error
    - handle driver model errors
    - de-obfuscate platform_device_register_simple() call, which included an
    assignment in between two function calls, in the same C statement.

    Signed-off-by: Jeff Garzik
    Acked-by: Kylene Hall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     
  • Current error behaviour for ext2 and ext3 filesystems does not fully
    correspond to the documentation and should be fixed.

    According to man 8 mount, ext2 and ext3 file systems allow to set one of 3
    different on-errors behaviours:

    ---- start of quote man 8 mount ----

    errors=continue / errors=remount-ro / errors=panic

    Define the behaviour when an error is encountered. (Either ignore
    errors and just mark the file system erroneous and continue, or remount
    the file system read-only, or panic and halt the system.) The default is
    set in the filesystem superblock, and can be changed using tune2fs(8).

    ---- end of quote ----

    However EXT3_ERRORS_CONTINUE is not read from the superblock, and thus
    ERRORS_CONT is not saved on the sbi->s_mount_opt. It leads to the incorrect
    handle of errors on ext3.

    Then we've checked corresponding code in ext2 and discovered that it is buggy
    as well:

    - EXT2_ERRORS_CONTINUE is not read from the superblock (the same);

    - parse_option() does not clean the alternative values and thus something
    like (ERRORS_CONT|ERRORS_RO) can be set;

    - if options are omitted, parse_option() does not set any of these options.

    Therefore it is possible to set any combination of these options on the ext2:

    - none of them may be set: EXT2_ERRORS_CONTINUE on superblock / empty mount
    options;

    - any of them may be set using mount options;

    - 2 any options may be set: by using EXT2_ERRORS_RO/EXT2_ERRORS_PANIC on the
    superblock and other value in mount options;

    - and finally all three options may be set by adding third option in remount.

    Currently ext2 uses these values only in ext2_error() and it is not leading to
    any noticeable troubles. However somebody may be discouraged when he will try
    to workaround EXT2_ERRORS_PANIC on the superblock by using errors=continue in
    mount options.

    This patch:

    EXT2_ERRORS_CONTINUE should be read from the superblock as default value for
    error behaviour. parse_option() should clean the alternative options and
    should not change default value taken from the superblock.

    Signed-off-by: Vasily Averin
    Acked-by: Kirill Korotaev
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasily Averin
     
  • Current error behaviour for ext2 and ext3 filesystems does not fully
    correspond to the documentation and should be fixed.

    According to man 8 mount, ext2 and ext3 file systems allow to set one of 3
    different on-errors behaviours:

    ---- start of quote man 8 mount ----

    errors=continue / errors=remount-ro / errors=panic

    Define the behaviour when an error is encountered. (Either ignore
    errors and just mark the file system erroneous and continue, or remount
    the file system read-only, or panic and halt the system.) The default is
    set in the filesystem superblock, and can be changed using tune2fs(8).

    ---- end of quote ----

    However EXT3_ERRORS_CONTINUE is not read from the superblock, and thus
    ERRORS_CONT is not saved on the sbi->s_mount_opt. It leads to the incorrect
    handle of errors on ext3.

    Then we've checked corresponding code in ext2 and discovered that it is buggy
    as well:

    - EXT2_ERRORS_CONTINUE is not read from the superblock (the same);

    - parse_option() does not clean the alternative values and thus something
    like (ERRORS_CONT|ERRORS_RO) can be set;

    - if options are omitted, parse_option() does not set any of these options.

    Therefore it is possible to set any combination of these options on the ext2:

    - none of them may be set: EXT2_ERRORS_CONTINUE on superblock / empty mount
    options;

    - any of them may be set using mount options;

    - 2 any options may be set: by using EXT2_ERRORS_RO/EXT2_ERRORS_PANIC on the
    superblock and other value in mount options;

    - and finally all three options may be set by adding third option in remount.

    Currently ext2 uses these values only in ext2_error() and it is not leading to
    any noticeable troubles. However somebody may be discouraged when he will try
    to workaround EXT2_ERRORS_PANIC on the superblock by using errors=continue in
    mount options.

    This patch:

    EXT3_ERRORS_CONTINUE should be taken from the superblock as default value for
    error behaviour.

    Signed-off-by: Dmitry Mishin
    Acked-by: Vasily Averin
    Acked-by: Kirill Korotaev
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitry Mishin
     
  • Module taint flags listing in Oops/panic has a couple of issues:

    * taint_flags() doesn't null-terminate the buffer after printing the flags

    * per-module taints are only set if the kernel is not already tainted
    (with that particular flag) => only the first offending module gets its
    taint info correctly updated

    Some additional changes:

    * 'license_gplok' is no longer needed - equivalent to !(taints &
    TAINT_PROPRIETARY_MODULE) - so we can drop it from struct module *
    exporting module taint info via /proc/module:

    pwc 88576 0 - Live 0xf8c32000
    evilmod 6784 1 pwc, Live 0xf8bbf000 (PF)

    Signed-off-by: Florin Malita
    Cc: "Randy.Dunlap"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Florin Malita
     
  • Some people find their Jmicron pata port reports its disabled even
    though it has devices on it and was boot probed. Fix this

    (Candidate for 2.6.18.*, less so for 2.6.19 as we've got a proper
    jmicron driver on the merge for that to replace ide-generic support)

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

    Alan Cox
     
  • If grow_buffers() is for some reason passed a block number which wants to lie
    outside the maximum-addressable pagecache range (PAGE_SIZE * 4G bytes) then it
    will accidentally truncate `index' and will then instnatiate a page at the
    wrong pagecache offset. This causes __getblk_slow() to go into an infinite
    loop.

    This can happen with corrupted disks, or with software errors elsewhere.

    Detect that, and handle it.

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

    Andrew Morton
     
  • This is a follow-up patch based on the review for perfmon2. This patch
    adds the carta_random32() library routine + carta_random32.h header file.

    This is fast, simple, and efficient pseudo number generator algorithm. We
    use it in perfmon2 to randomize the sampling periods. In this context, we
    do not need any fancy randomizer.

    Signed-off-by: stephane eranian
    Cc: David Mosberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephane Eranian
     
  • Implement the epoll_pwait system call, that extend the event wait mechanism
    with the same logic ppoll and pselect do. The definition of epoll_pwait
    is:

    int epoll_pwait(int epfd, struct epoll_event *events, int maxevents,
    int timeout, const sigset_t *sigmask, size_t sigsetsize);

    The difference between the vanilla epoll_wait and epoll_pwait is that the
    latter allows the caller to specify a signal mask to be set while waiting
    for events. Hence epoll_pwait will wait until either one monitored event,
    or an unmasked signal happen. If sigmask is NULL, the epoll_pwait system
    call will act exactly like epoll_wait. For the POSIX definition of
    pselect, information is available here:

    http://www.opengroup.org/onlinepubs/009695399/functions/select.html

    Signed-off-by: Davide Libenzi
    Cc: David Woodhouse
    Cc: Andi Kleen
    Cc: Michael Kerrisk
    Cc: Ulrich Drepper
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davide Libenzi
     
  • In order to encourage people to notice when they break the exported
    headers, add a config option which automatically runs the sanity checks
    when building vmlinux. That way, those who use allyesconfig will notice
    failures.

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

    David Woodhouse