Re: [PATCH 5/6] NLM: Convert lockd to use kthreads

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeff Layton <jlayton@...>
Cc: <akpm@...>, <linux-nfs@...>, <linux-kernel@...>
Date: Tuesday, January 8, 2008 - 2:16 am

On Saturday January 5, jlayton@redhat.com wrote:



This changes bothers me.  Putting the last ref to a module in code
inside that module is not safe, which is why module_put_and_exit
exists. 

So this module_put is either unsafe or not needed.  I think the
latter.

As you say in the comment, lockd_down now blocks until lockd actually
exits.  As every caller for lockd_down will own a reference to the
lockd module, the lockd thread no longer needs to own a reference too.
So I think it is safe to remove the module_put, and also remove the
__module_get at the top of the lockd function.

Also, I suspect that the "no users" and "no lockd running" messages
should probably be changed to BUGs as they really should be
impossible, not just unlikely.

Also:


This comment should go as the actual check has gone.

The rest looks fine. It is a substantial improvement, thanks.

NeilBrown
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 5/6] NLM: Convert lockd to use kthreads, Neil Brown, (Tue Jan 8, 2:16 am)