Re: [PATCH net] sctp: add wait_buf flag in asoc to avoid the peeloff and wait sndbuf race

2017-11-14 Thread Marcelo Ricardo Leitner
On Tue, Nov 14, 2017 at 10:06:36AM -0500, Neil Horman wrote: > On Tue, Nov 14, 2017 at 10:46:34PM +0800, Xin Long wrote: > > On Tue, Nov 14, 2017 at 10:31 PM, Neil Horman wrote: > > > On Mon, Nov 13, 2017 at 11:49:28PM +0800, Xin Long wrote: > > >> On Mon, Nov 13, 2017 at

Re: [PATCH net] sctp: add wait_buf flag in asoc to avoid the peeloff and wait sndbuf race

2017-11-14 Thread Neil Horman
On Tue, Nov 14, 2017 at 10:46:34PM +0800, Xin Long wrote: > On Tue, Nov 14, 2017 at 10:31 PM, Neil Horman wrote: > > On Mon, Nov 13, 2017 at 11:49:28PM +0800, Xin Long wrote: > >> On Mon, Nov 13, 2017 at 11:40 PM, Xin Long wrote: > >> > On Mon, Nov

Re: [PATCH net] sctp: add wait_buf flag in asoc to avoid the peeloff and wait sndbuf race

2017-11-14 Thread Xin Long
On Tue, Nov 14, 2017 at 10:31 PM, Neil Horman wrote: > On Mon, Nov 13, 2017 at 11:49:28PM +0800, Xin Long wrote: >> On Mon, Nov 13, 2017 at 11:40 PM, Xin Long wrote: >> > On Mon, Nov 13, 2017 at 11:23 PM, Neil Horman >> >

Re: [PATCH net] sctp: add wait_buf flag in asoc to avoid the peeloff and wait sndbuf race

2017-11-14 Thread Neil Horman
On Mon, Nov 13, 2017 at 11:49:28PM +0800, Xin Long wrote: > On Mon, Nov 13, 2017 at 11:40 PM, Xin Long wrote: > > On Mon, Nov 13, 2017 at 11:23 PM, Neil Horman wrote: > >> On Mon, Nov 13, 2017 at 01:47:58PM +0800, Xin Long wrote: > >>> Commit

Re: [PATCH net] sctp: add wait_buf flag in asoc to avoid the peeloff and wait sndbuf race

2017-11-13 Thread Xin Long
On Mon, Nov 13, 2017 at 11:40 PM, Xin Long wrote: > On Mon, Nov 13, 2017 at 11:23 PM, Neil Horman wrote: >> On Mon, Nov 13, 2017 at 01:47:58PM +0800, Xin Long wrote: >>> Commit dfcb9f4f99f1 ("sctp: deny peeloff operation on asocs with threads >>>

Re: [PATCH net] sctp: add wait_buf flag in asoc to avoid the peeloff and wait sndbuf race

2017-11-13 Thread Xin Long
On Mon, Nov 13, 2017 at 11:23 PM, Neil Horman wrote: > On Mon, Nov 13, 2017 at 01:47:58PM +0800, Xin Long wrote: >> Commit dfcb9f4f99f1 ("sctp: deny peeloff operation on asocs with threads >> sleeping on it") fixed the race between peeloff and wait sndbuf by >> checking

Re: [PATCH net] sctp: add wait_buf flag in asoc to avoid the peeloff and wait sndbuf race

2017-11-13 Thread Neil Horman
On Mon, Nov 13, 2017 at 01:47:58PM +0800, Xin Long wrote: > Commit dfcb9f4f99f1 ("sctp: deny peeloff operation on asocs with threads > sleeping on it") fixed the race between peeloff and wait sndbuf by > checking waitqueue_active(>wait) in sctp_do_peeloff(). > > But it actually doesn't work as

[PATCH net] sctp: add wait_buf flag in asoc to avoid the peeloff and wait sndbuf race

2017-11-12 Thread Xin Long
Commit dfcb9f4f99f1 ("sctp: deny peeloff operation on asocs with threads sleeping on it") fixed the race between peeloff and wait sndbuf by checking waitqueue_active(>wait) in sctp_do_peeloff(). But it actually doesn't work as even if waitqueue_active returns false the waiting sndbuf thread may