31 May, 2007

2 commits

  • It should be pass "newsize" to vmtruncate function to modify the
    inode->i_size, while the old size is passed to vmtruncate.

    This bug was caught by LTP truncate test case on Blackfin platform.
    After it was fixed, the LTP truncate test case passed.

    Signed-off-by: Bryan Wu
    Cc: David Howells
    Signed-off-by: Linus Torvalds

    Bryan Wu
     
  • The current code is leaking a reference to dreq->kref when the calls to
    nfs_direct_read_schedule() and nfs_direct_write_schedule() return an
    error.
    This patch moves the call to kref_put() from nfs_direct_wait() back into
    nfs_direct_read() and nfs_direct_write() (which are the functions that
    actually took the reference in the first place) fixing the leak.

    Thanks to Denis V. Lunev for spotting the bug and proposing the original
    fix.

    Acked-by: Denis V. Lunev
    Acked-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

29 May, 2007

1 commit

  • The recent fix for preventing NULL files from being left around does not
    update the file size corectly in all cases. The missing case is a write
    extending the file that does not need to allocate a block.

    In that case we used a read mapping of the extent which forced the use of
    the read I/O completion handler instead of the write I/O completion
    handle. Hence the file size was not updated on I/O completion.

    SGI-PV: 965068
    SGI-Modid: xfs-linux-melb:xfs-kern:28657a

    Signed-off-by: David Chinner
    Signed-off-by: Nathan Scott
    Signed-off-by: Tim Shimmin

    David Chinner
     

26 May, 2007

6 commits

  • Why is it that since the 2f1a2ccb9c0de632ab07193becf5f7121794f6ae console
    UTF-8 fixes went into 2.6.22-rc1, the PowerMac G5 shows only inverse video
    question marks for the text on tty2-6? whereas tty1 is fine, and so is x86.

    No fault of that patch: by removing the old fallback behaviour, it reveals
    that 32-bit setfont running on 64-bit kernels has only really worked on
    the current console, the rest getting faked by that inadequate fallback.

    Bring the compat do_unimap_ioctl into line with the main one: PIO_UNIMAP
    and GIO_UNIMAP apply to the specified tty, not redirected to fg_console.
    Use the same checks, and most particularly, remember to check access_ok:
    con_set_unimap and con_get_unimap are using __get_user and __put_user.

    And the compat vt_check should ask for the same capability as the main
    one, CAP_SYS_TTY_CONFIG rather than CAP_SYS_ADMIN. Added in vt_ioctl's
    vc_cons_allocated check for safety, though failure may well be impossible.

    Signed-off-by: Hugh Dickins
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • Signed-off-by: Christoph Hellwig
    Signed-off-by: Mark Fasheh

    Christoph Hellwig
     
  • We weren't cleaning up our inode reference on error in
    ocfs2_reserve_local_alloc_bits(). Add a check for error return and iput() if
    need be. Move the code to set the alloc context inode info to the end of the
    function so we don't have any possibility of passing back a bad pointer.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Use zero_user_page() instead of open-coding it.

    Signed-off-by: Nate Diller
    Signed-off-by: Andrew Morton
    Signed-off-by: Mark Fasheh

    Nate Diller
     
  • We weren't calling this before, but since ocfs2 handles the entire truncate
    operation, we should.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Similarly to the page lock / cluster lock inversion in ocfs2_readpage, we
    can deadlock on ip_alloc_sem. We can down_read_trylock() instead and just
    return AOP_TRUNCATED_PAGE if the operation fails.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     

25 May, 2007

1 commit


24 May, 2007

11 commits

  • We only need to dirty the pages that were actually read in.

    Also convert nfs_direct_dirty_pages() to call set_page_dirty() instead of
    set_page_dirty_lock(). A call to lock_page() is unacceptable in an rpciod
    callback function.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • This patch fixes a couple of signage issues that were causing an Oops
    when running the LTP diotest4 test. get_user_pages() returns a signed
    error, hence we need to be careful when comparing with the unsigned
    number of pages from data->npages.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • When processes are allowed to attempt to lock a non-contiguous range of nfs
    write requests, it is possible for generic_writepages to 'wrap round' the
    address space, and call writepage() on a request that is already locked by
    the same process.

    We avoid the deadlock by checking if the page index is contiguous with the
    list of nfs write requests that is already held in our
    nfs_pageio_descriptor prior to attempting to lock a new request.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Delay writing 0's out in eCryptfs after a seek past the end of the file
    until data is actually written.

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

    ``The lseek() function shall not, by itself, extend the size of a
    file.''

    Without this fix, applications that lseek() past the end of the file without
    writing will experience unexpected behavior.

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

    Michael Halcrow
     
  • Gathering signals in bulk enables server applications to drain a signal
    queue (almost full of realtime signals) more efficiently by reducing the
    syscall and file look-up overhead.

    Very similar to the sigtimedwait4() call described by Niels Provos, Chuck
    Lever, and Stephen Tweedie in a paper entitled "Analyzing the Overload
    Behavior of a Simple Web Server". The paper lists more details and
    advantages.

    Signed-off-by: Davi E. M. Arnaut
    Acked-by: Davide Libenzi
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davi Arnaut
     
  • When inode is dropped (no more references) delete it from cache.

    There's not much point in keeping it cached, when a new lookup will refresh
    the attributes anyway.

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

    Miklos Szeredi
     
  • This fixes O_APPEND in direct IO mode. Also checks writes against file size
    limits, notably rlimits.

    Reported by Greg Bruno.

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

    Miklos Szeredi
     
  • We don't allow loading ELF shared library from noexec points so the
    same should apply to sys_uselib aswell.

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

    Christoph Hellwig
     
  • In stree.c, MIN_KEY is declared const. The extern declaration in dir.c
    doesn't match...

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

    David Woodhouse
     
  • Optimize select by a using stack space for small fd sets.
    core_sys_select() already has this optimization. This is for compat
    version.

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

    Badari Pulavarty
     
  • The wrong lookup flag was tested in ->create() causing havoc (error or
    Oops) when a regular file was created with mknod() in a fuse filesystem.

    Thanks to J. Cameijo Cerdeira for the report.

    Kernels 2.6.18 onward are affected. Please apply to -stable as well.

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

    Miklos Szeredi
     

23 May, 2007

1 commit

  • * master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6:
    sh: Fix dreamcast build for IRQ changes.
    sh: Fix clock multiplier on SH7722.
    sh: Wire up kdump crash kernel exec in die().
    sh: sr.bl toggling around idle sleep.
    sh: disable genrtc support.
    fs: Kill sh dependency for binfmt_flat.
    sh: Disable psw support for R7785RP.
    sh: Fix page size alignment in __copy_user_page().
    sh: Fix up various compile warnings for SE boards.
    sh: Wire up signalfd/timerfd/eventfd syscalls.
    sh: revert addition of page fault notifiers
    spelling fixes: arch/sh/
    input: hp680_ts compile fixes.
    sh: landisk: Header cleanups.
    sh: landisk: rtc-rs5c313 support.
    sh: Kill off pmb slab cache destructor.
    sh: Fix up psw build rules for r7780rp.
    sh: Shut up compiler warnings in __do_page_fault().

    Linus Torvalds
     

22 May, 2007

4 commits

  • This from a "tested" patch...

    Signed-off-by: Jeff Garzik
    Cc: Anton Altaparmakov
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     
  • This fixes the LDM driver so that it works with Windows Vista dynamic
    disks which are subtly different to Windows 2000/XP ones.

    The patch was needed to get a Vista formatted dynamic disk to be
    recognized and parsed successfully.

    Thanks go to Chris Teachworth for the report and testing.

    Cc: Richard Russon
    Signed-off-by: Anton Altaparmakov
    Signed-off-by: Linus Torvalds

    Anton Altaparmakov
     
  • First thing mm.h does is including sched.h solely for can_do_mlock() inline
    function which has "current" dereference inside. By dealing with can_do_mlock()
    mm.h can be detached from sched.h which is good. See below, why.

    This patch
    a) removes unconditional inclusion of sched.h from mm.h
    b) makes can_do_mlock() normal function in mm/mlock.c
    c) exports can_do_mlock() to not break compilation
    d) adds sched.h inclusions back to files that were getting it indirectly.
    e) adds less bloated headers to some files (asm/signal.h, jiffies.h) that were
    getting them indirectly

    Net result is:
    a) mm.h users would get less code to open, read, preprocess, parse, ... if
    they don't need sched.h
    b) sched.h stops being dependency for significant number of files:
    on x86_64 allmodconfig touching sched.h results in recompile of 4083 files,
    after patch it's only 3744 (-8.3%).

    Cross-compile tested on

    all arm defconfigs, all mips defconfigs, all powerpc defconfigs,
    alpha alpha-up
    arm
    i386 i386-up i386-defconfig i386-allnoconfig
    ia64 ia64-up
    m68k
    mips
    parisc parisc-up
    powerpc powerpc-up
    s390 s390-up
    sparc sparc-up
    sparc64 sparc64-up
    um-x86_64
    x86_64 x86_64-up x86_64-defconfig x86_64-allnoconfig

    as well as my two usual configs.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • The bug was introduced by 01f2705daf5a36208e69d7cf95db9c330f843af6.
    It misses to convert the first argument, it should be "new_page".

    This became a cause of fatfs corruption.

    Cc: Nate Diller
    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     

