OCB's notification list

Having trouble with ocb’s and notification list.
I have a resmgr that accepts ionotify requests.
The client that asks for notification opens a file descriptor (FD1) on the resmgr (/dev/resmgr1/), requests notification and keeps FD1 open, to keep his ocb alive within the resmgr, and his entry on the notification list.
This part works good.
But this client also wants to open FD2 on /dev/resmgr1/, call devctl() and close FD2. Is it normal that the FD1 entry on the notification list within the resmgr is removed? close(FD1) has not been called ?!
Or should I use FD1 for the devctl() call?


In general, every open will result an ocb bind to the fd.

So when your application fd1 = open(/dev/resmgr1),
there will be an “ocb1” bind to this connection, any
io operation on fd1, will result a “ocb lookup”, and ocb1
will pass in to your handler function (read/write/notify)…

If same application fd2 = open(/dev/resmgr1), then
another ocb2 will be bind to this connection, closing fd2
should only result ocb2 being un-bind/freed, but as
long as fd1 is still no closed, ocb1 should still exist.

If you allocate/free/bind ocb yourself (instead of let
resmgr library do it for you), then of cause it’s your
resposibility to make it correct (either follow 1 ocb
per open, or if you have reason, share ocbs across
open, but you have to make sure free them correct).