[Devel] [PATCH] target: rename user_helper back to alua_user_helper

2018-07-16 Thread Andrei Vagin
After the last rebase, alua_user_helper was renamed into user_helper by mistake. https://pmc.acronis.com/browse/VSTOR-12238 Signed-off-by: Andrei Vagin --- drivers/target/target_core_configfs.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/target

[Devel] [PATCH rh7] target: use to_stat_tgt_port() to handle files in scsi_tgt_port/

2018-08-09 Thread Andrei Vagin
Currently we use to_stat_port(), but it has to be used only for files in scsi_port/. https://pmc.acronis.com/browse/VSTOR-13021 Signed-off-by: Andrei Vagin --- drivers/target/target_core_stat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/target

Re: [Devel] [PATCH rh7 2/4] net: Skip allocation of conntrack if there are no rules

2016-09-07 Thread Andrei Vagin
On Tue, Sep 06, 2016 at 09:31:33AM +0300, Kirill Tkhai wrote: > HW node may have many CTs, which are not having conntrack > users. Do not allocate them to save resources and decrease > performance penalty. > > Next two patches will actually mark conntrack users. > > https://jira.sw.ru/browse/PSBM

Re: [Devel] [PATCH rh7 v2 0/3] Create conntrack structures only if they are really needed

2016-09-13 Thread Andrei Vagin
On Mon, Sep 12, 2016 at 02:37:38PM +0300, Kirill Tkhai wrote: > Allocate conntracks only after there was a rule, which uses them. > > v2: Allow after there is a rule and never prohibit. Reviewed-by: Andrei Vagin > --- > > Kirill Tkhai (3): > net: Primitiv

Re: [Devel] [PATCH rh7 1/3] net: Add ipv6 statistics cpu notifier

2016-09-13 Thread Andrei Vagin
Reviewed-by: Andrei Vagin On Thu, Sep 08, 2016 at 03:06:40PM +0300, Konstantin Khorenko wrote: > Andrey, please review the patchset. > > -- > Best regards, > > Konstantin Khorenko, > Virtuozzo Linux Kernel Team > > On 08/25/2016 04:37 PM, Kirill Tkhai wrote: >

Re: [Devel] [PATCH rh7] net: nf_synproxy: Direct conntrack allocation

2016-09-16 Thread Andrei Vagin
ack (and do not > allow conntracks from pernet init). > > https://jira.sw.ru/browse/PSBM-52218 > Acked-by: Andrei Vagin > Signed-off-by: Kirill Tkhai > --- > include/net/netfilter/nf_conntrack.h |5 + > net/netfilter/nf_conntrack_core.c| 11 ++--

Re: [Devel] [PATCH RH7 1/2] net/vxlan: enable support and autoload in a container

2016-11-22 Thread Andrei Vagin
e lookup, but in > vxlan_xmit_one->ip_route_output_key->...->__ip_route_output_key > we use first(creation) namespace to lookup device and probably > will fail. So all fdb configuration should go before moving to > ns. Same is in mainstream AFAICS. > > https://jira.sw.

Re: [Devel] [PATCH 3/3] netfilter: nfnetlink: fix insufficient validation in nfnetlink_bind

2016-11-28 Thread Andrei Vagin
74) > > [ 180.209849] __ubsan_handle_out_of_bounds (lib/ubsan.c:400) > > [ 180.210512] nfnetlink_bind (net/netfilter/nfnetlink.c:467) > > [ 180.210986] netlink_bind (net/netlink/af_netlink.c:1483) > > [ 180.211495] SYSC_bind (net/socket.c:1541) > > > > Moreov

Re: [Devel] [PATCH] files: Fix crossing unused and service fds of shared fd tables

2017-06-27 Thread Andrei Vagin
You forgot to send this to c...@openvz.org On Wed, Jun 21, 2017 at 03:23:19PM +0300, Kirill Tkhai wrote: > service_fd_id is id of a specific task, while other tasks > in shared fd table group may have bigger id numbers. > In this case given unused fd intersects with service fds > of such tasks. Th

Re: [Devel] [PATCH] mounts: support only shared NFS mounts in inits mount namespace

2017-07-03 Thread Andrei Vagin
On Thu, Jun 29, 2017 at 03:14:19PM +0300, Stanislav Kinsburskiy wrote: > The intention of this patch is to define different NFS mount cases and forbid > most ot them. > The reason behind this is that the only mount point we can migrate right now > is: > 1) created in init mount namespace > 2) share

Re: [Devel] [PATCH v2] mounts: support only shared NFS mounts in inits mount namespace

2017-07-11 Thread Andrei Vagin
at all bind-mounts are in the same shared group for slave > mount. We need this to make sure, that all such mounts will be propagated > correctly. > Reviewed-by: Andrei Vagin Here is one inline comment > Signed-off-by: Stanislav Kinsburskiy > --- > criu/mount.c | 79 >

Re: [Devel] [CRIU] [PATCH] vz7: files -- Don't access value from stack in outer contex

2017-07-12 Thread Andrei Vagin
Do we need it for the upstream criu? Could you send a patch for it? On Wed, Jul 12, 2017 at 05:41:38PM +0300, Cyrill Gorcunov wrote: > The struct fd_link link allocated in inner context might be > freed before dump call (depending on compiler), instead > use a safer approach. > > Signed-off-by: C

[Devel] [PATCH] ploop: show ino and sdev for ploop images in sysfs

