[PATCH][SMB client] two multichannel patches

Steve French smfrench at gmail.com
Thu Nov 16 19:10:58 UTC 2023


Any thoughts on these two multichannel patches from Shyam (attached)?

The first fixes: "cifs: account for primary channel in the interface
list" which fixes a refcounting issue in channel deallocation.  The
second fixes a lock ordering problem in the recent patch: "cifs:
handle when server stops supporting multichannel"

The code to handle the case of server disabling multichannel
was picking iface_lock with chan_lock held. This goes against
the lock ordering rules, as iface_lock is a higher order lock
(even if it isn't so obvious).

This change fixes the lock ordering by doing the following in
that order for each secondary channel:
1. store iface and server pointers in local variable
2. remove references to iface and server in channels
3. unlock chan_lock
4. lock iface_lock
5. dec ref count for iface
6. unlock iface_lock
7. dec ref count for server
8. lock chan_lock again

Let me know if any test feedback or reviews

-- 
Thanks,

Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-cifs-fix-leak-of-iface-for-primary-channel.patch
Type: text/x-patch
Size: 1401 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20231116/d78b565a/0001-cifs-fix-leak-of-iface-for-primary-channel.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-cifs-fix-lock-ordering-while-disabling-multichannel.patch
Type: text/x-patch
Size: 2573 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20231116/d78b565a/0002-cifs-fix-lock-ordering-while-disabling-multichannel.bin>


More information about the samba-technical mailing list