Skip to content

bpf, docs: Add note about type convention #1301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: bpf, docs: Add note about type convention
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465

@kernel-patches-bot
Copy link
Author

Master branch: 96f341a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 96f341a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: b6d2079
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: b6d2079
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: b6d2079
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: e39e739
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: 97c4090
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: 3a07dcf
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: 3a07dcf
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: 3a07dcf
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: 3a07dcf
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: b54a0d4
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: d9095f9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=689465
version: 1

@kernel-patches-bot kernel-patches-bot force-pushed the series/683109=>bpf-next branch 3 times, most recently from 3d7df0f to d6c49c4 Compare November 3, 2022 18:55
@kernel-patches-bot kernel-patches-bot force-pushed the series/683109=>bpf-next branch 3 times, most recently from 773aa96 to e6ba1ba Compare November 3, 2022 20:51
@kernel-patches-bot kernel-patches-bot force-pushed the series/683109=>bpf-next branch 15 times, most recently from 66565db to 708e313 Compare November 8, 2022 01:04
Kernel Patches Daemon and others added 5 commits November 7, 2022 17:15
Add note about type convention

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Acked-by: Stanislav Fomichev <sdf@google.com>
Fix modulo zero, division by zero, overflow, and underflow.
Also clarify how a negative immediate value is ued in unsigned division

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Use consistent names for the same field

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Explain helper functions

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
@danielocfb danielocfb closed this Nov 8, 2022
kernel-patches-daemon-bpf-rc bot pushed a commit that referenced this pull request Jul 1, 2025
Fix cifs_signal_cifsd_for_reconnect() to take the correct lock order
and prevent the following deadlock from happening

======================================================
WARNING: possible circular locking dependency detected
6.16.0-rc3-build2+ #1301 Tainted: G S      W
------------------------------------------------------
cifsd/6055 is trying to acquire lock:
ffff88810ad56038 (&tcp_ses->srv_lock){+.+.}-{3:3}, at: cifs_signal_cifsd_for_reconnect+0x134/0x200

but task is already holding lock:
ffff888119c64330 (&ret_buf->chan_lock){+.+.}-{3:3}, at: cifs_signal_cifsd_for_reconnect+0xcf/0x200

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-> #2 (&ret_buf->chan_lock){+.+.}-{3:3}:
       validate_chain+0x1cf/0x270
       __lock_acquire+0x60e/0x780
       lock_acquire.part.0+0xb4/0x1f0
       _raw_spin_lock+0x2f/0x40
       cifs_setup_session+0x81/0x4b0
       cifs_get_smb_ses+0x771/0x900
       cifs_mount_get_session+0x7e/0x170
       cifs_mount+0x92/0x2d0
       cifs_smb3_do_mount+0x161/0x460
       smb3_get_tree+0x55/0x90
       vfs_get_tree+0x46/0x180
       do_new_mount+0x1b0/0x2e0
       path_mount+0x6ee/0x740
       do_mount+0x98/0xe0
       __do_sys_mount+0x148/0x180
       do_syscall_64+0xa4/0x260
       entry_SYSCALL_64_after_hwframe+0x76/0x7e

-> #1 (&ret_buf->ses_lock){+.+.}-{3:3}:
       validate_chain+0x1cf/0x270
       __lock_acquire+0x60e/0x780
       lock_acquire.part.0+0xb4/0x1f0
       _raw_spin_lock+0x2f/0x40
       cifs_match_super+0x101/0x320
       sget+0xab/0x270
       cifs_smb3_do_mount+0x1e0/0x460
       smb3_get_tree+0x55/0x90
       vfs_get_tree+0x46/0x180
       do_new_mount+0x1b0/0x2e0
       path_mount+0x6ee/0x740
       do_mount+0x98/0xe0
       __do_sys_mount+0x148/0x180
       do_syscall_64+0xa4/0x260
       entry_SYSCALL_64_after_hwframe+0x76/0x7e

-> #0 (&tcp_ses->srv_lock){+.+.}-{3:3}:
       check_noncircular+0x95/0xc0
       check_prev_add+0x115/0x2f0
       validate_chain+0x1cf/0x270
       __lock_acquire+0x60e/0x780
       lock_acquire.part.0+0xb4/0x1f0
       _raw_spin_lock+0x2f/0x40
       cifs_signal_cifsd_for_reconnect+0x134/0x200
       __cifs_reconnect+0x8f/0x500
       cifs_handle_standard+0x112/0x280
       cifs_demultiplex_thread+0x64d/0xbc0
       kthread+0x2f7/0x310
       ret_from_fork+0x2a/0x230
       ret_from_fork_asm+0x1a/0x30

other info that might help us debug this:

Chain exists of:
  &tcp_ses->srv_lock --> &ret_buf->ses_lock --> &ret_buf->chan_lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&ret_buf->chan_lock);
                               lock(&ret_buf->ses_lock);
                               lock(&ret_buf->chan_lock);
  lock(&tcp_ses->srv_lock);

 *** DEADLOCK ***

3 locks held by cifsd/6055:
 #0: ffffffff857de398 (&cifs_tcp_ses_lock){+.+.}-{3:3}, at: cifs_signal_cifsd_for_reconnect+0x7b/0x200
 #1: ffff888119c64060 (&ret_buf->ses_lock){+.+.}-{3:3}, at: cifs_signal_cifsd_for_reconnect+0x9c/0x200
 #2: ffff888119c64330 (&ret_buf->chan_lock){+.+.}-{3:3}, at: cifs_signal_cifsd_for_reconnect+0xcf/0x200

Cc: linux-cifs@vger.kernel.org
Reported-by: David Howells <dhowells@redhat.com>
Fixes: d7d7a66 ("cifs: avoid use of global locks for high contention data")
Reviewed-by: David Howells <dhowells@redhat.com>
Tested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants