On Fri, 19 Oct 2007 20:40:35 +0300, Vitaliy Ivanov <vitalivanov@gmail.com> wrote: Hi, Vitaly, I added you on cc: for the 2.6 cleanup. Please double-check what I'm doing there and use it for your 2.4 version. I hope my intentions get clearer with an example. Now, about the specific question:The fundamental reason why you cannot lock a free-able structure with an in-structure lock is this. Imagine thread A locks in order to process a disconnect. Thread B wants to open and waits for the lock. Notice that the struct is not open, so thread A frees it. At this point, thread B is using a freed memory. The solution is to lock the instance struct dev with dev->mtx, except for the open count, which is locked by a static lock (I'm ignoring interrupts here, which cannot use mutexes). I'm sorry to say, you're quite right: a number of drivers in 2.4 got it wrong, and some (like adutux) carried it through 2.6.23. -- Pete ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
| H. Peter Anvin | Re: [RFC 00/15] x86_64: Optimize percpu accesses |
| Linus Torvalds | Linux 2.6.27-rc5 |
| Ingo Molnar | [announce] "kill the Big Kernel Lock (BKL)" tree |
| Greg KH | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Ben Hutchings | Re: [GIT]: Networking |
| Jarek Poplawski | [PATCH iproute2] Re: HTB accuracy for high speed |