21 May, 2007

1 commit

  • Not really sure where this bogosity came from, but there's certainly
    nothing special about sh that lets us use flat files with the MMU on.

    Kill the dependency, and leave it as !MMU, like it is for all of the
    other nommu-wielding ports.

    Signed-off-by: Paul Mundt

    Paul Mundt
     

19 May, 2007

2 commits

  • The timerfd was using the unlocked waitqueue operations, but it was
    using a different lock, so poll_wait() would race with it.

    This makes timerfd directly use the waitqueue lock.

    Signed-off-by: Davide Libenzi
    Signed-off-by: Linus Torvalds

    Davide Libenzi
     
  • The eventfd was using the unlocked waitqueue operations, but it was
    using a different lock, so poll_wait() would race with it.

    This makes eventfd directly use the waitqueue lock.

    Signed-off-by: Davide Libenzi
    Signed-off-by: Linus Torvalds

    Davide Libenzi
     

17 May, 2007

10 commits

  • Trond Myklebust
     
  • grow_dev_page() simply passes GFP_NOFS to find_or_create_page. This means
    the allocation of radix tree nodes is done with GFP_NOFS and the allocation
    of a new page is done using GFP_NOFS.

    The mapping has a flags field that contains the necessary allocation flags
    for the page cache allocation. These need to be consulted in order to get
    DMA and HIGHMEM allocations etc right. And yes a blockdev could be
    allowing Highmem allocations if its a ramdisk.

    Cc: Hugh Dickins
    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • i_mutex on quota files is special. Unlike i_mutexes for other inodes it is
    acquired under dqonoff_mutex. Tell lockdep about this lock ranking. Also
    comment and code in quota_sync_sb() seem to be bogus (as i_mutex for quota
    file can be acquired under dqonoff_mutex). Move truncate_inode_pages()
    call under dqonoff_mutex and save some problems with races...

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

    Jan Kara
     
  • Use zero_user_page() instead of open-coding it.

    Signed-off-by: Nate Diller
    Cc: Michael Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nate Diller
     
  • Make sysctl/kernel/core_pattern and fs/exec.c agree on maximum core
    filename size and change it to 128, so that extensive patterns such as
    '/local/cores/%e-%h-%s-%t-%p.core' won't result in truncated filename
    generation.

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

    Dan Aloni
     
  • Trond Myklebust
     
  • Just thought this is easier to read.

    Acked-by: Davide Libenzi
    Signed-off-by: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     
  • SLAB_CTOR_CONSTRUCTOR is always specified. No point in checking it.

    Signed-off-by: Christoph Lameter
    Cc: David Howells
    Cc: Jens Axboe
    Cc: Steven French
    Cc: Michael Halcrow
    Cc: OGAWA Hirofumi
    Cc: Miklos Szeredi
    Cc: Steven Whitehouse
    Cc: Roman Zippel
    Cc: David Woodhouse
    Cc: Dave Kleikamp
    Cc: Trond Myklebust
    Cc: "J. Bruce Fields"
    Cc: Anton Altaparmakov
    Cc: Mark Fasheh
    Cc: Paul Mackerras
    Cc: Christoph Hellwig
    Cc: Jan Kara
    Cc: David Chinner
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • afs_prepare_write() should not mark a page up to date if it only partially
    fills it in, in expectation of the caller filling in the rest prior to calling
    commit_write(). commit_write(), however, should mark the page up to date.

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

    David Howells
     
  • Fix AFS to write back dirty on unmounting. This didn't happen because
    afs_super_ops.drop_inode was pointing to generic_delete_inode. Now this
    pointer is left set to NULL so that the default behaviour occurs instead.

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

    David Howells
     

16 May, 2007

1 commit