[Devel] [PATCH rh7 v2] netlink: Don't manipulate @sk_peek_off if data fetching failed

2016-12-22 Thread Cyrill Gorcunov
On Fri, Dec 23, 2016 at 09:59:28AM +0300, Cyrill Gorcunov wrote: > On Thu, Dec 22, 2016 at 04:45:10PM -0800, Andrey Vagin wrote: > > > > Actually, this patch breaks the old behaviour even when MSG_PEEK isn't set. > > > > I was thinking a bit more and I don't understand why it is a problem. If >

Re: [Devel] [PATCH rh7] netlink: Don't manipulate @sk_peek_off if data fetching failed

2016-12-22 Thread Cyrill Gorcunov
On Thu, Dec 22, 2016 at 04:45:10PM -0800, Andrey Vagin wrote: > > Actually, this patch breaks the old behaviour even when MSG_PEEK isn't set. > > I was thinking a bit more and I don't understand why it is a problem. If > we can't fill a buffer, an error will be returned and a user will be able >

Re: [Devel] [PATCH rh7] netlink: Don't manipulate @sk_peek_off if data fetching failed

2016-12-22 Thread Andrey Vagin
On Thu, Dec 22, 2016 at 04:12:13PM -0800, Andrey Vagin wrote: > On Thu, Dec 22, 2016 at 03:34:15PM -0800, Andrey Vagin wrote: > > On Thu, Dec 22, 2016 at 06:41:42PM +0300, Cyrill Gorcunov wrote: > > > When skb_copy_datagram_iovec called to fetch queued data > > > it may fail with EFAULT and if

Re: [Devel] [PATCH rh7] netlink: Don't manipulate @sk_peek_off if data fetching failed

2016-12-22 Thread Andrey Vagin
On Thu, Dec 22, 2016 at 03:34:15PM -0800, Andrey Vagin wrote: > On Thu, Dec 22, 2016 at 06:41:42PM +0300, Cyrill Gorcunov wrote: > > When skb_copy_datagram_iovec called to fetch queued data > > it may fail with EFAULT and if MSG_PEEK set by a caller > > the position get advanced even if data

Re: [Devel] [PATCH rh7] netlink: Don't manipulate @sk_peek_off if data fetching failed

2016-12-22 Thread Andrey Vagin
On Thu, Dec 22, 2016 at 06:41:42PM +0300, Cyrill Gorcunov wrote: > When skb_copy_datagram_iovec called to fetch queued data > it may fail with EFAULT and if MSG_PEEK set by a caller > the position get advanced even if data hasn't been read. > So we might loose data bits here on subsequent recvmsg

[Devel] [PATCH rh7] netlink: Don't manipulate @sk_peek_off if data fetching failed

2016-12-22 Thread Cyrill Gorcunov
When skb_copy_datagram_iovec called to fetch queued data it may fail with EFAULT and if MSG_PEEK set by a caller the position get advanced even if data hasn't been read. So we might loose data bits here on subsequent recvmsg calls. Instead lets exit early with error. In sake of

[Devel] [PATCH rh7] fs/fadvise: introduce FADV_DEACTIVATE flag

2016-12-22 Thread Andrey Ryabinin
FADV_DEACTIVATE advises kernel to move file pages from active to inactive list. https://jira.sw.ru/browse/PSBM-57915 Signed-off-by: Andrey Ryabinin --- include/uapi/linux/fadvise.h | 1 + mm/fadvise.c | 43 +++ 2