]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
smb: client: smb: client: eliminate mid_flags field
authorWang Zhaolong <wangzhaolong@huaweicloud.com>
Mon, 4 Aug 2025 13:40:05 +0000 (21:40 +0800)
committerSteve French <stfrench@microsoft.com>
Tue, 5 Aug 2025 16:29:31 +0000 (11:29 -0500)
commit3fd8ec2fc93b009e5288b123d77292b8b1b9e1e7
treee30a79b62c7224124a4c52b05724a912938979d5
parent9bd42798d5bf87f56d229a27e40140df95ef743d
smb: client: smb: client: eliminate mid_flags field

This is step 3/4 of a patch series to fix mid_q_entry memory leaks
caused by race conditions in callback execution.

Replace the mid_flags bitmask with dedicated boolean fields to
simplify locking logic and improve code readability:

- Replace MID_DELETED with bool deleted_from_q
- Replace MID_WAIT_CANCELLED with bool wait_cancelled
- Remove mid_flags field entirely

The new boolean fields have clearer semantics:
- deleted_from_q: whether mid has been removed from pending_mid_q
- wait_cancelled: whether request was cancelled during wait

This change reduces memory usage (from 4-byte bitmask to 2 boolean
flags) and eliminates confusion about which lock protects which
flag bits, preparing for per-mid locking in the next patch.

Signed-off-by: Wang Zhaolong <wangzhaolong@huaweicloud.com>
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsglob.h
fs/smb/client/connect.c
fs/smb/client/smb2ops.c
fs/smb/client/transport.c