lkml.org 
[lkml]   [2022]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] rxrpc: fix bad unlock balance in rxrpc_do_sendmsg
On Mon, Aug 22, 2022 at 09:04:14PM +0800, Hawkins Jiawei wrote:
> static int rxrpc_send_data(struct rxrpc_sock *rx,
> struct rxrpc_call *call,
> struct msghdr *msg, size_t len,
> - rxrpc_notify_end_tx_t notify_end_tx)
> + rxrpc_notify_end_tx_t notify_end_tx,
> + bool *holding_mutex)
> {
> struct rxrpc_skb_priv *sp;
> struct sk_buff *skb;
> @@ -299,6 +318,13 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
> bool more;
> int ret, copied;
>
> + /*
> + * The caller holds the call->user_mutex when calls
> + * rxrpc_send_data(), so initial it with True
> + */
> + if (holding_mutex)
> + *holding_mutex = true;

Don't make this optional. All callers have to care if we dropped the
lock.

regards,
dan carpenter

\
 
 \ /
  Last update: 2022-08-22 15:47    [W:0.144 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site