15 Feb, 2009

21 commits

  • Generic, states independent, get_user_chars().

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • there's too much repetition of code..

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • re-add some of the comments that got lost in the refactoring.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Now that we have nice numerical relations for the states, remove the macro
    magics.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Now what its only two functions, they again look rather similar.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • These two are also remakably similar

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • The _READ helpers show remarkable similarity, merge them.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Kill another argument

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • take away another parameter

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • In order to unify them, take some arguments away

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • split mark_lock_irq() into 4 simple helper functions

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • generate the usage strings

    XXX capital invasion :-(

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Generate the state bit definitions from the lockdep_states.h file.

    Also, move LOCK_USED to last, so that the

    USED_IN
    USED_IN_READ
    ENABLED
    ENABLED_READ

    states are nicely bit aligned -- we're going to use that property

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • For convenience later.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • remove the state iteration

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • remove the explicit state iteration

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Introduce a header file to generate all the states from.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • s/HELD_OVER/ENABLED/g

    so that its similar to the hard and soft-irq names.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • s/\(LOCKF\?_ENABLED_[^ ]*\)S\(_READ\)\?\>/\1\2/g

    So that the USED_IN and ENABLED have the same names.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Here is another version, with the incremental patch rolled up, and
    added reclaim context annotation to kswapd, and allocation tracing
    to slab allocators (which may only ever reach the page allocator
    in rare cases, so it is good to put annotations here too).

    Haven't tested this version as such, but it should be getting closer
    to merge worthy ;)

    --
    After noticing some code in mm/filemap.c accidentally perform a __GFP_FS
    allocation when it should not have been, I thought it might be a good idea to
    try to catch this kind of thing with lockdep.

    I coded up a little idea that seems to work. Unfortunately the system has to
    actually be in __GFP_FS page reclaim, then take the lock, before it will mark
    it. But at least that might still be some orders of magnitude more common
    (and more debuggable) than an actual deadlock condition, so we have some
    improvement I hope (the concept is no less complete than discovery of a lock's
    interrupt contexts).

    I guess we could even do the same thing with __GFP_IO (normal reclaim), and
    even GFP_NOIO locks too... but filesystems will have the most locks and fiddly
    code paths, so let's start there and see how it goes.

    It *seems* to work. I did a quick test.

    =================================
    [ INFO: inconsistent lock state ]
    2.6.28-rc6-00007-ged31348-dirty #26
    ---------------------------------
    inconsistent {in-reclaim-W} -> {ov-reclaim-W} usage.
    modprobe/8526 [HC0[0]:SC0[0]:HE1:SE1] takes:
    (testlock){--..}, at: [] brd_init+0x55/0x216 [brd]
    {in-reclaim-W} state was registered at:
    [] __lock_acquire+0x75b/0x1a60
    [] lock_acquire+0x91/0xc0
    [] mutex_lock_nested+0xb1/0x310
    [] brd_init+0x2b/0x216 [brd]
    [] _stext+0x3b/0x170
    [] sys_init_module+0xaf/0x1e0
    [] system_call_fastpath+0x16/0x1b
    [] 0xffffffffffffffff
    irq event stamp: 3929
    hardirqs last enabled at (3929): [] mutex_lock_nested+0x285/0x310
    hardirqs last disabled at (3928): [] mutex_lock_nested+0x59/0x310
    softirqs last enabled at (3732): [] sk_filter+0x83/0xe0
    softirqs last disabled at (3730): [] sk_filter+0x16/0xe0

    other info that might help us debug this:
    1 lock held by modprobe/8526:
    #0: (testlock){--..}, at: [] brd_init+0x55/0x216 [brd]

    stack backtrace:
    Pid: 8526, comm: modprobe Not tainted 2.6.28-rc6-00007-ged31348-dirty #26
    Call Trace:
    [] print_usage_bug+0x193/0x1d0
    [] mark_lock+0xaf0/0xca0
    [] mark_held_locks+0x55/0xc0
    [] ? brd_init+0x0/0x216 [brd]
    [] trace_reclaim_fs+0x2a/0x60
    [] __alloc_pages_internal+0x475/0x580
    [] ? mutex_lock_nested+0x26e/0x310
    [] ? brd_init+0x0/0x216 [brd]
    [] brd_init+0x6a/0x216 [brd]
    [] ? brd_init+0x0/0x216 [brd]
    [] _stext+0x3b/0x170
    [] ? mutex_unlock+0x9/0x10
    [] ? __mutex_unlock_slowpath+0x10d/0x180
    [] ? trace_hardirqs_on_caller+0x12c/0x190
    [] sys_init_module+0xaf/0x1e0
    [] system_call_fastpath+0x16/0x1b

    Signed-off-by: Nick Piggin
    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Nick Piggin
     
  • This modifies the timer code in a way to allow lockdep to detect
    deadlocks resulting from a lock being taken in the timer function
    as well as around the del_timer_sync() call.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

08 Feb, 2009

1 commit


07 Feb, 2009

