Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-22 Thread Michael Kerrisk (man-pages)
Hi Willy, On 08/22/2016 09:35 AM, Willy Tarreau wrote: > Hi Michael, > > On Mon, Aug 22, 2016 at 09:15:35AM +1200, Michael Kerrisk (man-pages) wrote: >> Hi Willy, >> >> Might you have a chance to further review of this patch series? >> It would be great if you could, since much of it touches

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-22 Thread Michael Kerrisk (man-pages)
Hi Willy, On 08/22/2016 09:35 AM, Willy Tarreau wrote: > Hi Michael, > > On Mon, Aug 22, 2016 at 09:15:35AM +1200, Michael Kerrisk (man-pages) wrote: >> Hi Willy, >> >> Might you have a chance to further review of this patch series? >> It would be great if you could, since much of it touches

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-21 Thread Willy Tarreau
Hi Michael, On Mon, Aug 22, 2016 at 09:15:35AM +1200, Michael Kerrisk (man-pages) wrote: > Hi Willy, > > Might you have a chance to further review of this patch series? > It would be great if you could, since much of it touches changes > made by you earlier. Well, all I did there was

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-21 Thread Willy Tarreau
Hi Michael, On Mon, Aug 22, 2016 at 09:15:35AM +1200, Michael Kerrisk (man-pages) wrote: > Hi Willy, > > Might you have a chance to further review of this patch series? > It would be great if you could, since much of it touches changes > made by you earlier. Well, all I did there was

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-21 Thread Michael Kerrisk (man-pages)
On 08/21/2016 10:33 PM, Vegard Nossum wrote: > On 08/20/2016 01:17 AM, Michael Kerrisk (man-pages) wrote: >> On 08/20/2016 08:56 AM, Michael Kerrisk (man-pages) wrote: >>> On 08/19/2016 08:30 PM, Vegard Nossum wrote: Is there any reason why we couldn't do the (size > pipe_max_size) check

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-21 Thread Michael Kerrisk (man-pages)
On 08/21/2016 10:33 PM, Vegard Nossum wrote: > On 08/20/2016 01:17 AM, Michael Kerrisk (man-pages) wrote: >> On 08/20/2016 08:56 AM, Michael Kerrisk (man-pages) wrote: >>> On 08/19/2016 08:30 PM, Vegard Nossum wrote: Is there any reason why we couldn't do the (size > pipe_max_size) check

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-21 Thread Michael Kerrisk (man-pages)
Hi Willy, Might you have a chance to further review of this patch series? It would be great if you could, since much of it touches changes made by you earlier. Thanks, Michael On 08/19/2016 05:48 PM, Willy Tarreau wrote: > Hi Michael, > > Since you're changing this code, it's probably worth

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-21 Thread Michael Kerrisk (man-pages)
Hi Willy, Might you have a chance to further review of this patch series? It would be great if you could, since much of it touches changes made by you earlier. Thanks, Michael On 08/19/2016 05:48 PM, Willy Tarreau wrote: > Hi Michael, > > Since you're changing this code, it's probably worth

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-21 Thread Vegard Nossum
On 08/20/2016 01:17 AM, Michael Kerrisk (man-pages) wrote: On 08/20/2016 08:56 AM, Michael Kerrisk (man-pages) wrote: On 08/19/2016 08:30 PM, Vegard Nossum wrote: Is there any reason why we couldn't do the (size > pipe_max_size) check before calling account_pipe_buffers()? No reason that I

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-21 Thread Vegard Nossum
On 08/20/2016 01:17 AM, Michael Kerrisk (man-pages) wrote: On 08/20/2016 08:56 AM, Michael Kerrisk (man-pages) wrote: On 08/19/2016 08:30 PM, Vegard Nossum wrote: Is there any reason why we couldn't do the (size > pipe_max_size) check before calling account_pipe_buffers()? No reason that I

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-19 Thread Michael Kerrisk (man-pages)
On 08/20/2016 08:56 AM, Michael Kerrisk (man-pages) wrote: > Hi Vegard, > > On 08/19/2016 08:30 PM, Vegard Nossum wrote: >> On 08/19/2016 07:25 AM, Michael Kerrisk (man-pages) wrote: >>> The limit checking in pipe_set_size() (used by fcntl(F_SETPIPE_SZ)) >>> has the following problems: >> [...]

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-19 Thread Michael Kerrisk (man-pages)
On 08/20/2016 08:56 AM, Michael Kerrisk (man-pages) wrote: > Hi Vegard, > > On 08/19/2016 08:30 PM, Vegard Nossum wrote: >> On 08/19/2016 07:25 AM, Michael Kerrisk (man-pages) wrote: >>> The limit checking in pipe_set_size() (used by fcntl(F_SETPIPE_SZ)) >>> has the following problems: >> [...]

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-19 Thread Michael Kerrisk (man-pages)
Hi Vegard, On 08/19/2016 08:30 PM, Vegard Nossum wrote: > On 08/19/2016 07:25 AM, Michael Kerrisk (man-pages) wrote: >> The limit checking in pipe_set_size() (used by fcntl(F_SETPIPE_SZ)) >> has the following problems: > [...] >> @@ -1030,6 +1030,7 @@ static long pipe_set_size(struct

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-19 Thread Michael Kerrisk (man-pages)
Hi Vegard, On 08/19/2016 08:30 PM, Vegard Nossum wrote: > On 08/19/2016 07:25 AM, Michael Kerrisk (man-pages) wrote: >> The limit checking in pipe_set_size() (used by fcntl(F_SETPIPE_SZ)) >> has the following problems: > [...] >> @@ -1030,6 +1030,7 @@ static long pipe_set_size(struct

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-19 Thread Michael Kerrisk (man-pages)
On 08/19/2016 05:48 PM, Willy Tarreau wrote: > Hi Michael, > > Since you're changing this code, it's probably worth swapping the size > check and capable() below to save a function call in the normal path : > > On Fri, Aug 19, 2016 at 05:25:35PM +1200, Michael Kerrisk (man-pages) wrote: >> +

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-19 Thread Michael Kerrisk (man-pages)
On 08/19/2016 05:48 PM, Willy Tarreau wrote: > Hi Michael, > > Since you're changing this code, it's probably worth swapping the size > check and capable() below to save a function call in the normal path : > > On Fri, Aug 19, 2016 at 05:25:35PM +1200, Michael Kerrisk (man-pages) wrote: >> +

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-19 Thread Vegard Nossum
On 08/19/2016 07:25 AM, Michael Kerrisk (man-pages) wrote: The limit checking in pipe_set_size() (used by fcntl(F_SETPIPE_SZ)) has the following problems: [...] @@ -1030,6 +1030,7 @@ static long pipe_set_size(struct pipe_inode_info *pipe, unsigned long arg) { struct pipe_buffer

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-19 Thread Vegard Nossum
On 08/19/2016 07:25 AM, Michael Kerrisk (man-pages) wrote: The limit checking in pipe_set_size() (used by fcntl(F_SETPIPE_SZ)) has the following problems: [...] @@ -1030,6 +1030,7 @@ static long pipe_set_size(struct pipe_inode_info *pipe, unsigned long arg) { struct pipe_buffer

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-18 Thread Willy Tarreau
Hi Michael, Since you're changing this code, it's probably worth swapping the size check and capable() below to save a function call in the normal path : On Fri, Aug 19, 2016 at 05:25:35PM +1200, Michael Kerrisk (man-pages) wrote: > + if (nr_pages > pipe->buffers) { > + if

Re: [PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-18 Thread Willy Tarreau
Hi Michael, Since you're changing this code, it's probably worth swapping the size check and capable() below to save a function call in the normal path : On Fri, Aug 19, 2016 at 05:25:35PM +1200, Michael Kerrisk (man-pages) wrote: > + if (nr_pages > pipe->buffers) { > + if

[PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-18 Thread Michael Kerrisk (man-pages)
The limit checking in pipe_set_size() (used by fcntl(F_SETPIPE_SZ)) has the following problems: (1) When increasing the pipe capacity, the checks against the limits in /proc/sys/fs/pipe-user-pages-{soft,hard} are made against existing consumption, and exclude the memory required for the

[PATCH 4/8] pipe: fix limit checking in pipe_set_size()

2016-08-18 Thread Michael Kerrisk (man-pages)
The limit checking in pipe_set_size() (used by fcntl(F_SETPIPE_SZ)) has the following problems: (1) When increasing the pipe capacity, the checks against the limits in /proc/sys/fs/pipe-user-pages-{soft,hard} are made against existing consumption, and exclude the memory required for the