Messages in this thread | | | Date | Thu, 27 Nov 2003 11:23:04 -0500 | Subject | Re: [BUG 2.4] NFS unlocking operation accesses invalid file struct | From | Trond Myklebust <> |
| |
>>>>> " " == Akinobu Mita <mita@miraclelinux.com> writes:
> Thanks, Trond. but, your patch causes memory leak.
Yep. Worse: pthreads assumes that we don't use the pid as the lock owner. That again means that the test in locks_same_owner() is incorrect. For 2.6.x, the NPTL further complicates matters by introducing the tgid as their equivalent of the posix process id, and not tying CLONE_THREAD to CLONE_FILES. AFAICS there's nothing we can do about that...
So then the correct thing to do is indeed to wrap the call to locks_unlock_delete() with an fget()/fput() pair, and then to remove the test for fl_pid in locks_same_owner().
We then need to fix lockd so that it generates correct fl_owners for its locks...
Let me see if I can get that right.
Cheers, Trond - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |