public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.4.33pre1 kernel/sysctl.c missing spin_unlock()
@ 2006-01-05 15:26 jürgen baumann
  2006-01-05 22:07 ` Willy TARREAU
  0 siblings, 1 reply; 2+ messages in thread
From: jürgen baumann @ 2006-01-05 15:26 UTC (permalink / raw)
  To: linux-kernel

possibly fixed yet, but maybe not:

in above patch there was a spinlock(&sysctl_lock) added in 
function do_register_sysctl_table(), but no corresponding 
spin_unlock() before return.

after starting the new kernel (unfortunately with further 
patches), it hangs on trying to start the kswapd-thread.

after inserting the spin_unlock() all run fine.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 2.4.33pre1 kernel/sysctl.c missing spin_unlock()
  2006-01-05 15:26 2.4.33pre1 kernel/sysctl.c missing spin_unlock() jürgen baumann
@ 2006-01-05 22:07 ` Willy TARREAU
  0 siblings, 0 replies; 2+ messages in thread
From: Willy TARREAU @ 2006-01-05 22:07 UTC (permalink / raw)
  To: jürgen baumann; +Cc: linux-kernel

On Thu, Jan 05, 2006 at 04:26:47PM +0100, jürgen baumann wrote:
> possibly fixed yet, but maybe not:
> 
> in above patch there was a spinlock(&sysctl_lock) added in 
> function do_register_sysctl_table(), but no corresponding 
> spin_unlock() before return.
> 
> after starting the new kernel (unfortunately with further 
> patches), it hangs on trying to start the kswapd-thread.
> 
> after inserting the spin_unlock() all run fine.

Can you be more specific ? First, there's no function named
like this in 2.4.33-pre1. The most approaching change I can
find lies in kernel/sysctl.c:register_sysctl_table() and this
one uses valid locking :

struct ctl_table_header *register_sysctl_table(ctl_table * table, 
                                               int insert_at_head)
{
        struct ctl_table_header *tmp;
        tmp = kmalloc(sizeof(struct ctl_table_header), GFP_KERNEL);
        if (!tmp)
                return NULL;
        tmp->ctl_table = table;
        INIT_LIST_HEAD(&tmp->ctl_entry);
        tmp->used = 0;
        tmp->unregistering = NULL;
===>    spin_lock(&sysctl_lock);
        if (insert_at_head)
                list_add(&tmp->ctl_entry, &root_table_header.ctl_entry);
        else
                list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry);
===>    spin_unlock(&sysctl_lock);
#ifdef CONFIG_PROC_FS
        register_proc_table(table, proc_sys_root, tmp);
#endif
        return tmp;
}

So possibly you found one real bug, but please tell us where you
had to patch !

Thanks in advance,
Willy


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-01-05 22:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-05 15:26 2.4.33pre1 kernel/sysctl.c missing spin_unlock() jürgen baumann
2006-01-05 22:07 ` Willy TARREAU

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox