On Wed, 2006-08-09 at 18:07 -0400, Wendy Cheng wrote: > The whole thing is about deadlock, not about reference count. Look at > the logic ... nlm_traverse_files grabs the nlm_file_mutex, then comes > down to nlm_release_file where it tries to get nlm_file_mutex lock > again. I'll need to run now - we can discuss this tomorrow morning. > Please re-read the issue and we'll discuss later. Here you go. Assuming this compiles, it ought to prevent the recursive call to mutex_lock(&nlm_file_mutex), _and_ speed up nlm_release_file() in the case where we know we're not going to free up the file. Cheers, Trond