[OpenAFS] rpms on Red Hat 6.2 SMP systems

Nickolai Zeldovich kolya@MIT.EDU
Fri, 09 Aug 2002 17:54:51 -0400


On 09 Aug 2002, Derek Atkins <warlord@MIT.EDU> wrote:

> So i have to wonder why it works at all on 2.2, even UP?
> 
> Any suggestions for what I should do?  I can build another package
> if there is a 'quick fix'

On UP kernels, read_lock() is a preprocessor noop, so the resulting
object file doesn't reference tasklist_lock at all.

It seems to me that we don't need tasklist_lock in afs_osi_proc2cred.
That lock protects the linked list of tasks, but doesn't protect the
data inside each task_struct.  By the time we call afs_osi_proc2cred,
we already have a pointer to a task.  The group list isn't protected
by an explicit lock, but a process can only modify its own grouplist.

It seems like we should, however, hold tasklist_lock around the
for_each_task invocation in afs_osi_TraverseProcTable, to ensure that
we don't wander off the list when it's modified on another CPU.

So, I believe a safe quick fix would be to remove the read_lock call
in afs_osi_proc2cred.  This still leaves a potential race, though,
but that's a separate problem.

-- kolya