13 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (37 commits)
    Btrfs: Make sure dir is non-null before doing S_ISGID checks
    Btrfs: Fix memory leak in cache_drop_leaf_ref
    Btrfs: don't return congestion in write_cache_pages as often
    Btrfs: Only prep for btree deletion balances when nodes are mostly empty
    Btrfs: fix btrfs_unlock_up_safe to walk the entire path
    Btrfs: change btrfs_del_leaf to drop locks earlier
    Btrfs: Change btrfs_truncate_inode_items to stop when it hits the inode
    Btrfs: Don't try to compress pages past i_size
    Btrfs: join the transaction in __btrfs_setxattr
    Btrfs: Handle SGID bit when creating inodes
    Btrfs: Make btrfs_drop_snapshot work in larger and more efficient chunks
    Btrfs: Change btree locking to use explicit blocking points
    Btrfs: hash_lock is no longer needed
    Btrfs: disable leak debugging checks in extent_io.c
    Btrfs: sort references by byte number during btrfs_inc_ref
    Btrfs: async threads should try harder to find work
    Btrfs: selinux support
    Btrfs: make btrfs acls selectable
    Btrfs: Catch missed bios in the async bio submission thread
    Btrfs: fix readdir on 32 bit machines
    ...

    Linus Torvalds
     
  • The addition of filename encryption caused a regression in unencrypted
    filename symlink support. ecryptfs_copy_filename() is used when dealing
    with unencrypted filenames and it reported that the new, copied filename
    was a character longer than it should have been.

    This caused the return value of readlink() to count the NULL byte of the
    symlink target. Most applications don't care about the extra NULL byte,
    but a version control system (bzr) helped in discovering the bug.

    Signed-off-by: Tyler Hicks
    Signed-off-by: Linus Torvalds

    Tyler Hicks
     
  • * 'x86/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/frob/linux-2.6-roland:
    x86-64: fix int $0x80 -ENOSYS return

    Linus Torvalds
     
  • One of my past fixes to this code introduced a different new bug.
    When using 32-bit "int $0x80" entry for a bogus syscall number,
    the return value is not correctly set to -ENOSYS. This only happens
    when neither syscall-audit nor syscall tracing is enabled (i.e., never
    seen if auditd ever started). Test program:

    /* gcc -o int80-badsys -m32 -g int80-badsys.c
    Run on x86-64 kernel.
    Note to reproduce the bug you need auditd never to have started. */

    #include
    #include

    int
    main (void)
    {
    long res;
    asm ("int $0x80" : "=a" (res) : "0" (99999));
    printf ("bad syscall returns %ld\n", res);
    return res != -ENOSYS;
    }

    The fix makes the int $0x80 path match the sysenter and syscall paths.

    Reported-by: Dmitry V. Levin
    Signed-off-by: Roland McGrath

    Roland McGrath
     
  • * 'to-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/frob/linux-2.6-roland:
    elf core dump: fix get_user use

    Linus Torvalds
     
  • The elf_core_dump() code does its work with set_fs(KERNEL_DS) in force,
    so vma_dump_size() needs to switch back with set_fs(USER_DS) to safely
    use get_user() for a normal user-space address.

    Checking for VM_READ optimizes out the case where get_user() would fail
    anyway. The vm_file check here was already superfluous given the control
    flow earlier in the function, so that is a cleanup/optimization unrelated
    to other changes but an obvious and trivial one.

    Reported-by: Gerald Schaefer
    Signed-off-by: Roland McGrath

    Roland McGrath
     
  • This is a modification of a patch by Bill Pemberton

    nobh_write_end() could call attach_nobh_buffers() with head == NULL.
    This would result in a trap when attach_nobh_buffers() attempted to
    access bh->b_this_page.

    This can be illustrated by running the writev01 testcase from LTP on jfs.

    This error was introduced by commit 5b41e74a "vfs: fix data leak in
    nobh_write_end()". That patch did not take into account that if
    PageMappedToDisk() is true upon entry to nobh_write_begin(), then no
    buffers will be allocated for the page. In that case, we won't have to
    worry about a failed write leaving unitialized data in the page.

    Of course, head != NULL implies !page_has_buffers(page), so no need to
    test both.

    Signed-off-by: Dave Kleikamp
    Cc: Bill Pemberton
    Cc: Dmitri Monakhov
    Signed-off-by: Linus Torvalds

    Dave Kleikamp
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
    ALSA: hda - Add missing COEF initialization for ALC887
    ALSA: hda - Add missing initialization for ALC272
    sound: usb-audio: handle wMaxPacketSize for FIXED_ENDPOINT devices
    ALSA: hda - Fix misc workqueue issues
    ALSA: hda - Add quirk for FSC Amilo Xi2550

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
    ieee1394: dv1394: move deprecation message from module init to file open
    firewire: core: Remove card from list of cards when enable fails

    Linus Torvalds
     
  • This fixes the shortlog attribution e.g. for 106757b38fff

    Signed-off-by: Uwe Kleine-König
    Acked-by: Sascha Hauer
    Acked-by: Wolfram Sang
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     
  • I created commit 7971db5a4b4176ad5df590fce07a962c643a2740 on a machine
    where I forgot to set user.name and user.email before. The default
    values were not optimal.

    Signed-off-by: Uwe Kleine-König
    Acked-by: Wolfram Sang
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     
  • I happened to forked lots of processes, and hit NULL pointer dereference.
    It is because in copy_process() after checking max_threads, 0 is returned
    but not -EAGAIN.

    The bug is introduced by "CRED: Detach the credentials from task_struct"
    (commit f1752eec6145c97163dbce62d17cf5d928e28a27).

    Signed-off-by: Li Zefan
    Signed-off-by: David Howells
    Acked-by: James Morris
    Signed-off-by: Linus Torvalds

    Li Zefan
     
  • The S_ISGID check in btrfs_new_inode caused an oops during subvol creation
    because sometimes the dir is null.

    Signed-off-by: Chris Mason

    Chris Mason
     

06 Feb, 2009

5 commits