From mboxrd@z Thu Jan 1 00:00:00 1970 From: freeman.zhang1992@gmail.com (freeman) Date: Tue, 18 Feb 2014 12:34:36 +0800 Subject: [Help] How to Replace File Operations in File System? In-Reply-To: References: <52FC29B3.10201@gmail.com> <52FC69C7.7010705@gmail.com> <52FCC870.3010303@gmail.com> Message-ID: <5302E2DC.1040308@gmail.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org > Hi > > The operations will not change back until your object gets destroyed, > whatever be the type of the object. > > Caching will not cause any issue here. > > Maybe if you can send the code we can have a look at it. > > > -- > Regards, > Rishi Agrawal Hi Rishi, It's very nice of you willing to help check my code! I'm now very excited ? problem solved! I spent half a day beautifying my code yesterday (so that it won't annoy you that much), and find there is a problem: Every time there is a read/write system call, I saved the lower file ops and address space ops. In their replacement(upper operations), I invoked lower ones. There's a possibility that it might saved the upper operations as lower ones if I open them twice in a short time. At this point, upper operation invoke itself! So I check the operations before truly save and replace them and, it works! Thanks to you and all the amazing people in this amazing list that helped me, now I get both wrapfs and my own non-filesystem module functional for my future work on transparent encryption, and most importantly, I've learned and enjoyed a lot! Regards Freeman Zhang