2017-07-13 Thread Andrei Vagin
404 Signed-off-by: Andrei Vagin --- drivers/block/ploop/sysfs.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/block/ploop/sysfs.c b/drivers/block/ploop/sysfs.c index 0395ccf..acd18ff 100644 --- a/drivers/block/ploop/sysfs.c +++ b/drivers/block/ploop/sysfs.c

[Devel] [PATCH] kernel: call task_work_run() before exit_task_namespaces()

2017-07-18 Thread Andrei Vagin
From: Andrei Vagin task_work_run() has to be called before exit_task_namespaces(), because fuse_abort_conn() is called from __fput(). If it will not be executed, we can hang in request_wait_answer(). We have seen this situation when a process was the last member of a mount namespace and the

Re: [Devel] [PATCH] kernel: call task_work_run() before exit_task_namespaces()

2017-07-19 Thread Andrei Vagin
On Wed, Jul 19, 2017 at 08:04:22PM +0300, Andrey Ryabinin wrote: > > > On 07/19/2017 04:14 AM, Andrei Vagin wrote: > > From: Andrei Vagin > > > > task_work_run() has to be called before exit_task_namespaces(), > > because fuse_abort_conn() is called fro

[Devel] [PATCH criu] page-xfer: handle a case when splice returns zero

2017-07-19 Thread Andrei Vagin
From: Andrei Vagin A return value of 0 means end of input, so we need to stop reading from this descriptor. https://jira.sw.ru/browse/PSBM-68732 Cc: Dmitry Safonov Signed-off-by: Andrei Vagin --- criu/page-xfer.c | 13 + 1 file changed, 13 insertions(+) diff --git a/criu/page

Re: [Devel] [PATCH 3/3] proc-net: virtualize all the network proc entries

2017-07-20 Thread Andrei Vagin
On Thu, Jul 20, 2017 at 08:47:58PM +0400, Stanislav Kinsburskiy wrote: > Use proc_net_create() and proc_net_create_data() for all the per-net dentries. > We need this to expose per-net sysfs dentries once commit > e5990221bde54d757a5b5d85e81b2535064570ad is reverted Could you give more details? Do

Re: [Devel] [PATCH 3/3] net: do iptables restore in ve0

2017-07-24 Thread Andrei Vagin
On Fri, Jul 21, 2017 at 10:42:03AM +0300, Stanislav Kinsburskiy wrote: > This is needed to be able to restore container vwith disabled netfilter. > When netfilter is disabled, its denties and operations are forbiddedn in CTs > VE. > Thus we need to switch to VE#0. This is done by forking a child, w

Re: [Devel] [PATCH 3/3] net: do iptables restore in ve0

2017-07-24 Thread Andrei Vagin
On Mon, Jul 24, 2017 at 06:38:15PM +0300, Cyrill Gorcunov wrote: > On Mon, Jul 24, 2017 at 08:34:52AM -0700, Andrei Vagin wrote: > > > > > > -static int iptables_tool_restore(char *def_cmd, int fdin) > > > +static int __iptables_tool_restore(char *def_cmd, int fdin

Re: [Devel] [PATCH 3/3] net: do iptables restore in ve0

2017-07-24 Thread Andrei Vagin
On Mon, Jul 24, 2017 at 06:38:15PM +0300, Cyrill Gorcunov wrote: > On Mon, Jul 24, 2017 at 08:34:52AM -0700, Andrei Vagin wrote: > > > > > > -static int iptables_tool_restore(char *def_cmd, int fdin) > > > +static int __iptables_tool_restore(char *def_cmd, int fdin

Re: [Devel] [PATCH] mounts: support NFS bind-mounts in the same shared group

2017-07-24 Thread Andrei Vagin
On Wed, Jul 19, 2017 at 10:43:26AM +0300, Stanislav Kinsburskiy wrote: > Initial patch was supporting only slave mounts as bind-mounts. > > https://jira.sw.ru/browse/PSBM-68663 > Reviewed-by: Andrei Vagin > Signed-off-by: Stanislav Kinsburskiy > --- > criu/mount.c |

Re: [Devel] [PATCH 2/3] net: iptables_tool_{dump, restore} helpers introduced

2017-07-24 Thread Andrei Vagin
On Fri, Jul 21, 2017 at 10:41:58AM +0300, Stanislav Kinsburskiy wrote: > A couple of simple helpers to destinguish between iptables dump and restore. > Will be useful later, when iptables restore will happen in VE#0. > > Signed-off-by: Stanislav Kinsburskiy > --- > criu/net.c | 19

[Devel] [PATCH] ve: allow to do anything from init_user_ns

2017-07-24 Thread Andrei Vagin
From: Andrei Vagin current_user_ns_initial() is used to restrict operations, which are allowed in a ve initial userns, but aren't allowed in sub-user-namespaces. But now this function doesn't take into account init_user_ns. init user_ns is a root item in the hierarchy of user namespa

Re: [Devel] [PATCH] ve: allow to do anything from init_user_ns

2017-07-24 Thread Andrei Vagin
On Mon, Jul 24, 2017 at 11:55:55PM +0300, Andrei Vagin wrote: > From: Andrei Vagin > > current_user_ns_initial() is used to restrict operations, > which are allowed in a ve initial userns, but aren't allowed > in sub-user-namespaces. But now this function doesn't take &g

Re: [Devel] [PATCH] ve: allow to do anything from init_user_ns

2017-07-25 Thread Andrei Vagin
userns from a mount namespace. Each mount namespace has a link to a userns where it was created. > > -- > Best regards, > > Konstantin Khorenko, > Virtuozzo Linux Kernel Team > > On 07/24/2017 11:55 PM, Andrei Vagin wrote: > > From: Andrei Vagin > > >

[Devel] [PATCH] Log into /var/log/mesages large ghost files dumps

2017-08-04 Thread Andrei Vagin
From: Andrei Vagin Introduce an internal CRIU limit (10Mb) and write a message to syslog. This message is easily grep-able, so some time later we can grep our reports from customers and find all those warnings and analyze them. https://jira.sw.ru/browse/PSBM-68320 --- criu/Makefile.crtools

[Devel] [PATCH] kernel: call task_work_run() before exit_task_namespaces()

2017-08-07 Thread Andrei Vagin
From: Andrei Vagin This patch solves a problem for a following case. We have a container (a group of processes in pid and mount namespaces) with a fuse mount. An init process exits and the kernel kills all process in its pid namespace. There is a fuse daemon, which handle the fuse mount

Re: [Devel] [PATCH] zdtm: fix package memory allocation in autofs.c

2017-09-08 Thread Andrei Vagin
On Thu, Aug 31, 2017 at 12:10:40PM +0300, Stanislav Kinsburskiy wrote: > Plus some cleanup. Do we need this patch for the upstream criu? Could you send it to the criu mailing list? > > https://jira.sw.ru/browse/PSBM-71078 > > Signed-off-by: Stanislav Kinsburskiy > --- > test/zdtm/static/autof

[Devel] [PATCH rh7] ve: remove ve->root_path

2017-09-17 Thread Andrei Vagin
ssible to umount it, when a container changes its root (pivot_root()) https://jira.sw.ru/browse/PSBM-71414 Reported-by: Vasily Averin Cc: Vasily Averin Signed-off-by: Andrei Vagin --- fs/namei.c | 6 -- include/linux/ve.h | 3 --- kernel/ve/ve.c | 4 kernel/ve/veowner.

Re: [Devel] [PATCH] ve: don't call shutdown hook for now

2017-10-02 Thread Andrei Vagin
On Mon, Oct 02, 2017 at 06:47:19PM +0400, Stanislav Kinsburskiy wrote: > This hook is needed only for releaseing venet IP address early (thus allowing > to restart container with the same IP faster). > But mount are destroyed asynchroniosly, and thus NFS mount can be destroyed > after IP address is

[Devel] [PATCH criu] libsoccr: ignore data in a sent queue, if a connect is closed

2017-10-05 Thread Andrei Vagin
From: Andrei Vagin If a connection was reseted, it can have some data in a sent queue, a use can't read this data, so we can ignore them too. https://jira.sw.ru/browse/PSBM-67026 Signed-off-by: Andrei Vagin --- soccr/soccr.c | 12 1 file changed, 12 insertions(+) diff --

[Devel] [PATCH rh7] netfilter: Allow xt_owner in any user namespace

2017-10-13 Thread Andrei Vagin
derman" Signed-off-by: Kevin Cernekee Signed-off-by: Pablo Neira Ayuso Signed-off-by: Andrei Vagin --- net/netfilter/xt_owner.c | 41 +++-- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/net/netfilter/xt_owner.c b/net/netfilter/xt_owner.c index

Re: [Devel] [PATCH rh7] netfilter: Allow xt_owner in any user namespace

2017-10-16 Thread Andrei Vagin
n an error. > > -- > Best regards, > > Konstantin Khorenko, > Virtuozzo Linux Kernel Team > > On 10/14/2017 02:20 AM, Andrei Vagin wrote: > > From: "Eric W. Biederman" > > > > ML: 9847371a84b0be330f4bc4aaa98904101ee8573d > > https://

Re: [Devel] [PATCH rh7] netfilter: Allow xt_owner in any user namespace

2017-10-16 Thread Andrei Vagin
On Mon, Oct 16, 2017 at 05:50:38PM +0200, Stanislav Kinsburskiy wrote: > Well, patch looks ok. > But shouldn't all the ve_init_user_ns() replaced by the par->net? This patch does this. > > 14.10.2017 01:20, Andrei Vagin пишет: > > From: "

[Devel] [PATCH criu] net: execute iptables-restore in a target network namespace

2017-10-18 Thread Andrei Vagin
otherwise the kernel can return an error, one of these checks is in xt_owner.c:owner_check(): ... if ((info->match & (XT_OWNER_UID|XT_OWNER_GID)) && (current_user_ns() != net->user_ns)) return -EINVAL; ... https://jira.sw.ru/browse/PSBM-75531 --- criu/net.c | 7

Re: [Devel] [PATCH criu 1/3] mount: Add export_mnt_ns_roots helper

2017-10-23 Thread Andrei Vagin
On Thu, Oct 12, 2017 at 10:21:29AM +0300, Cyrill Gorcunov wrote: > This helper produce space separated list of > mount namespace roots which can be exported > then into environment variable. > > https://jira.sw.ru/browse/PSBM-71861 > > Signed-off-by: Cyrill Gorcunov > --- > criu/include/mount.h

Re: [Devel] [PATCH criu 1/3] mount: Add export_mnt_ns_roots helper

2017-10-23 Thread Andrei Vagin
On Thu, Oct 12, 2017 at 10:21:29AM +0300, Cyrill Gorcunov wrote: > This helper produce space separated list of > mount namespace roots which can be exported > then into environment variable. > > https://jira.sw.ru/browse/PSBM-71861 > > Signed-off-by: Cyrill Gorcunov > --- > criu/include/mount.h

Re: [Devel] [PATCH criu 2/3] action-scripts: Export mount namespace roots via CRIU_MNT_NS_ROOTS

2017-10-23 Thread Andrei Vagin
On Thu, Oct 12, 2017 at 10:21:30AM +0300, Cyrill Gorcunov wrote: > In particular we need to process filesystem to restore > ploop device migration, thus export roots and the script > can use CRTOOLS_INIT_PID together with nsenter to step > into prepared file systems and whatever needed. > > https:

Re: [Devel] [PATCH libvzctl 3/3] scripts: Tune up ploop links on post-setup-namespaces stage

2017-10-23 Thread Andrei Vagin
On Thu, Oct 12, 2017 at 10:21:31AM +0300, Cyrill Gorcunov wrote: > From: Cyrill Gorcunov > > The restore of ploop device is a bit tricky: its major/minor > is not a constant but allocated dynamicaly by the kernel > driver. Thus we may have a situation when /dev/ploopXX > points for some obsolete

Re: [Devel] [PATCH rh7] fs/nfs: don't use delayed unmount for nfs.

2017-10-27 Thread Andrei Vagin
On Fri, Oct 27, 2017 at 06:31:18PM +0300, Andrey Ryabinin wrote: > Delayed nfs unmount causes too much PITA. We must destroy VENET ip after > unmount, but in that case we can't reuse that IP on restarted container > because it migh be still alive. > > So let's just unmount NFS synchronously and de

[Devel] [PATCH] sk-inet: restore a value of SO_REUSEADDR

2017-10-30 Thread Andrei Vagin
From: Andrei Vagin The SO_REUSEADDR option allows multiple sockets on the same host to bind to the same port. This option has to ve restored when all sockets are bound to a port. The same logic is already used to restore SO_REUSEADDR. https://jira.sw.ru/browse/PSBM-75515 Signed-off-by: Andrei

[Devel] [PATCH 1/2 criu] soccr: c/r ipv6 sockets which handles ipv4 connections

2017-11-01 Thread Andrei Vagin
From: Andrei Vagin IPv6 listening sockets can accept both ipv4 and ipv6 connections, in both cases a family of an accepted socket will be AF_INET6. But we have to send tcp packets accoding with a connection type. grep Error (00.002320) 53

[Devel] [PATCH 2/2 criu] test: check ipv6 sockets which handle ipv4 connections

2017-11-01 Thread Andrei Vagin
From: Andrei Vagin A server socket is created with AF_INET6, but a client socket is create with AF_INET. Signed-off-by: Andrei Vagin --- test/zdtm/static/Makefile | 18 ++ test/zdtm/static/socket-tcp-close-wait.c | 9 +++-- test/zdtm/static

Re: [Devel] [PATCH] vz7: service: Allow keep_open flag for a WAIT_PID command #PSBM-58198

2017-11-10 Thread Andrei Vagin
Acked-by: Andrei Vagin On Fri, Nov 10, 2017 at 10:45:55AM +, Pavel Vokhmyanin wrote: > WAIT_PID rpc command is necessary to wait on a page server and retrieve > its exit code. Keep_open flag is essential for this command - we need > RPC server to keep running after processing WA

[Devel] [PATCH p.haul] Increate a limit for opened files for criu pre-dump and page-server

2017-11-13 Thread Andrei Vagin
table-s are allocated for the initial limit, so they eat much more kernel memory then they have to. https://jira.sw.ru/browse/PSBM-67194 Cc: Cyrill Gorcunov Cc: Pavel Vokhmyanin Signed-off-by: Andrei Vagin --- phaul/criu_api.py | 8 1 file changed, 8 insertions(+) diff --git a/

Re: [Devel] [PATCH] nfs: abort delegation in dying VE

2017-11-15 Thread Andrei Vagin
On Wed, Nov 15, 2017 at 07:55:02PM +0300, Kirill Tkhai wrote: > On 15.11.2017 19:50, Stanislav Kinsburskiy wrote: > > Don't queue delegation request, if ve init is exiting. > > > > https://jira.sw.ru/browse/PSBM-77061 > > > > Inspired-by: Kirill Tkhai > > Signed-off-by: Stanislav Kinsburskiy >

Re: [Devel] [PATCH] nfs: abort delegation in dying VE

2017-11-15 Thread Andrei Vagin
On Wed, Nov 15, 2017 at 11:41:00AM -0800, Andrei Vagin wrote: > On Wed, Nov 15, 2017 at 07:55:02PM +0300, Kirill Tkhai wrote: > > On 15.11.2017 19:50, Stanislav Kinsburskiy wrote: > > > Don't queue delegation request, if ve init is exiting. > > > > >

[Devel] [PATCH] criu: remap soccr log levels to criu levels

2017-11-21 Thread Andrei Vagin
criu and soccr has different values for log levels, so someone has to remap them. Cc: Cyrill Gorcunov Reported-by: Cyrill Gorcunov Signed-off-by: Andrei Vagin --- criu/crtools.c | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/criu/crtools.c b/criu

[Devel] [PATCH] criu: print a criu version with the info level

2017-11-21 Thread Andrei Vagin
We always ask users what version of criu they use to investigate a problem, so it better to have it in a log. Signed-off-by: Andrei Vagin --- criu/crtools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/criu/crtools.c b/criu/crtools.c index 741b7b2eb..de74e483c 100644

Re: [Devel] [PATCH 1/3] target: Move scsi_port_stats from se_port to se_lun

2017-12-11 Thread Andrei Vagin
I haven't got the second patch and it isn't listed in the mailing list archive: https://lists.openvz.org/pipermail/devel/2017-December/thread.html On Mon, Dec 11, 2017 at 08:53:03PM +0300, Andrey Grafin wrote: > This patch moves scsi_port_stats from se_port to se_lun > and changes stats counters t

[Devel] [PATCH] target: don't call an unmap callback if a range length is zero

2017-12-13 Thread Andrei Vagin
If a length of a range is zero, it means there is nothing to unmap and we can skip this range. Here is one more reason, why we have to skip such ranges. An unmap callback calls file_operations->fallocate(), but the man page for the fallocate syscall says that fallocate(fd, mode, offset, let) retu

Re: [Devel] [PATCH 1/7] spfs: introduce request_spfs_mngr_sock)() helper

2017-12-20 Thread Andrei Vagin
On Wed, Dec 20, 2017 at 07:06:51PM +0300, Stanislav Kinsburskiy wrote: > This generic helper will be responsible for both SPFS manager start via > usernsd and socket request. > > Signed-off-by: Stanislav Kinsburskiy > --- > criu/spfs.c | 45 ++--- > 1 fi

Re: [Devel] [PATCH 6/7] spfs: return duplicated socket from usernsd

2017-12-20 Thread Andrei Vagin
On Wed, Dec 20, 2017 at 07:07:16PM +0300, Stanislav Kinsburskiy wrote: > Usernsd closes socket when sent. > > https://jira.sw.ru/browse/PSBM-79462 > > Signed-off-by: Stanislav Kinsburskiy > --- > criu/spfs.c | 10 +- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/c

Re: [Devel] [PATCH v2 0/7] spfs: duplicate socket before sending it from usernsd

2017-12-21 Thread Andrei Vagin
Reviewed-by: Andrei Vagin On Thu, Dec 21, 2017 at 02:06:53PM +0300, Stanislav Kinsburskiy wrote: > Usernds closes socket once it was sent. > So, id should be duplicated before sending, if the socket is expected to be > send multiple times. > > https://jira.sw.ru/browse/PSBM

Re: [Devel] [PATCH 3/4] target: add histogram for LUN statistics

2017-12-27 Thread Andrei Vagin
On Wed, Dec 20, 2017 at 01:10:13PM +0300, Andrey Grafin wrote: > This patch adds histogram statistics to scsi_ports_stats. > Histogram can be obtained and configured via config_fs. > Histogram measurement unit is usec. > > Histogram usage: > 1. Configure histogram '| 1 ms | 10 ms | 15 ms | largest

Re: [Devel] [PATCH 1/4] target: Move scsi_port_stats from se_port to se_lun

2017-12-27 Thread Andrei Vagin
For all patches: Acked-by: Andrei Vagin On Wed, Dec 20, 2017 at 01:10:11PM +0300, Andrey Grafin wrote: > This patch moves scsi_port_stats from se_port to se_lun > and changes stats counters type to atomic_long_t. > > This changes remove the next superfluous actions in collecting st

[Devel] [PATCH] target: add an user-mode helper to handle changes of a group state

2018-01-16 Thread Andrei Vagin
elper: $ cd /sys/kernel/config/target/core/ $ echo -n /usr/sbin/vstrorage_iscsi_alua > \ fileio_1/iqn.2014-06.com.vstorage:test-2/alua/default_tg_pt_gp/user_helper $ echo -n - > fileio_1/iqn.2014-06.com.vstorage:test-2/alua/default_tg_pt_gp/user_helper Signed-off-by: Andrei Vagin -

[Devel] [PATCH] target: pass a device name to an alua user helper

2018-01-29 Thread Andrei Vagin
Now the helper is executed with this list of arguments: TG_PT_Group ID prev_state new_state {explicit/implicit} dev_name For exmaple: default_tg_pt_gp 0 Active/Optimized Standby explicit iqn.2014-06.com.vstorage:test-2 Signed-off-by: Andrei Vagin --- drivers/target/target_core_alua.c | 15

[Devel] [PATCH] target: pass a device name to an alua user helper

2018-01-29 Thread Andrei Vagin
Now the helper is executed with this list of arguments: TG_PT_Group ID prev_state new_state {explicit/implicit} dev_name For exmaple: default_tg_pt_gp 0 Active/Optimized Standby explicit iqn.2014-06.com.vstorage:test-2 Signed-off-by: Andrei Vagin --- drivers/target/target_core_alua.c | 15

[Devel] [PATCH 1/2] target: move alua user helper from group to device

2018-01-31 Thread Andrei Vagin
fig/target/core/iblock_0/iqn.2014-06.com.vstorage\:test-1/alua_user_helper Signed-off-by: Andrei Vagin --- drivers/target/target_core_alua.c | 49 +++ drivers/target/target_core_alua.h | 4 +-- drivers/target/target_core_configfs.c |

[Devel] [PATCH 2/2] target: call alua helper before reporting group states to initiator

2018-01-31 Thread Andrei Vagin
An alua helper is called with the same set of arguments as it is called when a group state is changed, but the fourth argument will be "Read". For example: default_tg_pt_gp 0 Active/Optimized Read implicit iqn.2014-06.com.vstorage:test-1 Signed-off-by: Andrei Vagin --- driv

[Devel] [PATCH 1/2] fuse: add a new async operation to unmap regions

2018-02-05 Thread Andrei Vagin
like the write command. This patch adds a new async command IOCB_CMD_UNMAP_ITER, which sends fallocate(FALLOC_FL_PUNCH_HOLE) to a fuse user daemon. Signed-off-by: Andrei Vagin --- fs/aio.c | 1 + fs/fuse/file.c | 63

[Devel] [PATCH 2/2] ploop: handle discard requests via fallocate

2018-02-05 Thread Andrei Vagin
system allows to execute fallocate asynchroniously. * pio_direct (ext4) requires that all blocks in image were allocated and initalized. * The ploop1 format requires more changes to hanlde an index table. Signed-off-by: Andrei Vagin --- drivers/block/ploop/dev.c| 19

Re: [Devel] [PATCH 1/2] fuse: add a new async operation to unmap regions

2018-02-06 Thread Andrei Vagin
sv $path/root fout3="$(filefrag -sv $path/root | wc -l)" if [ "$fout2" -le "$fout3" ]; then echo FAIL exit 1 fi ploop umount -d $dev rm -rf $path 5. Known issues Works only for raw images on a fuse file system (vstorage) 7. Feature owner Andrei Vagin (av

[Devel] [PATCH] ploop: don't forget to dec preq->io_count on a error path

2018-02-14 Thread Andrei Vagin
[This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing] preq->io_count is incrimented before calling aio_kernel_submit() and it is decrimented in kaio_rw_aio_complete(). But if aio_kernel_submit() failed , pre

[Devel] [PATCH 1/4] fuse: add a new async operation to unmap regions

2018-02-14 Thread Andrei Vagin
-off-by: Andrei Vagin --- fs/aio.c | 1 + fs/fuse/file.c | 65 ++-- fs/fuse/fuse_i.h | 3 ++ include/uapi/linux/aio_abi.h | 1 + 4 files changed, 62 insertions(+), 8 deletions(-) diff --git a/fs/aio.c b/fs

[Devel] [PATCH 2/4] ploop: handle discard requests via fallocate

2018-02-14 Thread Andrei Vagin
format requires more changes to hanlde an index table. Signed-off-by: Andrei Vagin --- drivers/block/ploop/dev.c| 18 ++ drivers/block/ploop/fmt_ploop1.c | 2 ++ drivers/block/ploop/io_direct.c | 1 + drivers/block/ploop/io_kaio.c| 8 +++- include/linux/ploop

[Devel] [PATCH 4/4] ploop: give aligned regions into fuse fallocate()

2018-02-14 Thread Andrei Vagin
parts has to be filled in with zeros, otherwise we can ignore them. Signed-off-by: Andrei Vagin --- drivers/block/ploop/io_kaio.c | 79 +++ 1 file changed, 79 insertions(+) diff --git a/drivers/block/ploop/io_kaio.c b/drivers/block/ploop/io_kaio.c index

[Devel] [PATCH rh7] target/sbc: Add LBPRZ attribute + control CDB emulation

2018-02-14 Thread Andrei Vagin
ff-by: Nicholas Bellinger Signed-off-by: Andrei Vagin --- drivers/target/target_core_device.c | 34 +++ drivers/target/target_core_file.c | 1 + drivers/target/target_core_iblock.c | 1 + drivers/target/target_core_rd.c | 1 + dr

[Devel] [PATCH 3/4] ploop: allow to set discard granularity and alignment attributes

2018-02-15 Thread Andrei Vagin
[This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing] Different backing stores can have different values for these parameters. Signed-off-by: Andrei Vagin --- drivers/block/ploop/sysfs.c | 48

Re: [Devel] [PATCH] ploop: Discard bios of size not aligned at 512 bytes

2018-02-21 Thread Andrei Vagin
On Wed, Feb 21, 2018 at 02:41:47PM +0300, Kirill Tkhai wrote: > Currently, we have BUG_ON() on this place. But it's > easy to generate 511 bytes request from userspace, > as it was found by Andrey Vagin via iscsi tests: > > sg_raw -r511 /dev/sda 28 0 0 0 0 0 0 0 9 0 > > This patch replaces BUG_ON

Re: [Devel] [PATCH v2] ploop: Discard bios of size not aligned at 512 bytes

2018-02-21 Thread Andrei Vagin
> This patch replaces BUG_ON() with bio discarding > like other drivers do when they see a size above > their logical block size. > > https://jira.sw.ru/browse/PSBM-81576 > Acked-by: Andrei Vagin > Reported-by: Andrey Vagin > Signed-off-by: Kirill Tkhai > --- > driv

Re: [Devel] [PATCH vz7] net/vhost: Replace kmalloc with kvmalloc for order>=3

2018-02-26 Thread Andrei Vagin
On Mon, Feb 26, 2018 at 03:29:51PM +0300, Oleg Babin wrote: > Currently we allocate more than eight pages of memory in > vhost_net_set_ubuf_info() function and we do not need > them to be physically contiguous, so it is feasible to > replace a call to kmalloc() with a call to kvmalloc(). I see onl

[Devel] [PATCH 2/3] target: remove the unused SCF_CMD_XCOPY_PASSTHROUGH flag

2018-02-26 Thread Andrei Vagin
[This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing] From: Christoph Hellwig Here is a backport of the mainline commit: ML: c3d0a7c21db219ef87679c2a667aba9f138524db Signed-off-by: Christoph Hellwig Signe

[Devel] [PATCH 1/3] target: Invoke release_cmd() callback without holding a spinlock

2018-02-26 Thread Andrei Vagin
[This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing] From: Bart Van Assche Here is a backport of the mainline commit: ML: 9ff9d15eddd13ecdd41876c5e1f31ddbb127101c This patch fixes the following kernel war

[Devel] [PATCH 3/3] target: Fix LUN_RESET active I/O handling for ACK_KREF

2018-02-26 Thread Andrei Vagin
[This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing] From: Nicholas Bellinger Here is a backport of the mainline commit: ML: febe562c20dfa8f33bee7d419c6b517986a5aa33 https://pmc.acronis.com/browse/VSTOR-7

[Devel] [PATCH 1/2] ploop: add a standby mode

2018-02-26 Thread Andrei Vagin
, so we need another way how to determine this state. This patch addes a new block queue flag QUEUE_FLAG_STANDBY. https://pmc.acronis.com/browse/VSTOR-7879 Signed-off-by: Andrei Vagin --- drivers/block/ploop/dev.c | 11 +++ drivers/block/ploop/io_kaio.c | 20

[Devel] [PATCH 2/2] target: set ALUA_TG_PT_STANDBY if a backing store is in standby mode

2018-02-26 Thread Andrei Vagin
the new target, and the current target has to complete all commands and set the ASCQ_04H_ALUA_TG_PT_STANDBY bit in there status. https://pmc.acronis.com/browse/VSTOR-7879 Signed-off-by: Andrei Vagin --- drivers/target/target_core_alua.c | 5 + drivers/target/target_core_alua.h

Re: [Devel] [PATCH vz7] net/vhost: Replace kmalloc with kvmalloc for order>=3

2018-02-27 Thread Andrei Vagin
On Tue, Feb 27, 2018 at 11:27:31AM +0300, Andrey Ryabinin wrote: > > > On 02/27/2018 01:27 AM, Andrei Vagin wrote: > > On Mon, Feb 26, 2018 at 03:29:51PM +0300, Oleg Babin wrote: > >> Currently we allocate more than eight pages of memory in > >> vhost_net_set_u

[Devel] [PATCH] ploop: move discard_* attributes in the tune_attributes group

2018-02-27 Thread Andrei Vagin
state_attributes contains only readonly attrebutes, all read-write attributes are in tune_attributes. Reported-by: Konstantin Khorenko --- drivers/block/ploop/sysfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/ploop/sysfs.c b/drivers/block/ploop/sysfs

Re: [Devel] ***SPAM*** [PATCH 3/4] ploop: allow to set discard granularity and alignment attributes

2018-02-27 Thread Andrei Vagin
On Fri, Feb 16, 2018 at 11:11:54AM +0300, Konstantin Khorenko wrote: > On 02/15/2018 04:36 AM, Andrei Vagin wrote: > > > > Different backing stores can have different values for these parameters. > > > > Signed-off-by: Andrei Vagin > > --- >

Re: [Devel] [PATCH] ploop: don't forget to dec preq->io_count on a error path

2018-03-02 Thread Andrei Vagin
On Thu, Mar 01, 2018 at 01:19:10PM +0300, Vasily Averin wrote: > Andrey, > please take look at comment below. > > On 2018-02-15 04:27, Andrei Vagin wrote: > > [This sender failed our fraud detection checks and may not be who they > > appear to be. Learn about s

[Devel] [PATCH] target/iscsi: add an ability to set io limits for iscsi targets

2018-03-13 Thread Andrei Vagin
echo "182:252960 6291456" > $CG_PATH/blkio.throttle.read_bps_device # check that limits work as expected $ dd if=/dev/sda of=/dev/null bs=10M count=10 10+0 records in 10+0 records out 104857600 bytes (105 MB) copied, 17.3534 s, 6.0 MB/s Signed-off-by: Andrei Vagin --- drivers/targ

Re: [Devel] [PATCH vz7] net: Skip IP_FREEBIND for ipv6 SOCK_RAW sockets

2018-03-20 Thread Andrei Vagin
On Tue, Mar 20, 2018 at 02:07:51PM +0300, Kirill Tkhai wrote: > IP_FREEBIND is not supported for SOCK_RAW ipv6 sockets. > See kernel rawv6_setsockopt() for the details. inet_bind() can fail for ipv6 addresses without this option: /* * ipv6 addresses go through a “tentative” phase and * sockets

Re: [Devel] [PATCH vz7] net: Skip IP_FREEBIND for ipv6 SOCK_RAW sockets

2018-03-20 Thread Andrei Vagin
On Wed, Mar 21, 2018 at 03:07:12AM +0300, Kirill Tkhai wrote: > On 21.03.2018 02:18, Andrei Vagin wrote: > > On Tue, Mar 20, 2018 at 02:07:51PM +0300, Kirill Tkhai wrote: > >> IP_FREEBIND is not supported for SOCK_RAW ipv6 sockets. > >> See kernel rawv6_s

Re: [Devel] [PATCH vz7] net: Skip IP_FREEBIND for ipv6 SOCK_RAW sockets

2018-03-21 Thread Andrei Vagin
On Wed, Mar 21, 2018 at 01:27:35PM +0300, Kirill Tkhai wrote: > On 21.03.2018 07:43, Andrei Vagin wrote: > > On Wed, Mar 21, 2018 at 03:07:12AM +0300, Kirill Tkhai wrote: > >> On 21.03.2018 02:18, Andrei Vagin wrote: > >>> On Tue, Mar 20, 2018 at 02:07:

Re: [Devel] [PATCH] target/iscsi: add an ability to set io limits for iscsi targets

2018-03-21 Thread Andrei Vagin
On Wed, Mar 14, 2018 at 11:01:43AM +0300, Vasily Averin wrote: > See small comment below > > On 2018-03-14 01:48, Andrei Vagin wrote: > > This patch add an ability to set a blkio cgroup for an iscsi target. > > > > When a new client is connected, the kernel creates two

[Devel] [PATCH 06/23] target: Don't override EXTENDED_COPY xcopy_pt_cmd SCSI status code

2018-03-27 Thread Andrei Vagin
ted-by: Dinesh Israni Signed-off-by: Dinesh Israni Cc: Dinesh Israni Cc: sta...@vger.kernel.org # 3.14+ Signed-off-by: Nicholas Bellinger Signed-off-by: Andrei Vagin --- drivers/target/target_core_xcopy.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --gi

[Devel] [PATCH 15/23] target: Fix LUN_RESET active I/O handling for ACK_KREF

2018-03-27 Thread Andrei Vagin
org # 3.10+ Signed-off-by: Nicholas Bellinger Signed-off-by: Andrei Vagin --- drivers/target/target_core_tmr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c index 4fe985a..e2c9672 100644 --- a/drivers/target/target_core_t

[Devel] [PATCH 10/23] iscsi-target: Fix potential dead-lock during node acl delete

2018-03-27 Thread Andrei Vagin
sess_kref reference counting for both se_node_acl deletion + se_node_acl->queue_depth se_session restart. Reported-by:: Sagi Grimberg Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Andy Grover Cc: Mike Christie Cc: sta...@vger.kernel.org # 3.10+ Signed-off-by: Nicholas Bellinger Signed-of

[Devel] [PATCH 21/23] iscsi-target: fix memory leak in iscsit_setup_text_cmd()

2018-03-27 Thread Andrei Vagin
es this issue by calling kfree(cmd->text_in_ptr) in iscsit_setup_text_cmd() before assigning NULL to it. For the first text request cmd->text_in_ptr is NULL as cmd is memset to 0 in iscsit_allocate_cmd(). Signed-off-by: Varun Prakash Cc: # 4.0+ Signed-off-by: Nicholas Bellinger Signe

[Devel] [PATCH 00/23] target: backport bug fixes from the upstream kernel

2018-03-27 Thread Andrei Vagin
Alexei Potashnik (1): target/iscsi: Fix double free of a TUR followed by a solicited NOPOUT Bart Van Assche (2): target: Inline transport_get_sense_codes() target: Split transport_send_check_condition_and_sense() Christoph Hellwig (1): target: fix DPO and FUA bit checks Dinesh Israni (1)

[Devel] [PATCH 14/23] target: fix DPO and FUA bit checks

2018-03-27 Thread Andrei Vagin
libiscsi testsuite. Personally I'd prefer to also remove the emulate_fua_write attribute as there is no good reason to disable it, but I'll leave that for a separate discussion. Signed-off-by: Christoph Hellwig Signed-off-by: Nicholas Bellinger Signed-off-by: Andrei Vagin --- driv

[Devel] [PATCH 17/23] target: Fix TAS handling for multi-session se_node_acls

2018-03-27 Thread Andrei Vagin
sta...@vger.kernel.org # 3.10+ Signed-off-by: Nicholas Bellinger Signed-off-by: Andrei Vagin --- drivers/target/target_core_tmr.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c index 99bc3d4..8f93

[Devel] [PATCH 03/23] target: Inline transport_get_sense_codes()

2018-03-27 Thread Andrei Vagin
Reviewed-by: Martin K. Petersen Signed-off-by: Nicholas Bellinger Signed-off-by: Andrei Vagin --- drivers/target/target_core_transport.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target

[Devel] [PATCH 04/23] target: Split transport_send_check_condition_and_sense()

2018-03-27 Thread Andrei Vagin
the translation into table-driven code. Signed-off-by: Bart Van Assche Signed-off-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Signed-off-by: Nicholas Bellinger Signed-off-by: Andrei Vagin --- drivers/target

[Devel] [PATCH 23/23] target: Fix max_unmap_lba_count calc overflow

2018-03-27 Thread Andrei Vagin
backing device can actually support. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche Cc: sta...@vger.kernel.org Signed-off-by: Nicholas Bellinger Signed-off-by: Andrei Vagin --- drivers/target/target_core_device.c | 8 +--- drivers/target/target_core_file.c| 3 +-- drivers/target

[Devel] [PATCH 11/23] target/sbc: Add LBPRZ attribute + control CDB emulation

2018-03-27 Thread Andrei Vagin
flag. Signed-off-by: Jamie Pocas Signed-off-by: Nicholas Bellinger Signed-off-by: Andrei Vagin --- drivers/target/target_core_iblock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index c68e255..02c5ab0a 100644

[Devel] [PATCH 07/23] target: Use correct SCSI status during EXTENDED_COPY exception

2018-03-27 Thread Andrei Vagin
. Reported-by: Nixon Vincent Tested-by: Nixon Vincent Cc: Nixon Vincent Reviewed-by: Christoph Hellwig Cc: sta...@vger.kernel.org # 3.14+ Signed-off-by: Nicholas Bellinger Signed-off-by: Andrei Vagin --- drivers/target/target_core_xcopy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[Devel] [PATCH 13/23] target: Fix race with SCF_SEND_DELAYED_TAS handling

2018-03-27 Thread Andrei Vagin
hen necessary, and have transport_send_task_abort() send the abort. Cc: Quinn Tran Cc: Himanshu Madhani Cc: Sagi Grimberg Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Andy Grover Cc: Mike Christie Cc: sta...@vger.kernel.org # 3.10+ Signed-off-by: Nicholas Bellinger Signed-off-by: Andrei Va

  1   2   >