On 11/9/2022 4:08 AM, Aurélien Aptel wrote:
It's been a while since I worked on this and I'm not sure what exactly you are referring to but: There is a fundamental problem with intern linked lists (the way they are used in cifs and in the kernel in general). One element cannot be part of multiple lists. Within each element, you need to add a list_head field per list its part of. I didn't want to introduce cycles or redundant pointers (each new pointer is a pointer that has to be updated along with all its copies at the same time, can go stale, need to think about refcount, etc) In MS-SMB2, the channel list is an attribute of the session, so that's where I put it.
The problem is, a single connection can be associated with many sessions. The "channel" represents only one such association. It's actually a many-to-many relationship. A connection may be used by many sessions, and session may use many connections. If the code is assuming a 1:1 relationship, it's broken. Tom.