You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am writing a fabric module for use with targetcli-fb and rtslib-fb. Currently, all functionality is there, but I have one issue that I wanted to discuss with the community to see if I need to change my code or if it is a targetcli/rtslib bug. Here is a link to the PR showing my changes to rtslib-fb to include the fabric module: open-iscsi/rtslib-fb#129. The issue I have is that once I create a target within targetcli, I cannot unregister my kernel module, even after I delete everything in targetcli. The module's ref count will increase with the number of objects I make in targetcli, obviously, and it will decrease when I delete them. But when I clearconfig, I am always left with one reference to my kernel module. Furthermore, if I do not create any targets in targetcli, (so my ref count starts at 0), but just try to create a target with a bad WWN (for example 0), I gain a reference to my kernel module that doesn't go away. Even though nothing was created in targetcli. After dumping the stack to see where the module_get was coming from, I see that it is coming form configfs_mkdir. So my best reasoning is that /sys/kernel/config/target/my_module gets created, which holds a reference to my module. Is there a canonical way to drop this reference? Should I be calling something differently? Or is this a targetcli/rtslib or configfs bug?
If anyone can help, I would be greatly appreciative.
Thanks,
Oliver
The text was updated successfully, but these errors were encountered:
However, if I rmdir /sys/kernel/config/target/my_module then the kernel reference gets dropped. So maybe this isn't a targetcli issue, unless you think that you should be able to drop the configfs directory from within targetcli. Say if all targets in a module get dropped. But I am satisfied that there is a way to unload my module, so I leave that up to your judgement and feel free to close this issue. Thank you.
Hi,
I am writing a fabric module for use with targetcli-fb and rtslib-fb. Currently, all functionality is there, but I have one issue that I wanted to discuss with the community to see if I need to change my code or if it is a targetcli/rtslib bug. Here is a link to the PR showing my changes to rtslib-fb to include the fabric module: open-iscsi/rtslib-fb#129. The issue I have is that once I create a target within targetcli, I cannot unregister my kernel module, even after I delete everything in targetcli. The module's ref count will increase with the number of objects I make in targetcli, obviously, and it will decrease when I delete them. But when I clearconfig, I am always left with one reference to my kernel module. Furthermore, if I do not create any targets in targetcli, (so my ref count starts at 0), but just try to create a target with a bad WWN (for example 0), I gain a reference to my kernel module that doesn't go away. Even though nothing was created in targetcli. After dumping the stack to see where the module_get was coming from, I see that it is coming form configfs_mkdir. So my best reasoning is that /sys/kernel/config/target/my_module gets created, which holds a reference to my module. Is there a canonical way to drop this reference? Should I be calling something differently? Or is this a targetcli/rtslib or configfs bug?
If anyone can help, I would be greatly appreciative.
Thanks,
Oliver
The text was updated successfully, but these errors were encountered: