26 Oct, 2005

13 commits

  • This patch kills a redundant rcu_dereference on fa->fa_info in fib_trie.c.
    As this dereference directly follows a list_for_each_entry_rcu line, we
    have already taken a read barrier with respect to getting an entry from
    the list.

    This read barrier guarantees that all values read out of fa are valid.
    In particular, the contents of structure pointed to by fa->fa_info is
    initialised before fa->fa_info is actually set (see fn_trie_insert);
    the setting of fa->fa_info itself is further separated with a write
    barrier from the insertion of fa into the list.

    Therefore by taking a read barrier after obtaining fa from the list
    (which is given by list_for_each_entry_rcu), we can be sure that
    fa->fa_info contains a valid pointer, as well as the fact that the
    data pointed to by fa->fa_info is itself valid.

    Signed-off-by: Herbert Xu
    Acked-by: Paul E. McKenney
    Signed-off-by: David S. Miller
    Signed-off-by: Arnaldo Carvalho de Melo

    Herbert Xu
     
  • It's fairly simple to resize the hash table, but currently you need to
    remove and reinsert the module. That's bad (we lose connection
    state). Harald has even offered to write a daemon which sets this
    based on load.

    Signed-off-by: Rusty Russell
    Signed-off-by: Harald Welte
    Signed-off-by: Arnaldo Carvalho de Melo

    Harald Welte
     
  • The code to handle the /proc interface can be cleaned up in several places:
    * use seq_file for read
    * don't need to remember all the filenames separately
    * use for_online_cpu's
    * don't vmalloc a buffer for small command from user.

    Committer note:
    This patch clashed with John Hawkes's "[NET]: Wider use of for_each_*cpu()",
    so I fixed it up manually.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Robert Olsson
    Signed-off-by: David S. Miller
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephen Hemminger
     
  • Fix some cosmetic issues. Indentation, spelling errors, and some whitespace.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Robert Olsson
    Signed-off-by: David S. Miller
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephen Hemminger
     
  • These are cleanup patches for pktgen that can go in 2.6.15
    Can use kzalloc in a couple of places.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Robert Olsson
    Signed-off-by: David S. Miller
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephen Hemminger
     
  • pktgen is calling kmalloc GFP_KERNEL and vmalloc with lock held.
    The simplest fix is to turn the lock into a semaphore, since the
    thread lock is only used for admin control from user context.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Robert Olsson
    Signed-off-by: David S. Miller
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephen Hemminger
     
  • In 'net' change the explicit use of for-loops and NR_CPUS into the
    general for_each_cpu() or for_each_online_cpu() constructs, as
    appropriate. This widens the scope of potential future optimizations
    of the general constructs, as well as takes advantage of the existing
    optimizations of first_cpu() and next_cpu(), which is advantageous
    when the true CPU count is much smaller than NR_CPUS.

    Signed-off-by: John Hawkes
    Signed-off-by: David S. Miller
    Signed-off-by: Arnaldo Carvalho de Melo

    John Hawkes
     
  • Signed-off-by: Patrick Caulfield
    Signed-off-by: Steven Whitehouse
    Signed-off-by: David S. Miller
    Signed-off-by: Arnaldo Carvalho de Melo

    Patrick Caulfield
     
  • Signed-off-by: Jochen Friedrich
    Signed-off-by: Arnaldo Carvalho de Melo

    Jochen Friedrich
     
  • Signed-off-by: Jochen Friedrich
    Signed-off-by: Arnaldo Carvalho de Melo

    Jochen Friedrich
     
  • Signed-off-by: Yan Zheng
    Acked-by: YOSHIFUJI Hideaki
    Signed-off-by: Arnaldo Carvalho de Melo

    Yan Zheng
     
  • If qla2x00_probe_one()'s call to qla2x00_iospace_config() fails, we call
    qla2x00_free_device() to clean up. But because ha->dpc_pid hasn't been set
    yet, qla2x00_free_device() tries to stop a kernel thread which hasn't started
    yet. It does wait_for_completion() against an uninitialised completion struct
    and the kernel hangs up.

    Fix it by initialising ha->dpc_pid a bit earlier.

    Cc: Andrew Vasquez
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • My alpha build is exploding because asm/atomic.h now needs smb_mb(), which is
    over in the (not included) system.h.

    I fear what will happen if I include system.h into atomic.h, so let's put the
    barriers into their own header file.

    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

25 Oct, 2005

2 commits


24 Oct, 2005

