isn't __brelse() wrong?

From: Tigran Aivazian (tigran@sco.COM)
Date: Fri Mar 03 2000 - 11:06:38 EST


Hi guys,

This is just a comment in passing as I am looking at some other code, but
a glance at __brelse() which looks like this:

        if (atomic_read(&buf->b_count)) {
                atomic_dec(&buf->b_count);
                return;
        }

suggests that when the same buffer is brelse'd on two CPUs they both could
get b_count=1 and decrement it thus causing negative b_count. I suppose I
could write a tiny module creating two kernel_thread() which simply
bread()/brelse() the same block from the same device in a reasonably busy
loop to cause negative b_count. Btw, while we are on this subject, is it
legal to create two instances of the "same" kernel thread, i.e. pass the
same address as 'fn' parameter and internally distinguish the threads by
current->pid?

Regards,
------
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | http://www.ocston.org/~tigran

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:14 EST