07 Nov, 2008

40 commits

  • FAT has the ATTR_RO (read-only) attribute. But on Windows, the ATTR_RO
    of the directory will be just ignored actually, and is used by only
    applications as flag. E.g. it's setted for the customized folder by
    Explorer.

    http://msdn2.microsoft.com/en-us/library/aa969337.aspx

    This adds "rodir" option. If user specified it, ATTR_RO is used as
    read-only flag even if it's the directory. Otherwise, inode->i_mode
    is not used to hold ATTR_RO (i.e. fat_mode_can_save_ro() returns 0).

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

    OGAWA Hirofumi
     
  • If inode->i_mode doesn't have S_WUGO, current code assumes it means
    ATTR_RO. However, if (~[ufd]mask & S_WUGO) == 0, inode->i_mode can't
    hold S_WUGO. Therefore the updated directory entry will always have
    ATTR_RO.

    This adds fat_mode_can_hold_ro() to check it. And if inode->i_mode
    can't hold, uses -i_attrs to hold ATTR_RO instead.

    With this, we don't set ATTR_RO unless users change it via ioctl() if
    (~[ufd]mask & S_WUGO) == 0.

    And on FAT_IOCTL_GET_ATTRIBUTES path, this adds ->i_mutex to it for
    not returning the partially updated attributes by FAT_IOCTL_SET_ATTRIBUTES
    to userland.

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

    OGAWA Hirofumi
     
  • This adds three helpers:

    fat_make_attrs() - makes FAT attributes from inode.
    fat_make_mode() - makes mode_t from FAT attributes.
    fat_save_attrs() - saves FAT attributes to inode.

    Then this replaces: MSDOS_MKMODE() by fat_make_mode(), fat_attr() by
    fat_make_attrs(), ->i_attrs = attr & ATTR_UNUSED by fat_save_attrs().
    And for root inode, those is used with ATTR_DIR instead of bogus
    ATTR_NONE.

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

    OGAWA Hirofumi
     
  • Use same style with vfat_lookup().

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

    OGAWA Hirofumi
     
  • d_invalidate() for positive dentry doesn't work in some cases
    (vfsmount, nfsd, and maybe others). shrink_dcache_parent() by
    d_invalidate() is pointless for vfat usage at all.

    So, this kills it, and intead of it uses d_move().

    To save old behavior, this returns alias simply for directory (don't
    change pwd, etc..). the directory lookup shouldn't be important for
    performance.

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

    OGAWA Hirofumi
     
  • - Add comments for handling dcache of vfat.

    - Separate case-sensitive case and case-insensitive to
    vfat_revalidate() and vfat_ci_revalidate().

    vfat_revalidate() doesn't need to drop case-insensitive negative
    dentry on creation path.

    - Current code is missing to set ->d_revalidate to the negative dentry
    created by unlink/etc..

    This sets ->d_revalidate always, and returns 1 for positive
    dentry. Now, we don't need to change ->d_op dynamically anymore,
    so this just uses sb->s_root->d_op to set ->d_op.

    - d_find_alias() may return DCACHE_DISCONNECTED dentry. It's not
    the interesting dentry there. This checks it.

    - Add missing LOOKUP_PARENT check. We don't need to drop the valid
    negative dentry for (LOOKUP_CREATE | LOOKUP_PARENT) lookup.

    - For consistent filename on creation path, this drops negative dentry
    if we can't see intent.

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

    OGAWA Hirofumi
     
  • Current vfat_lookup() creates negetive dentry blindly if vfat_find()
    returned a error. It's wrong. If the error isn't -ENOENT, just return
    error.

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

    OGAWA Hirofumi
     
  • Use fat_detach() instead of opencoding it.

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

    OGAWA Hirofumi
     
  • This fixes the missing update for bhs/nr_bhs in case the caller
    accessed from block boundary to first block of boundary.

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

    OGAWA Hirofumi
     
  • fat_hash() is using the algorithm known as bad. Instead of it, this
    uses hash_32(). The following is the summary of test.

    old hash:
    hash func (1000 times): 33489 cycles
    total inodes in hash table: 70926
    largest bucket contains: 696
    smallest bucket contains: 54

    new hash:
    hash func (1000 times): 33129 cycles
    total inodes in hash table: 70926
    largest bucket contains: 315
    smallest bucket contains: 236

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

    OGAWA Hirofumi
     
  • Coverity CID 2332 & 2333 RESOURCE_LEAK

    In fat_search_long() if fat_parse_long() returns a -ve value we return
    without first freeing unicode. This patch free's them on this error path.

    The above was false positive on current tree, but this change is more
    clean, so apply as cleanup.

    [hirofumi@mail.parknet.co.jp: fix coding style]
    Signed-off-by: Darren Jenkins
    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Darren Jenkins
     
  • Since fat_dir_ioctl() was already fixed (i.e. called under ->i_mutex),
    and __fat_readdir() doesn't take BKL anymore. So, BKL for ->llseek()
    is pointless, and we have to use generic_file_llseek().

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

    OGAWA Hirofumi
     
  • This cleans date_dos2unix()/fat_date_unix2dos() up. New code should be
    much more readable.

    And this fixes those old functions. Those doesn't handle 2100
    correctly. 2100 isn't leap year, but old one handles it as leap year.
    Also, with this, centi sec is handled and is fixed.

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

    OGAWA Hirofumi
     
  • This splits __KERNEL__ stuff in include/msdos_fs.h into fs/fat/fat.h.

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

    OGAWA Hirofumi
     
  • This just moves those files, but change link order from MSDOS, VFAT to
    VFAT, MSDOS.

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

    OGAWA Hirofumi
     
  • While debugging a sync mount regression on vfat I noticed that there were
    mount options parsed by the driver that were not documented.

    [hirofumi@mail.parknet.co.jp: fix some parts]
    Signed-off-by: Bart Trojanowski
    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bart Trojanowski
     
  • The architecture header files were recently moved from
    include/asm-arm/mach-at91/ to arch/arm/mach-at91/include/mach/. The SAM9
    watchdog driver still includes a header from the old location.

    Signed-off-by: Andrew Victor
    Cc: Wim Van Sebroeck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Victor
     
  • -rtc0: alarms up to one month, y3k, 114 bytes nvram, , hpet irqs irqs
    +rtc0: alarms up to one month, y3k, 114 bytes nvram, hpet irqs

    Signed-off-by: Frans Pop
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Frans Pop
     
  • The atmel_serial driver is mismanaging its clock by leaving it on at all
    times ... the whole point of clock management is to leave it off unless
    it's actively needed, which conserves power!!

    Although the kernel doesn't actually hang without my fix, it does
    discard quite a lot of early console output.

    The result still looks correct:

    usart users= 1 on 35000000 Hz, for atmel_usart.0
    usart users= 0 off 35000000 Hz, for atmel_usart.2

    when using ttyS0 as serial console.

    [haavard.skinnemoen@atmel.com: Make sure clock is enabled early for console]
    Signed-off-by: David Brownell
    Signed-off-by: Haavard Skinnemoen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • cpuset can be used to move a process onto or off an isolated CPU.

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

    Li Zefan
     
  • commit 3e680aae4e53ab54cdbb0c29257dae0cbb158e1c ("fb: convert
    lock/unlock_kernel() into local fb mutex") introduced several deadlocks
    in the fb_compat_ioctl() path, as mutex_lock() doesn't allow recursion,
    unlike lock_kernel(). This broke frame buffer applications on 64-bit
    systems with a 32-bit userland.

    commit 120a37470c2831fea49fdebaceb5a7039f700ce6 ("framebuffer compat_ioctl
    deadlock") fixed one of the deadlocks.

    This patch fixes the remaining deadlocks:
    - Revert commit 120a37470c2831fea49fdebaceb5a7039f700ce6,
    - Extract the core logic of fb_ioctl() into a new function do_fb_ioctl(),
    - Change all callsites of fb_ioctl() where info->lock is already held to
    call do_fb_ioctl() instead,
    - Add sparse annotations to all routines that take info->lock.

    Signed-off-by: Geert Uytterhoeven
    Cc: Mikulas Patocka
    Cc: Krzysztof Helt
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     
  • My last bugfix here (adding zone->lock) introduced a new problem: Using
    page_zone(pfn_to_page(pfn)) to get the zone after the for() loop is wrong.
    pfn will then be >= end_pfn, which may be in a different zone or not
    present at all. This may lead to an addressing exception in page_zone()
    or spin_lock_irqsave().

    Now I use __first_valid_page() again after the loop to find a valid page
    for page_zone().

    Signed-off-by: Gerald Schaefer
    Acked-by: Nathan Fontenot
    Reviewed-by: KAMEZAWA Hiroyuki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gerald Schaefer
     
  • In ext3_sync_fs, we only wait for a commit to finish if we started it, but
    there may be one already in progress which will not be synced.

    In the case of a data=ordered umount with pending long symlinks which are
    delayed due to a long list of other I/O on the backing block device, this
    causes the buffer associated with the long symlinks to not be moved to the
    inode dirty list in the second phase of fsync_super. Then, before they
    can be dirtied again, kjournald exits, seeing the UMOUNT flag and the
    dirty pages are never written to the backing block device, causing long
    symlink corruption and exposing new or previously freed block data to
    userspace.

    This can be reproduced with a script created
    by Eric Sandeen :

    #!/bin/bash

    umount /mnt/test2
    mount /dev/sdb4 /mnt/test2
    rm -f /mnt/test2/*
    dd if=/dev/zero of=/mnt/test2/bigfile bs=1M count=512
    touch
    /mnt/test2/thisisveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryverylongfilename
    ln -s
    /mnt/test2/thisisveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryverylongfilename
    /mnt/test2/link
    umount /mnt/test2
    mount /dev/sdb4 /mnt/test2
    ls /mnt/test2/
    umount /mnt/test2

    To ensure all commits are synced, we flush all journal commits now when
    sync_fs'ing ext3.

    Signed-off-by: Arthur Jones
    Cc: Eric Sandeen
    Cc: Theodore Ts'o
    Cc:
    Cc: [2.6.everything]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arthur Jones
     
  • Paramter @mem has been removed since v2.6.26, now delete it's comment.

    Signed-off-by: Qinghuang Feng
    Acked-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Qinghuang Feng
     
  • P700m support was added in:
    9cff3b383dad193b0762c27278a16237e10b53dc

    Update cciss.txt to match.

    Signed-off-by: dann frazier
    Acked-by: Mike Miller
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    dann frazier
     
  • Signed-off-by: Tim Hockin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Hockin
     
  • This fixes an oops when reading /proc/sched_debug.

    A cgroup won't be removed completely until finishing cgroup_diput(), so we
    shouldn't invalidate cgrp->dentry in cgroup_rmdir(). Otherwise, when a
    group is being removed while cgroup_path() gets called, we may trigger
    NULL dereference BUG.

    The bug can be reproduced:

    # cat test.sh
    #!/bin/sh
    mount -t cgroup -o cpu xxx /mnt
    for (( ; ; ))
    {
    mkdir /mnt/sub
    rmdir /mnt/sub
    }
    # ./test.sh &
    # cat /proc/sched_debug

    BUG: unable to handle kernel NULL pointer dereference at 00000038
    IP: [] cgroup_path+0x39/0x90
    ...
    Call Trace:
    [] ? print_cfs_rq+0x6e/0x75d
    [] ? sched_debug_show+0x72d/0xc1e
    ...

    Signed-off-by: Li Zefan
    Acked-by: Paul Menage
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: [2.6.26.x, 2.6.27.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Li Zefan
     
  • It's insufficient to simply compare node ids when warning about offnode
    page_structs since it's possible to still have local affinity.

    Acked-by: Christoph Lameter
    Signed-off-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • Move the migrate_prep outside the mmap_sem for the following system calls

    1. sys_move_pages
    2. sys_migrate_pages
    3. sys_mbind()

    It really does not matter when we flush the lru. The system is free to
    add pages onto the lru even during migration which will make the page
    migration either skip the page (mbind, migrate_pages) or return a busy
    state (move_pages).

    Fixes this lockdep warning (and potential deadlock):

    Some VM place has
    mmap_sem -> kevent_wq via lru_add_drain_all()

    net/core/dev.c::dev_ioctl() has
    rtnl_lock -> mmap_sem (*) the ioctl has copy_from_user() and it can do page fault.

    linkwatch_event has
    kevent_wq -> rtnl_lock

    Signed-off-by: Christoph Lameter
    Cc: KOSAKI Motohiro
    Reported-by: Heiko Carstens
    Cc: Nick Piggin
    Cc: Hugh Dickins
    Cc: Rik van Riel
    Cc: Lee Schermerhorn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • Add a framebuffer driver for the Fujitsu Carmine/Coral-P(A)/Lime graphics
    controllers. Lime GDC support is known to work on PPC440EPx based lwmon5
    and MPC8544E based socrates embedded boards, both equipped with Lime GDC.
    Carmine/Coral-P PCI GDC support is known to work on PPC440EPx based
    Sequoia board and also on x86 platform.

    Signed-off-by: Anatolij Gustschin
    Cc: Dmitry Baryshkov
    Cc: Anton Vorontsov
    Cc: Matteo Fortini
    Cc: Krzysztof Helt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anatolij Gustschin
     
  • When /proc/sys/vm/oom_dump_tasks is enabled, it's only necessary to dump
    task state information for thread group leaders. The kernel log gets
    quickly overwhelmed on machines with a massive number of threads by
    dumping non-thread group leaders.

    Reviewed-by: Christoph Lameter
    Signed-off-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • Searching MAINTAINERS for "ioat" comes up empty. Fix this.

    Cc: "Dan Williams"
    Cc: "Sosnowski, Maciej"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • As we can determine exactly when a gigantic page is in use we can optimise
    the common regular page cases by pulling out gigantic page initialisation
    into its own function. As gigantic pages are never released to buddy we
    do not need a destructor. This effectivly reverts the previous change to
    the main buddy allocator. It also adds a paranoid check to ensure we
    never release gigantic pages from hugetlbfs to the main buddy.

    Signed-off-by: Andy Whitcroft
    Cc: Jon Tollefson
    Cc: Mel Gorman
    Cc: Nick Piggin
    Cc: Christoph Lameter
    Cc: [2.6.27.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • When working with hugepages, hugetlbfs assumes that those hugepages are
    smaller than MAX_ORDER. Specifically it assumes that the mem_map is
    contigious and uses that to optimise access to the elements of the mem_map
    that represent the hugepage. Gigantic pages (such as 16GB pages on
    powerpc) by definition are of greater order than MAX_ORDER (larger than
    MAX_ORDER_NR_PAGES in size). This means that we can no longer make use of
    the buddy alloctor guarentees for the contiguity of the mem_map, which
    ensures that the mem_map is at least contigious for maximmally aligned
    areas of MAX_ORDER_NR_PAGES pages.

    This patch adds new mem_map accessors and iterator helpers which handle
    any discontiguity at MAX_ORDER_NR_PAGES boundaries. It then uses these to
    implement gigantic page versions of copy_huge_page and clear_huge_page,
    and to allow follow_hugetlb_page handle gigantic pages.

    Signed-off-by: Andy Whitcroft
    Cc: Jon Tollefson
    Cc: Mel Gorman
    Cc: Nick Piggin
    Cc: Christoph Lameter
    Cc: [2.6.27.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • This regression was introduced by commit
    6ae5ce8e8d4de666f31286808d2285aa6a50fa40 ("cciss: remove redundant code").

    This patch fixes a regression where the controller firmware version is not
    displayed in procfs. The previous patch would be called anytime something
    changed. This will get called only once for each controller.

    Signed-off-by: Mike Miller
    Cc: FUJITA Tomonori
    Cc: Jens Axboe
    Cc: [2.6.27.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Miller
     
  • Regression introduced by commit 6ae5ce8e8d4de666f31286808d2285aa6a50fa40
    ("cciss: remove redundant code").

    This patch fixes a broken symlink in sysfs that was introduced by the
    above commit. We broke it in 2.6.27-rc on or about 20080804. Some
    installers are broken if this symlink does not exist and they may not
    detect the logical drives configured on the controller. It does not
    require being backported into 2.6.26.x or earlier kernels.

    Signed-off-by: Mike Miller
    Cc: Jens Axboe
    Cc: [2.6.27.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Miller
     
  • The function check_dev_ioctl_version() returns an error code upon fail but
    it isn't captured and returned in validate_dev_ioctl() as it should be.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Ian Kent
    Signed-off-by: Jeff Moyer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • When checking a directory tree in autofs_tree_busy() we can incorrectly
    decide that the tree isn't busy. This happens for the case of an active
    offset mount as autofs4_follow_mount() follows past the active offset
    mount, which has an open file handle used for expires, causing the file
    handle not to count toward the busyness check.

    Signed-off-by: Ian Kent
    Signed-off-by: Jeff Moyer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Add temperature sensor support for iMac 8.

    Signed-off-by: Henrik Rydberg
    Tested-by: Klaus Doblmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Henrik Rydberg
     
  • Add accelerometer, backlight and temperature sensor support for the new
    unibody Macbook Pro 5.

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

    Henrik Rydberg