26 Mar, 2006

40 commits

  • Signed-off-by: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     
  • This patch avoids arithmetic on 'signed' types that are slower than
    'unsigned'. This saves space and cpu cycles.

    size of kernel/sys.o before the patch (gcc-3.4.5)

    text data bss dec hex filename
    10924 252 4 11180 2bac kernel/sys.o

    size of kernel/sys.o after the patch
    text data bss dec hex filename
    10903 252 4 11159 2b97 kernel/sys.o

    I noticed that gcc-4.1.0 (from Fedora Core 5) even uses idiv instruction for
    (a+b)/2 if a and b are signed.

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

    Eric Dumazet
     
  • - Moved check for online cpu out of smp_prepare_cpu()

    - Moved default declaration of smp_prepare_cpu() to kernel/cpu.c

    - Removed lock_cpu_hotplug() from smp_prepare_cpu() to around it, since
    its called from cpu_up() as well now.

    - Removed clearing from cpu_present_map during cpu_offline as it breaks
    using cpu_up() directly during a subsequent online operation.

    Signed-off-by: Ashok Raj
    Cc: Srivatsa Vaddagiri
    Cc: "Li, Shaohua"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ashok Raj
     
  • Add info on flow control for serial consoles. Refer to netconsole option
    also.

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

    Randy Dunlap
     
  • There is a bug in direct-io on propagating write error up to the higher I/O
    layer. When performing an async ODIRECT write to a block device, if a
    device error occurred (like media error or disk is pulled), the error code
    is only propagated from device driver to the DIO layer. The error code
    stops at finished_one_bio(). The aysnc write, however, is supposedly have
    a corresponding AIO event with appropriate return code (in this case -EIO).
    Application which waits on the async write event, will hang forever since
    such AIO event is lost forever (if such app did not use the timeout option
    in io_getevents call. Regardless, an AIO event is lost).

    The discovery of above bug leads to another discovery of potential race
    window with dio->result. The fundamental problem is that dio->result is
    overloaded with dual use: an indicator of fall back path for partial dio
    write, and an error indicator used in the I/O completion path. In the
    event of device error, the setting of -EIO to dio->result clashes with
    value used to track partial write that activates the fall back path.

    It was also pointed out that it is impossible to use dio->result to track
    partial write and at the same time to track error returned from device
    driver. Because direct_io_work can only determines whether it is a partial
    write at the end of io submission and in mid stream of those io submission,
    a return code could be coming back from the driver. Thus messing up all
    the subsequent logic.

    Proposed fix is to separating out error code returned by the IO completion
    path from partial IO submit tracking. A new variable is added to dio
    structure specifically to track io error returned in the completion path.

    Signed-off-by: Ken Chen
    Acked-by: Zach Brown
    Acked-by: Suparna Bhattacharya
    Cc: Badari Pulavarty
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chen, Kenneth W
     
  • As Pekka Enberg pointed out, with the if still following the else, you can
    still get a null uid written to the disk if you specify a default uid= without
    uid=forget. In other words, if the desktop user is uid=1000 and the mount
    option uid=1000 is given ( which is done on ubuntu automatically and probably
    other distributions that use hal ), then if any other user besides uid 1000
    owns a file then a 0 will be written to the media as the owning uid instead.

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

    Phillip Susi
     
  • Signed-off-by: Oliver Neukum
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oliver Neukum
     
  • Spotted by the Coverity checker as bug #666

    akpm; there are several other `return 1;'s in there which aren't freeing
    `dev'. (A fix which converts this function to single-exit would be
    preferred..)

    Signed-off-by: Jesper Juhl
    Cc: Adam Belay
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • Fix resource leak and remove pointless cast of kmalloc return value.

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

    Jesper Juhl
     
  • text data bss dec hex filename
    before: 3605597 1363528 363328 5332453 515de5 vmlinux
    after: 3605295 1363612 363200 5332107 515c8b vmlinux

    218 bytes saved.

    Also, optimise any_online_cpu() out of existence on CONFIG_SMP=n.

    This function seems inefficient. Can't we simply AND the two masks, then use
    find_first_bit()?

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

    Andrew Morton
     
  • Shrinks the only caller (net/bridge/netfilter/ebtables.c) by 174 bytes.

    Also, optimise highest_possible_processor_id() out of existence on
    CONFIG_SMP=n.

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

    Andrew Morton
     
  • text data bss dec hex filename
    before: 3488027 1322496 360128 5170651 4ee5db vmlinux
    after: 3485112 1322480 359968 5167560 4ed9c8 vmlinux

    2931 bytes saved

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

    Andrew Morton
     
  • text data bss dec hex filename
    before: 3490577 1322408 360000 5172985 4eeef9 vmlinux
    after: 3488027 1322496 360128 5170651 4ee5db vmlinux

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

    Andrew Morton
     
  • Add rs422 support to the Altix ioc4 serial driver.

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

    Pat Gefre
     
  • dev should be validated before it is being used as index to array.

    Coverity bug #871

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

    Eugene Teo
     
  • Fix a check-after-use spotted by the Coverity checker.

    Signed-off-by: Adrian Bunk
    Cc: Karsten Keil
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Documentation changes to help radix tree users avoid overrunning the tags
    array. RADIX_TREE_TAGS moves to linux/radix-tree.h and is now known as
    RADIX_TREE_MAX_TAGS (Nick Piggin's idea). Tag parameters are changed to
    unsigned, and some comments are updated.

    Signed-off-by: Jonathan Corbet
    Cc: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan Corbet
     
  • Correct some error handling on the compat version of the nfsservctl()
    system. It was detecting errors while copying in the arguments from user
    space, but then attempting to use the arguments anyway. This didn't seem
    so good.

    Signed-off-by: Peter Staubach
    Cc: Trond Myklebust
    Cc: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Staubach
     
  • This patch fixes i2o_dump_hrt output from dmesg:

    iop0: HRT has 1 entries of 16 bytes each.
    Adapter 00000012: TID 0000:[HPC*]:PCI 1: Bus 1 Device 22
    Function 0

    Signed-off-by: Vasily Averin
    Cc: Markus Lidel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasily Averin
     
  • The "rounded up to nearest power of 2 in size" algorithm in
    alloc_large_system_hash is not correct. As coded, it takes an otherwise
    acceptable power-of-2 value and doubles it. For example, we see the error
    if we boot with thash_entries=2097152 which produces a hash table with
    4194304 entries.

    Signed-off-by: John Hawkes
    Cc: Roland Dreier
    Cc: "Chen, Kenneth W"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    John Hawkes
     
  • fls() takes an integer, so roundup_pow_of_two() is busted for ulongs larger
    than 2^32-1.

    Fix this by implementing and using fls_long().

    (Why does roundup_pow_of_two() return a long?)

    (Why is roundup_pow_of_two() __attribute_const__ whereas long_log2() is
    __attribute_pure__?)

    (Why does long_log2() suck so much? Because we were missing fls_long()?)

    Cc: Roland Dreier
    Cc: "Chen, Kenneth W"
    Cc: John Hawkes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • While doing some benchmarks of an Apache/PHP SMP server, I noticed high
    oprofile numbers in in_group_p() and _atomic_dec_and_lock().

    rank percent
    1 4.8911 % __link_path_walk
    2 4.8503 % __d_lookup
    *3 4.2911 % _atomic_dec_and_lock
    4 3.9307 % __copy_to_user_ll
    5 4.9004 % sysenter_past_esp
    *6 3.3248 % in_group_p

    It appears that in_group_p() does an uncessary

    get_group_info(current->group_info); /* atomic_inc() */
    ... /* access current->group_info */
    put_group_info(current->group_info); /* _atomic_dec_and_lock */

    It is not necessary to do this, because the current task holds a reference
    on its own group_info, and this reference cannot change during the lookup.

    This patch deletes the get_group_info()/put_group_info() pair from
    sys_getgroups(), in_group_p() and in_egroup_p() functions.

    Signed-off-by: Eric Dumazet
    Cc: Tim Hockin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     
  • If I mount ext2 "rw", I want it to say "rw", not "rw,nogrpid".

    I caught this writing an automated regression test script for the busybox
    mount command. The symptom is
    /dev/loop0 on /images/ext2.dir type ext2 (rw,nogrpid)
    instead of:
    /dev/loop0 on /images/ext2.dir type ext2 (rw)

    The behavior was introduced by git commit
    8fc2751beb0941966d3a97b26544e8585e428c08.

    Signed-off-by: Rob Landley
    Cc: Mark Bellon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rob Landley
     
  • http://mpeg.openprojects.net/ doesn't exist

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

    Johannes Stezenbach
     
  • As prepare_write, commit_write and readpage are allowed to return
    AOP_TRUNCATE_PAGE, page_symlink should respond to them.

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

    NeilBrown
     
  • Flesh out the description of the address_space operations.

    Signed-off-by: Neil Brown
    Cc: Avishay Traeger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • fs/reiserfs/item_ops.c: In function 'indirect_print_item':
    fs/reiserfs/item_ops.c:278: warning: 'num' may be used uninitialized in this function

    (akpm: this is probably just gcc being dumb)

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

    Benoit Boissinot
     
  • Mailing this address gives.. Sorry your message to max_mk@yahoo.com cannot
    be delivered. This account has been disabled or discontinued [#102].
    mta129.mail.re4.yahoo.com)

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

    Dave Jones
     
  • Nice place isn't it? I've lived in 7 other houses since then.

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

    Jamie Lokier
     
  • The Coverity checker found this memory leak.

    Signed-off-by: Adrian Bunk
    Acked-by: Corey Minyard
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • We dereference bitmap both one line above and one line below this check
    rendering this check quite useless.

    Spotted by the Coverity checker.

    Signed-off-by: Adrian Bunk
    Cc: Alasdair G Kergon
    Cc: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • The Coverity checker wasn't happy seeing a size_t compared with -ENODATA
    and -ENOSYS.

    Since the only place where size is set is through the result of
    reiserfs_xattr_get() which is an int, we could simply make size an int.

    Signed-off-by: Adrian Bunk
    Cc: Jeff Mahoney
    Cc: Chris Mason
    Cc: Hans Reiser
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Initramfs initrd images do not need a ramdisk device, so remove this
    restriction in Kconfig. BLK_DEV_RAM=n saves about 13k on i386. Also
    without ramdisk device there's no need for "dry run", so initramfs unpacks
    much faster.

    People using cramfs, squashfs, or gzipped ext2/minix initrd images are
    probably smart enough not to turn off ramdisk support by accident.

    Cc: Al Viro
    Cc: Christoph Hellwig
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zdenek Pavlas
     
  • A couple of places are forgetting to take it.

    The kswapd case is probably unimportant. keventd_create_kthread() was racy.

    The whole thing is a bit flakey: you start a kernel thread, get its pid from
    kernel_thread() then look up its task_struct.

    a) It assumes that pid recycling takes a "long" time.

    b) We get a task_struct but no reference was taken on it. The owner of the
    kswapd and kthread task_struct*'s must assume that the new thread won't
    exit unexpectedly. Because if it does, they're left holding dead memory
    and any attempt to control or stop that task will crash.

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

    Andrew Morton
     
  • When EXT3FS_DEBUG is #define-d, the compile breaks due to #include file
    issues.

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

    Kirk True
     
  • This fixes coverity bugs #398 and #397

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

    Jesper Juhl
     
  • This patch reduces scheduling latency in shrink_dcache_sb() noticed during
    remounting of big partitions with many cached dentries. The same latency
    fix was applied to select_parent() long ago.

    Signed-off-by: Denis Lunev
    Signed-off-by: Pavel Emelianov
    Signed-off-by: Kirill Korotaev
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill Korotaev
     
  • In here, I think the following order is more cache-friendly.

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

    OGAWA Hirofumi
     
  • freeze_bdev() uses a fsync_super() without sync_blockdev(). This patch
    makes __fsync_super() and shares it.

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

    OGAWA Hirofumi
     
  • Believe it or not, but in fs/minix/*, the oldest filesystem in the kernel,
    something still can be fixed:

    printk("new_inode: bit already set");

    "\n" is missing!

    While at it, I also removed periods from the end of error messages and made
    capitalization uniform. Also s/i-node/inode/, s/printk (/printk(/

    Signed-ff-by: Denis Vlasenko

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

    Denis Vlasenko