mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 19:24:01 -04:00
mptcp: remove locking in mptcp_diag_fill_info
Problem is that listener iteration would call this from atomic context so this locking is not allowed. One way is to drop locks before calling the helper, but afaics the lock isn't really needed, all values are fetched via READ_ONCE(). Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
6b9ea5c81e
commit
e8887b7161
@@ -853,15 +853,11 @@ static int mptcp_getsockopt_first_sf_only(struct mptcp_sock *msk, int level, int
|
||||
|
||||
void mptcp_diag_fill_info(struct mptcp_sock *msk, struct mptcp_info *info)
|
||||
{
|
||||
struct sock *sk = &msk->sk.icsk_inet.sk;
|
||||
u32 flags = 0;
|
||||
bool slow;
|
||||
u8 val;
|
||||
|
||||
memset(info, 0, sizeof(*info));
|
||||
|
||||
slow = lock_sock_fast(sk);
|
||||
|
||||
info->mptcpi_subflows = READ_ONCE(msk->pm.subflows);
|
||||
info->mptcpi_add_addr_signal = READ_ONCE(msk->pm.add_addr_signaled);
|
||||
info->mptcpi_add_addr_accepted = READ_ONCE(msk->pm.add_addr_accepted);
|
||||
@@ -882,8 +878,6 @@ void mptcp_diag_fill_info(struct mptcp_sock *msk, struct mptcp_info *info)
|
||||
info->mptcpi_snd_una = READ_ONCE(msk->snd_una);
|
||||
info->mptcpi_rcv_nxt = READ_ONCE(msk->ack_seq);
|
||||
info->mptcpi_csum_enabled = READ_ONCE(msk->csum_enabled);
|
||||
|
||||
unlock_sock_fast(sk, slow);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mptcp_diag_fill_info);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user