23 Dec, 2006

33 commits

  • kstrdup() returns NULL on error.

    Cc: David Woodhouse
    Signed-off-by: Akinobu Mita
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • register_memory() becomes double definition in 2.6.20-rc1. It is defined
    in arch/i386/kernel/setup.c as static definition in 2.6.19. But it is
    moved to arch/i386/kernel/e820.c in 2.6.20-rc1. And same name function is
    defined in driver/base/memory.c too. So, it becomes cause of compile error
    of duplicate definition if memory hotplug option is on.

    Signed-off-by: Yasunori Goto
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yasunori Goto
     
  • This is to disallow to make SLOB with SMP or SPARSEMEM. This avoids latent
    troubles of SLOB with SLAB_DESTROY_BY_RCU. And fix compile error.

    Signed-off-by: Yasunori Goto
    Acked-by: Randy Dunlap
    Acked-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yasunori Goto
     
  • Add more debugging in the rmap code in an attempt to locate to source of
    the occasional "mapcount went negative" assertions.

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

    Nick Piggin
     
  • Fix a bug that only appears when AoE goes over a network card that does not
    support scatter-gather. The headers in the linear part of the skb appeared
    to be larger than they really were, resulting in data that was offset by 24
    bytes.

    This patch eliminates the offset data on cards that don't support
    scatter-gather or have had scatter-gather turned off. There remains an
    unrelated issue that I'll address in a separate email.

    Fixes bugzilla #7662

    Signed-off-by: "Ed L. Cashin"
    Cc:
    Cc: Greg KH
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ed L. Cashin
     
  • Add a new section to the CodingStyle file, encouraging people not to
    re-invent available kernel macros such as ARRAY_SIZE(), FIELD_SIZEOF(),
    min() and max(), among others.

    Signed-off-by: Robert P. J. Day
    Acked-by: Randy Dunlap
    Acked-by: Jan Engelhardt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • Mark JFFS as broken and provide a warning to users that it is deprecated
    and scheduled for removal in 2.6.21

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

    Josh Boyer
     
  • Matthew Wilcox noticed that the debug_locks_silent use should be inverted
    in DEBUG_LOCKS_WARN_ON(). This bug was causing spurious stacktraces and
    incorrect failures in the locking self-test on the parisc kernel.

    Bug-found-by: Matthew Wilcox
    Signed-off-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Trevor found a file size problem in eCryptfs in recent kernels, and he
    tracked it down to an fsstack change.

    This was the eCryptfs copy_attr_all:

    > -void ecryptfs_copy_attr_all(struct inode *dest, const struct inode *src)
    > -{
    > - dest->i_mode = src->i_mode;
    > - dest->i_nlink = src->i_nlink;
    > - dest->i_uid = src->i_uid;
    > - dest->i_gid = src->i_gid;
    > - dest->i_rdev = src->i_rdev;
    > - dest->i_atime = src->i_atime;
    > - dest->i_mtime = src->i_mtime;
    > - dest->i_ctime = src->i_ctime;
    > - dest->i_blkbits = src->i_blkbits;
    > - dest->i_flags = src->i_flags;
    > -}

    This is the fsstack copy_attr_all:

    > +void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
    > + int (*get_nlinks)(struct inode *))
    > +{
    > + if (!get_nlinks)
    > + dest->i_nlink = src->i_nlink;
    > + else
    > + dest->i_nlink = (*get_nlinks)(dest);
    > +
    > + dest->i_mode = src->i_mode;
    > + dest->i_uid = src->i_uid;
    > + dest->i_gid = src->i_gid;
    > + dest->i_rdev = src->i_rdev;
    > + dest->i_atime = src->i_atime;
    > + dest->i_mtime = src->i_mtime;
    > + dest->i_ctime = src->i_ctime;
    > + dest->i_blkbits = src->i_blkbits;
    > + dest->i_flags = src->i_flags;
    > +
    > + fsstack_copy_inode_size(dest, src);
    > +}

    The addition of copy_inode_size breaks eCryptfs, since eCryptfs needs to
    interpolate the file sizes (eCryptfs has extra space in the lower file for
    the header). The setting of the upper inode size occurs elsewhere in
    eCryptfs, and the new copy_attr_all now undoes what eCryptfs was doing
    right beforehand.

    I see three ways of going forward from here. (1) Something like this patch
    needs to go in (assuming it jives with Unionfs), (2) we need to make a
    change to the fsstack API for more fine-grained control over copying
    attributes (e.g., by also including a callback function for calculating the
    right file size, which will require some more work on both eCryptfs and
    Unionfs), or (3) the fsstack patch on eCryptfs (commit
    0cc72dc7f050188d8d7344b1dd688cbc68d3cd30 made on Fri Dec 8 02:36:31 2006
    -0800) needs to be yanked in 2.6.20.

    I think the simplest solution, from eCryptfs' perspective, is to just
    remove the inode size copy.

    Remove inode size copy in general fsstack attr copy code. Stacked
    filesystems may need to interpolate the inode size, since the file
    size in the lower file may be different than the file size in the
    stacked layer.

    Signed-off-by: Michael Halcrow
    Acked-by: Josef "Jeff" Sipek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Halcrow
     
  • Teach this driver about the workqueue changes.

    Cc: Vitaly Wool
    Cc: Jeff Garzik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Fix the compilation failure for smc911x.c when NET_POLL_CONTROLLER is set.

    Signed-off-by: Vitaly Wool
    Cc: Jeff Garzik
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vitaly Wool
     
  • The sanity check for no_irq_chip in __set_irq_hander() is unconditional on
    both install and uninstall of an handler. This triggers false warnings and
    replaces no_irq_chip by dummy_irq_chip in the uninstall case.

    Check only, when a real handler is installed.

    Signed-off-by: Thomas Gleixner
    Acked-by: Ingo Molnar
    Acked-by: Sylvain Munaut
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Gleixner
     
  • fix vm_events_fold_cpu() build breakage

    2.6.20-rc1 does not build properly if CONFIG_VM_EVENT_COUNTERS is set
    and CONFIG_HOTPLUG is unset:

    CC init/version.o
    LD init/built-in.o
    LD .tmp_vmlinux1
    mm/built-in.o: In function `page_alloc_cpu_notify':
    page_alloc.c:(.text+0x56eb): undefined reference to `vm_events_fold_cpu'
    make: *** [.tmp_vmlinux1] Error 1

    [akpm@osdl.org: cleanup]
    Signed-off-by: Magnus Damm
    Cc: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Magnus Damm
     
  • The structure cpu_isolated_map is used not only during initialization.
    Multi-core scheduler configuration changes and exclusive cpusets
    use this during run time. During setting of sched_mc_power_savings
    policy, this structure is accessed to update sched_domains.

    Signed-off-by: Tim Chen
    Acked-by: Suresh Siddha
    Acked-by: Ingo Molnar
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Chen
     
  • Ignore files generated by 'make cscope'

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

    Tobias Klauser
     
  • The version of mm/vmscan.c in Linus' current tree has swapped parameters in
    the shrink_all_zones declaration and call, used by the various
    suspend-to-disk implementations. This doesn't seem to have any great
    adverse effect, but it's clearly wrong.

    Signed-off-by: Nigel Cunningham
    Cc: Pavel Machek
    Cc: "Rafael J. Wysocki"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nigel Cunningham
     
  • Add proper prototypes for sysv_{init,destroy}_icache() in sysv.h

    Signed-off-by: Adrian Bunk
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

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

    Adrian Bunk
     
  • Fix kernel-doc warnings in 2.6.20-rc1.

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

    Randy Dunlap
     
  • The declaration of kmem_ptr_validate in slab.h does not match the
    one in slab.c. Remove the fastcall attribute (this is the only use in
    slab.c).

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

    Christoph Lameter
     
  • drivers/char/rtc.c:116: warning: 'hpet_rtc_interrupt' defined but not used

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

    Andrew Morton
     
  • Ran into BUG() while doing madvise(REMOVE) testing. If we are punching a
    hole into shared memory segment using madvise(REMOVE) and the entire hole
    is below the indirect blocks, we hit following assert.

    BUG_ON(limit
    Cc: Hugh Dickins
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Badari Pulavarty
     
  • Commit 2d7d253548cffdce80f4e03664686e9ccb1b0ed7 ("fix cond_resched() fix")
    introduced an 'expected_preempt_count' parameter to __resched_legal() to
    fix a bug where it was returning a false negative when called from
    cond_resched_lock() and preemption was enabled.

    Unfortunately this broke things for when preemption is disabled.
    preempt_count() will always return zero, thus failing the check against any
    value of expected_preempt_count not equal to zero. cond_resched_lock() for
    example, passes an expected_preempt_count value of 1.

    So fix the fix for the cond_resched() fix by skipping the check of
    preempt_count() against expected_preempt_count when preemption is disabled.

    Credit should go to Sunil Mushran for spotting the bug during testing.

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

    Mark Fasheh
     
  • The VM event counters, enabled by CONFIG_VM_EVENT_COUNTERS, which provides
    VM event counters in /proc/vmstat, has become more essential to
    non-EMBEDDED kernel configurations than they were in the past. Comments in
    the code and the Kconfig configuration explanation were stale, downplaying
    their role excessively.

    Refresh those comments to correctly reflect the current role of VM event
    counters.

    Signed-off-by: Paul Jackson
    Acked-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Jackson
     
  • Add compile-time and run-time API versioning.

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

    Avi Kivity
     
  • This allows plan9 to get a little further booting.

    Signed-off-by: Michael Riepe
    Signed-off-by: Avi Kivity
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Riepe
     
  • This allows opensolaris to boot on kvm/intel.

    Signed-off-by: Michael Riepe
    Signed-off-by: Avi Kivity
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Riepe
     
  • Some msrs, such as MSR_STAR, are not available on all processors. Exporting
    them causes qemu to try to fetch them, which will fail.

    So, check all msrs for validity at module load time.

    Signed-off-by: Michael Riepe
    Signed-off-by: Avi Kivity
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Riepe
     
  • Signed-off-by: Avi Kivity
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Avi Kivity
     
  • Fixes sf bug 1614113 (segfaults in nbench).

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

    Avi Kivity
     
  • This is necessary for linux guests.

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

    Avi Kivity
     
  • Consolidate the logic for checking whether a vcpu index is valid. Also, use
    likely(), as a valid value should be the overwhelmingly common case.

    Signed-off-by: James Morris
    Signed-off-by: Avi Kivity
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Morris
     
  • Only (un)account for IO and page-dirtying for devices which have real backing
    store (ie: not tmpfs or ramdisks).

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

    Andrew Morton
     

22 Dec, 2006

7 commits

  • The recent io scheduler allow_merge commit left the block layer with
    no merging, oops. This patch fixes that up.

    That means the CFQ change needs to be verified again, it might not fix
    the original bug now. But that's a seperate thing, I'll double check
    that tomorrow.

    Signed-off-by: Jens Axboe
    Signed-off-by: Linus Torvalds

    Jens Axboe
     
  • truncate presently invalidates the dirty page's buffer_heads then shoots down
    the page. But try_to_free_buffers() will now bale out because the page is
    dirty.

    Net effect: the LRU gets filled with dirty pages which have invalidated
    buffer_heads attached. They have no ->mapping and hence cannot be cleaned.
    The machine leaks memory at an enormous rate.

    Fix this by cleaning the page before running try_to_free_buffers(), so
    try_to_free_buffers() can do its work.

    Also, remember to do dirty-page-acoounting in cancel_dirty_page() so the
    machine won't wedge up trying to write non-existent dirty pages.

    Probably still wrong, but now less so.

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

    Andrew Morton
     
  • XFS appears to call clear_page_dirty to get the mapping tree dirty tag
    set correctly at the same time the page dirty flag is cleared. I note
    that this can be done by set_page_writeback() if we clear the dirty flag
    on the page first when we are writing back the entire page.

    Hence it seems to me that the XFS call to clear_page_dirty() could
    easily be substituted by clear_page_dirty_for_io() followed by a call to
    set_page_writeback() to get the mapping tree tags set correctly after
    the page has been marked clean.

    Signed-off-by: Linus Torvalds

    David Chinner
     
  • The use by FUSE was just a remnant of an optimization from the time
    when writable mappings were supported.

    Now FUSE never actually allows the creation of dirty pages, so this
    invocation of clear_page_dirty() is effectively a no-op.

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

    Miklos Szeredi
     
  • This patch removes some questionable code that attempted to make a
    no-longer-used page easier to reclaim.

    Calling metapage_writepage against such a page will not result in any
    I/O being performed, so removing this code shouldn't be a big deal.

    [ It's likely that we could have just replaced the "clear_page_dirty()"
    call with a call to "cancel_dirty_page()" instead, but in the
    meantime this is cleaner and simpler anyway, so unless there is some
    overriding reason (and Dave implies there isn't) I'll just use this
    patch as-is. - Linus ]

    Signed-off-by: Dave Kleikamp
    Signed-off-by: Linus Torvalds

    Dave Kleikamp
     
  • They were horribly easy to mis-use because of their tempting naming, and
    they also did way more than any users of them generally wanted them to
    do.

    A dirty page can become clean under two circumstances:

    (a) when we write it out. We have "clear_page_dirty_for_io()" for
    this, and that function remains unchanged.

    In the "for IO" case it is not sufficient to just clear the dirty
    bit, you also have to mark the page as being under writeback etc.

    (b) when we actually remove a page due to it becoming inaccessible to
    users, notably because it was truncate()'d away or the file (or
    metadata) no longer exists, and we thus want to cancel any
    outstanding dirty state.

    For the (b) case, we now introduce "cancel_dirty_page()", which only
    touches the page state itself, and verifies that the page is not mapped
    (since cancelling writes on a mapped page would be actively wrong as it
    is still accessible to users).

    Some filesystems need to be fixed up for this: CIFS, FUSE, JFS,
    ReiserFS, XFS all use the old confusing functions, and will be fixed
    separately in subsequent commits (with some of them just removing the
    offending logic, and others using clear_page_dirty_for_io()).

    This was confirmed by Martin Michlmayr to fix the apt database
    corruption on ARM.

    Cc: Martin Michlmayr
    Cc: Peter Zijlstra
    Cc: Hugh Dickins
    Cc: Nick Piggin
    Cc: Arjan van de Ven
    Cc: Andrei Popa
    Cc: Andrew Morton
    Cc: Dave Kleikamp
    Cc: Gordon Farquharson
    Cc: Martin Schwidefsky
    Cc: Trond Myklebust
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • This is preparatory work in our continuing saga on some hard-to-trigger
    file corruption with shared writable mmap() after the dirty page
    tracking changes (commit d08b3851da41d0ee60851f2c75b118e1f7a5fc89 etc)
    were merged.

    Signed-off-by: Linus Torvalds

    Linus Torvalds