16 commits

  • Without this patch, uml compile fails with:

    LD .tmp_vmlinux1
    arch/um/kernel/built-in.o: In function `config_gdb_cb':
    arch/um/kernel/tt/gdb.c:129: undefined reference to `TASK_EXTERN_PID'

    Tested on i386, but fix needed on x86_64 too AFAICS.

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

    Miklos Szeredi
     
  • This might be harmless, but looks like a race from code inspection (I
    was unable to trigger it). I must admit, I don't understand why we
    can't return TIMER_RETRY after 'spin_unlock(&p->sighand->siglock)'
    without doing bump_cpu_timer(), but this is what original code does.

    posix_cpu_timer_set:

    read_lock(&tasklist_lock);

    spin_lock(&p->sighand->siglock);
    list_del_init(&timer->it.cpu.entry);
    spin_unlock(&p->sighand->siglock);

    We are probaly deleting the timer from run_posix_cpu_timers's 'firing'
    local list_head while run_posix_cpu_timers() does list_for_each_safe.

    Various bad things can happen, for example we can just delete this timer
    so that list_for_each() will not notice it and run_posix_cpu_timers()
    will not reset '->firing' flag. In that case,

    ....

    if (timer->it.cpu.firing) {
    read_unlock(&tasklist_lock);
    timer->it.cpu.firing = -1;
    return TIMER_RETRY;
    }

    sys_timer_settime() goes to 'retry:', calls posix_cpu_timer_set() again,
    it returns TIMER_RETRY ...

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • No need to rebalance when task exited

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • do_exit() clears ->it_##clock##_expires, but nothing prevents
    another cpu to attach the timer to exiting process after that.

    After exit_notify() does 'write_unlock_irq(&tasklist_lock)' and
    before do_exit() calls 'schedule() local timer interrupt can find
    tsk->exit_state != 0. If that state was EXIT_DEAD (or another cpu
    does sys_wait4) interrupted task has ->signal == NULL.

    At this moment exiting task has no pending cpu timers, they were cleaned
    up in __exit_signal()->posix_cpu_timers_exit{,_group}(), so we can just
    return from irq.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • 1. cleanup_timers() sets timer->task = NULL under tasklist + ->sighand locks.
    That means that this code in posix_cpu_timer_del() and posix_cpu_timer_set()

    lock_timer(timer);
    if (timer->task == NULL)
    return;
    read_lock(tasklist);
    put_task_struct(timer->task)

    is racy. With this patch timer->task modified and accounted only under
    timer->it_lock. Sadly, this means that dead task_struct won't be freed
    until timer deleted or armed.

    2. run_posix_cpu_timers() collects expired timers into local list under
    tasklist + ->sighand again. That means that posix_cpu_timer_del()
    should check timer->it.cpu.firing under these locks too.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Linus Torvalds
     
  • We should always re-arm an event queue's interrupt in
    mthca_tavor_interrupt() if the corresponding bit is set in the event cause
    register (ECR), even if we didn't find any entries in the EQ. If we don't,
    then there's a window where we miss an EQ entry and then get stuck because
    we don't get another EQ event.

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

    Roland Dreier
     
  • Fix a bug which was reported and diagnosed by
    Stefan Jones

    IDR trees include a cache of idr_layer objects. There's no way to destroy
    this cache, so when we discard an overall idr tree we end up leaking some
    memory.

    Add and use idr_destroy() for this. v9fs and infiniband also need to use
    idr_destroy() to avoid leaks.

    Or, we make the cache global, like radix_tree_preload(). Which is probably
    better. Later.

    Cc: Eric Van Hensbergen
    Cc: Roland Dreier
    Cc: Robert Love
    Cc: John McCutchan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • On 2005-05-01, Gerd Knorr sent in a patch to add cx22702 to cx88-dvb:

    [PATCH] dvb: cx22702 frontend driver update
    http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9990d744bea7d28e83c420e2c9d524c7a8a2d136

    ...but as we can see, the Kconfig portion of his patch was incorrectly
    applied to saa7134-dvb instead of cx88-dvb.

    On 2005-06-24, Adrian bunk fixed cx88-dvb:

    [PATCH] VIDEO_CX88_DVB must select DVB_CX22702
    http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d6988588e13616587aa879c2e0bd7cd811705e5d

    ...but we never removed the original patch from Gerd.

    This patch sets things straight:

    saa7134-dvb should not select cx22702

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

    Mike Krufky
     
  • This patch fixes error handling in sel_make_bools(), where currently we'd
    get a memory leak via security_get_bools() and try to kfree() the wrong
    pointer if called again.

    Signed-off-by: James Morris
    Acked-by: Stephen Smalley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davi Arnaut
     
  • This patch fixes a possible NULL dereference in policydb_destroy, where
    p->type_attr_map can be NULL if policydb_destroy is called to clean up a
    partially loaded policy upon an error during policy load. Please apply.

    Signed-off-by: Stephen Smalley
    Acked-by: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Smalley
     
  • Another case of missing call to security_file_permission: aio functions
    (namely, io_submit) does not check credentials with security modules.

    Below is the simple patch to the problem. It seems that it is enough to
    check for rights at the request submission time.

    Signed-off-by: Kostik Belousov
    Signed-off-by: Chris Wright
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kostik Belousov
     
  • Fix typos & trailing whitespace.
    Add blank lines in a few places.
    Remove "AM53C974=" option: driver does not exist.
    Restrict to < 80 columns in most places (but don't split formatted
    command-line arguments).
    Add a few option arguments for completeness.

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

    Randy Dunlap
     
  • That's what we've always historically done, and bigger windows seem to
    confuse some cardbus bridges. Or something.

    Alan reports that this makes the ThinkPad 600x series work properly
    again: the 4kB IO window for some reason made IDE DMA not work, which
    makes IDE painfully slow even if it works after DMA timeouts.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Linus Torvalds
     
  • Bursty timers aren't good for anybody, very much including latency for
    other programs when we trigger lots of timers in interrupt context. So
    set a random limit, after which we'll handle the rest on the next timer
    tick.

    Noted by Oleg Nesterov

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

23 Oct, 2005

6 commits

  • neigh_changeaddr attempts to delete neighbour timers without setting
    nud_state. This doesn't work because the timer may have already fired
    when we acquire the write lock in neigh_changeaddr. The result is that
    the timer may keep firing for quite a while until the entry reaches
    NEIGH_FAILED.

    It should be setting the nud_state straight away so that if the timer
    has already fired it can simply exit once we relinquish the lock.

    In fact, this whole function is simply duplicating the logic in
    neigh_ifdown which in turn is already doing the right thing when
    it comes to deleting timers and setting nud_state.

    So all we have to do is take that code out and put it into a common
    function and make both neigh_changeaddr and neigh_ifdown call it.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • neigh_add_timer cannot use add_timer unconditionally. The reason is that
    by the time it has obtained the write lock someone else (e.g., neigh_update)
    could have already added a new timer.

    So it should only use mod_timer and deal with its return value accordingly.

    This bug would have led to rare neighbour cache entry leaks.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • Stack traces are very helpful in determining the exact nature of a bug.
    So let's print a stack trace when the timer is added twice.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • As stated in Documentation/atomic_ops.txt, atomic functions
    returning values must have the memory barriers both before and after
    the operation.

    Thanks to DaveM for pointing that out.

    Signed-off-by: Ivan Kokshaysky
    Signed-off-by: Linus Torvalds

    Ivan Kokshaysky
     
  • On architectures where the char type defaults to unsigned some of the
    arithmetic in the AX.25 stack to fail, resulting in some packets being dropped
    on receive.

    Credits for tracking this down and the original patch to
    Bob Brose N0QBJ .

    Signed-off-by: Ralf Baechle DL5RB
    Signed-off-by: Arnaldo Carvalho de Melo

    Ralf Baechle
     
  • IPVS used flag NFC_IPVS_PROPERTY in nfcache but as now nfcache was removed the
    new flag 'ipvs_property' still needs to be copied. This patch should be
    included in 2.6.14.

    Further comments from Harald Welte:

    Sorry, seems like the bug was introduced by me.

    Signed-off-by: Julian Anastasov
    Signed-off-by: Harald Welte
    Signed-off-by: Arnaldo Carvalho de Melo

    Julian Anastasov
     

22 Oct, 2005

3 commits

  • Not sure how it slipped by, but here's a trivial typo fix for powernow.

    Signed-off-by: Chris Wright
    [ It's "nurter" backwards.. Maybe we have a hillbilly The Shining fan? ]
    Signed-off-by: Linus Torvalds

    Chris Wright
     
  • When I originally moved exit_itimers into __exit_signal, that was the only
    place where we could reliably know it was the last thread in the group
    dying, without races. Since then we've gotten the signal_struct.live
    counter, and do_exit can reliably do group-wide cleanup work.

    This patch moves the call to do_exit, where it's made without locks. This
    avoids the deadlock issues that the old __exit_signal code's comment talks
    about, and the one that Oleg found recently with process CPU timers.

    [ This replaces e03d13e985d48ac4885382c9e3b1510c78bd047f, which is why
    it was just reverted. ]

    Signed-off-by: Roland McGrath
    Signed-off-by: Linus Torvalds

    Roland McGrath
     
  • Revert commit e03d13e985d48ac4885382c9e3b1510c78bd047f, to be replaced
    by a much nicer fix from Roland.

    Linus Torvalds