From: hle@owl.eu.com (Hugo Lefeuvre) Date: Tue, 5 Jun 2018 10:20:16 -0400 Subject: develoment workflow: how to avoid duplicate work ? In-Reply-To: <68638.1528178148@turing-police.cc.vt.edu> References: <80132.1527564735@turing-police.cc.vt.edu> <20180530025657.GB1919@hle-laptop.local> <22501.1527692619@turing-police.cc.vt.edu> <20180531014432.GA3722@hle-laptop.local> <20180603192336.GV14048@gavran.carpriv.carnet.hr> <20180603222556.GB20060@hle-laptop.local> <20180604033303.GX14048@gavran.carpriv.carnet.hr> <12368.1528128607@turing-police.cc.vt.edu> <20180604223131.GA1981@hle-laptop.local> <68638.1528178148@turing-police.cc.vt.edu> Message-ID: <20180605142016.GA2334@hle-laptop.local> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org > > Do you mean that the ioctl/read/write call increments the reference > > count in this case ? It would mean that these syscalls aren't really > > using passed FD but instead create duplicates to make sure the open > > file description won't be freed during their execution, right ? > > One file descriptor is passed around, and each syscall or other code that needs > to protect it from evaporating out from under it takes a reference. Thanks. I think I'll have to read the source code to fully understand what happens. Do you know what piece of code handles this reference duplication ? As a conclusion we can assume that ioctl and release never run concurrently, and as such the lock introduced in my patch is useless. Concerning the TODO at line 876, I think I've misunderstood it. I'll think a bit more about it and come back with an updated patch later. Thanks ! Cheers, Hugo -- Hugo Lefeuvre (hle) | www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: