09 May, 2007

35 commits

  • Whitespace cleanup only: convert some series of spaces to tabs.

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

    Randy Dunlap
     
  • sb_read may return NULL, let's explicitly check it. If so free new bitmap
    blocks array, after this we may safely exit as it done above during bitmap
    allocation.

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

    Dmitriy Monakhov
     
  • sb_read may return NULL, so let's explicitly check it.

    Signed-off-by: Dmitriy Monakhov
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitriy Monakhov
     
  • Replace (n & (n-1)) in the context of power of 2 checks with is_power_of_2

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

    Vignesh Babu BM
     
  • Replace (n & (n-1)) in the context of power of 2 checks with is_power_of_2

    Signed-off-by: vignesh babu
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vignesh Babu BM
     
  • Replacing (n & (n-1)) in the context of power of 2 checks with
    is_power_of_2

    Signed-off-by: vignesh babu
    Acked-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vignesh Babu BM
     
  • - make needlessly global code static
    - remove the unused EXPORT_SYMBOL's

    Signed-off-by: Adrian Bunk
    Acked-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • The tty driver write method is different to the usual fops device write
    methods as the buffer is already in kernel space. Clarify the docs since
    someone writing a driver made that mistake.

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

    Alan
     
  • Currently, devpts doesn't generate an fsnotify event upon pts creation
    because the regular vfs paths aren't involved. Deallocation, on the other
    hand, correctly generates a nameremove event thanks to the d_delete()
    invocation in devpts_pty_kill().

    This patch adds the missing fsnotify_create() trigger in devpts_pty_new().

    Signed-off-by: Florin Malita
    Acked-by: H. Peter Anvin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Florin Malita
     
  • Add SEEK_MAX and use it to validate lseek arguments from userspace.

    Signed-off-by: Chris Snook
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Snook
     
  • Convert magic numbers to SEEK_* values from fs.h

    Signed-off-by: Chris Snook
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Snook
     
  • Add a paragraph in Documentation/SubmittingDrivers requesting that the
    basic PM support be provided by new device drivers.

    Add two new documents in Documentation/power/ giving general instructions
    on debugging the suspend/resume functionality and testing the suspend and
    resume support in device drivers.

    Signed-off-by: Rafael J. Wysocki
    Cc: Pavel Machek
    Cc: David Brownell
    Cc: Nigel Cunningham
    Cc: Alan Cox
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • Constant folding does not work for the swabXX() byte swapping functions,
    and the C versions optimize poorly.

    Attempting to initialize a global variable to swab16(0x1234) or put
    something like "case swab32(42):" in a switch statement will not compile.
    It can work, swab.h just isn't doing it correctly. This patch fixes that.

    Contrary to the comment in asm-i386/byteorder.h, gcc does not recognize the
    "C" version of swab16 and turn it into efficient code. gcc can do this,
    just not with the current code. The simple function:

    u16 foo(u16 x) { return swab16(x); }

    Would compile to:
    movzwl %ax, %eax
    movl %eax, %edx
    shrl $8, %eax
    sall $8, %edx
    orl %eax, %edx

    With this patch, it will compile to:
    rolw $8, %ax

    I also attempted to document the maze different macros/inline functions
    that are used to create the final product.

    Signed-off-by: Trent Piepho
    Cc: Francois-Rene Rideau
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Trent Piepho
     
  • Don't use hardcoded 99 value, use MAX_RT_PRIO.

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

    Oleg Nesterov
     
  • Except for BUG_ON() checks, we should not use EXIT_XXXX defines outside of
    exit/wait paths.

    Signed-off-by: Oleg Nesterov
    Cc: "Rafael J. Wysocki"
    Cc: Pavel Machek
    Cc: Ingo Molnar
    Cc: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Add pci_remove handling to the driver, so it will clean up if
    the device is hot-removed.

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

    Corey Minyard
     
  • Convert over to the new NMI handling for getting IPMI watchdog timeouts via an
    NMI. This add config options to know if there is the ability to receive NMIs
    and if it has an NMI post processing call. Then it modifies the IPMI watchdog
    to take advantage of this so that it can know if an NMI comes in.

    It also adds testing that the IPMI NMI watchdog works.

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

    Corey Minyard
     
  • The IPMI driver used enable_irq and disable_irq when it got into situations
    where it couldn't allocate memory; it did this to avoid having the interrupt
    just lock the machine when it couldn't get memory to perform the transaction
    to disable the interrupt.

    This patch modifies the driver to not use disable_irq and enable_irq. It
    instead sends the messages to the BMC to perform this operation. It also
    makes sure interrupts are cleanly disabled when the interface is shut down and
    cleans up some shutdown things that are no longer necessary.

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

    Corey Minyard
     
  • Add support for of_platform_driver to the ipmi_si module. When loading the
    module, the driver will be registered to of_platform. The driver will be
    probed for all devices with the type ipmi. It's supporting devices with
    compatible settings ipmi-kcs, ipmi-smic and ipmi-bt. Only ipmi-kcs could be
    tested.

    Signed-off-by: Christian Krafft
    Acked-by: Heiko J Schick
    Signed-off-by: Corey Minyard
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Corey Minyard
     
  • Teach the dentry slab shrinker to aggressively shrink parent dentries when
    shrinking the dentry cache.

    This is done to attempt to improve the situation where the dentry slab cache
    gets a lot of internal fragmentation due to pages containing directory
    dentries. It is expected that this change will cause some of those dentries
    to be reaped earlier, and with less scanning.

    Needs careful testing.

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

    Andrew Morton
     
  • The time shrink_dcache_parent() takes, grows quadratically with the depth
    of the tree under 'parent'. This starts to get noticable at about 10,000.

    These kinds of depths don't occur normally, and filesystems which invoke
    shrink_dcache_parent() via d_invalidate() seem to have other depth
    dependent timings, so it's not even easy to expose this problem.

    However with FUSE it's easy to create a deep tree and d_invalidate()
    will also get called. This can make a syscall hang for a very long
    time.

    This is the original discovery of the problem by Russ Cox:

    http://article.gmane.org/gmane.comp.file-systems.fuse.devel/3826

    The following patch fixes the quadratic behavior, by optionally allowing
    prune_dcache() to prune ancestors of a dentry in one go, instead of doing
    it one at a time.

    Common code in dput() and prune_one_dentry() is extracted into a new helper
    function d_kill().

    shrink_dcache_parent() as well as shrink_dcache_sb() are converted to use
    the ancestry-pruner option. Only for shrink_dcache_memory() is this
    behavior not desirable, so it keeps using the old algorithm.

    Signed-off-by: Miklos Szeredi
    Cc: Al Viro
    Cc: Maneesh Soni
    Acked-by: "Paul E. McKenney"
    Cc: Dipankar Sarma
    Cc: Neil Brown
    Cc: Trond Myklebust
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • This past week I was playing around with that pahole tool
    (http://oops.ghostprotocols.net:81/acme/dwarves/) and looking at the size
    of various struct in the kernel. I was surprised by the size of the
    task_struct on x86_64, approaching 4K. I looked through the fields in
    task_struct and found that a number of them were declared as "unsigned
    long" rather than "unsigned int" despite them appearing okay as 32-bit
    sized fields. On x86_64 "unsigned long" ends up being 8 bytes in size and
    forces 8 byte alignment. Is there a reason there a reason they are
    "unsigned long"?

    The patch below drops the size of the struct from 3808 bytes (60 64-byte
    cachelines) to 3760 bytes (59 64-byte cachelines). A couple other fields
    in the task struct take a signficant amount of space:

    struct thread_struct thread; 688
    struct held_lock held_locks[30]; 1680

    CONFIG_LOCKDEP is turned on in the .config

    [akpm@linux-foundation.org: fix printk warnings]
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    William Cohen
     
  • Taken from http://bugzilla.kernel.org/show_bug.cgi?id=5079

    signed long ranges from -2.147.483.648 to 2.147.483.647 on x86 32bit

    10000011110110100100111110111101 .. -2,082,844,739
    10000011110110100100111110111101 .. 2,212,122,557
    Cc:

    Andreas says:

    This patch is now treating timestamps with the high bit set as negative
    times (before Jan 1, 1970). This means we lose 1/2 of the possible range
    of timestamps (lopping off 68 years before unix timestamp overflow -
    now only 30 years away :-) to handle the extremely rare case of setting
    timestamps into the distant past.

    If we are only interested in fixing the underflow case, we could just
    limit the values to 0 instead of storing negative values. At worst this
    will skew the timestamp by a few hours for timezones in the far east
    (files would still show Jan 1, 1970 in "ls -l" output).

    That said, it seems 32-bit systems (mine at least) allow files to be set
    into the past (01/01/1907 works fine) so it seems this patch is bringing
    the x86_64 behaviour into sync with other kernels.

    On the plus side, we have a patch that is ready to add nanosecond timestamps
    to ext3 and as an added bonus adds 2 high bits to the on-disk timestamp so
    this extends the maximum date to 2242.

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

    Markus Rechberger
     
  • /proc/$PID/fd has r-x------ permissions, so if process does setuid(), it
    will not be able to access /proc/*/fd/. This breaks fstatat() emulation
    in glibc.

    open("foo", O_RDONLY|O_DIRECTORY) = 4
    setuid32(65534) = 0
    stat64("/proc/self/fd/4/bar", 0xbfafb298) = -1 EACCES (Permission denied)

    Signed-off-by: Alexey Dobriyan
    Cc: "Eric W. Biederman"
    Cc: James Morris
    Cc: Chris Wright
    Cc: Ulrich Drepper
    Cc: Oleg Nesterov
    Acked-By: Kirill Korotaev
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Simplify the stacktrace code:

    - remove the unused task argument to save_stack_trace, it's always
    current
    - remove the all_contexts flag, it's alwasy 0

    Signed-off-by: Christoph Hellwig
    Cc: Paul Mundt
    Cc: Ralf Baechle
    Cc: Martin Schwidefsky
    Cc: "David S. Miller"
    Cc: Andi Kleen
    Cc: Akinobu Mita
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • block_write_full_page() forgot to propagate ENPSOC into the address_space.

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

    Andrew Morton
     
  • Cleanup: setting an outstanding error on a mapping was open coded too many
    times. Factor it out in mapping_set_error().

    Signed-off-by: Guillaume Chazarain
    Cc: Steven Whitehouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Guillaume Chazarain
     
  • The ever-vigilant users of linode.com noticed that an idle 2.6 UML has a
    persistent load average of ~.4.

    It turns out that because the UML timer handler processed softirqs before
    actually delivering the tick, the tick was counted in the context of the idle
    thread about half the time.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • hostfs needed some style goodness.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This patch allows hostfs_setattr() to work on unlinked open files by calling
    set_attr() (the userspace part) with the inode's fd.

    Without this, applications that depend on doing attribute changes to unlinked
    open files will fail.

    It works by using the fd versions instead of the path ones (for example
    fchmod() instead of chmod(), fchown() instead of chown()) when an fd is
    available.

    Signed-off-by: Alberto Bertogli
    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alberto Bertogli
     
  • Use SLAB_PANIC and delete duplicated panic().

    Signed-off-by: Akinobu Mita
    Cc: Ian Molton
    Cc: David Howells
    Cc: Andi Kleen
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mundt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patch is add white list into modpost.c for some functions and
    ia64's section to fix section mismatchs.

    sparse_index_alloc() and zone_wait_table_init() calls bootmem allocator
    at boot time, and kmalloc/vmalloc at hotplug time. If config
    memory hotplug is on, there are references of bootmem allocater(init text)
    from them (normal text). This is cause of section mismatch.

    Bootmem is called by many functions and it must be
    used only at boot time. I think __init of them should keep for
    section mismatch check. So, I would like to register sparse_index_alloc()
    and zone_wait_table_init() into white list.

    In addition, ia64's .machvec section is function table of some platform
    dependent code. It is mixture of .init.text and normal text. These
    reference of __init functions are valid too.

    Signed-off-by: Yasunori Goto
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yasunori Goto
     
  • This is to fix many section mismatches of code related to memory hotplug.
    I checked compile with memory hotplug on/off on ia64 and x86-64 box.

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

    Yasunori Goto
     
  • [akpm@linux-foundation.org: cleanup]
    Signed-off-by: Monakhov Dmitriy
    Cc: Christoph Hellwig
    Acked-by: Anton Altaparmakov
    Acked-by: David Chinner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitriy Monakhov
     
  • There are two problems with the existing redzone implementation.

    Firstly, it's causing misalignment of structures which contain a 64-bit
    integer, such as netfilter's 'struct ipt_entry' -- causing netfilter
    modules to fail to load because of the misalignment. (In particular, the
    first check in
    net/ipv4/netfilter/ip_tables.c::check_entry_size_and_hooks())

    On ppc32 and sparc32, amongst others, __alignof__(uint64_t) == 8.

    With slab debugging, we use 32-bit redzones. And allocated slab objects
    aren't sufficiently aligned to hold a structure containing a uint64_t.

    By _just_ setting ARCH_KMALLOC_MINALIGN to __alignof__(u64) we'd disable
    redzone checks on those architectures. By using 64-bit redzones we avoid that
    loss of debugging, and also fix the other problem while we're at it.

    When investigating this, I noticed that on 64-bit platforms we're using a
    32-bit value of RED_ACTIVE/RED_INACTIVE in the 64-bit memory location set
    aside for the redzone. Which means that the four bytes immediately before
    or after the allocated object at 0x00,0x00,0x00,0x00 for LE and BE
    machines, respectively. Which is probably not the most useful choice of
    poison value.

    One way to fix both of those at once is just to switch to 64-bit
    redzones in all cases.

    Signed-off-by: David Woodhouse
    Acked-by: Pekka Enberg
    Cc: Christoph Lameter
    Acked-by: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Woodhouse
     

08 May, 2007

5 commits