Skip to content

Commit

Permalink
Merged in bugfix/BSR-750 (pull request #421)
Browse files Browse the repository at this point in the history
BSR-750 fix potential hang when using send buffer in protocol c
  • Loading branch information
choisa authored and sungeun-kim committed Apr 6, 2021
2 parents 65f9b3d + 5c00be0 commit 93a7207
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bsr/bsr_send_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,10 @@ int send_buf_thread(void *p)

while (!buffering_attr->send_buf_kill_event) {
wait_event_timeout_ex(buffering_attr->ring_buf_event, test_bit(RING_BUF_EVENT, &buffering_attr->flags), timeo, ret);
if(test_bit(RING_BUF_EVENT, &buffering_attr->flags))
// BSR-750 fix potential hang when using send buffer in protocol c
// RING_BUF_EVENT flag setting race between send_buf_thread() and send_buf()
if(test_and_clear_bit(RING_BUF_EVENT, &buffering_attr->flags))
do_send(socket, buffering_attr->bab, socket->sk->sk_sndtimeo);
clear_bit(RING_BUF_EVENT, &buffering_attr->flags);
}

bsr_info(NO_OBJECT,"send_buf_killack_event!");
Expand Down

0 comments on commit 93a7207

Please sign in to comment.