Re: [PATCH] usbip: tools usbip_attach: Fix cryptic error messages

2018-02-27 Thread Krzysztof Opasiak
sockfd, busid); if (rhport < 0) { - err("query"); + err("Attach request for Device %s. Is this device exported?", + busid); return -1; } The code itself is ok and you may put my: Reviewed-

Re: [PATCH] usbip: tools usbip_attach: Fix cryptic error messages

2018-02-27 Thread Krzysztof Opasiak
); if (rhport < 0) { - err("query"); + err("Attach request for Device %s. Is this device exported?", + busid); return -1; } The code itself is ok and you may put my: Reviewed-by: Krzysztof Opasiak but just

Re: [PATCH] usbip: vudc: fix null pointer dereference on udc->lock

2018-02-27 Thread Krzysztof Opasiak
} Thanks for the patch. Looks good to me. Acked-by: Shuah Khan <shua...@osg.samsung.com> Reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> but you could fix also a similar bug one one function above (dev_desc_read()) ;) Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH] usbip: vudc: fix null pointer dereference on udc->lock

2018-02-27 Thread Krzysztof Opasiak
dev_err(dev, "no device or gadget not bound"); + if (!udc->driver || !udc->pullup) { + dev_err(dev, "gadget not bound"); ret = -ENODEV; goto unlock; } Thanks for the patch. Looks good to me. Acked-by: Shuah Kh

Re: [RFC PATCH v2 4/4] Allow to trace fd usage with rlimit-events

2017-12-15 Thread Krzysztof Opasiak
On 12/15/2017 12:59 AM, Andreas Dilger wrote: On Dec 14, 2017, at 3:00 PM, Krzysztof Opasiak <k.opas...@samsung.com> wrote: Add rlimit-events calls to file descriptors management code to allow tracing of FD usage. This allows userspace process (monitor) to get notification when

Re: [RFC PATCH v2 4/4] Allow to trace fd usage with rlimit-events

2017-12-15 Thread Krzysztof Opasiak
On 12/15/2017 12:59 AM, Andreas Dilger wrote: On Dec 14, 2017, at 3:00 PM, Krzysztof Opasiak wrote: Add rlimit-events calls to file descriptors management code to allow tracing of FD usage. This allows userspace process (monitor) to get notification when other process (subject) uses given

[RFC PATCH v2 4/4] Allow to trace fd usage with rlimit-events

2017-12-14 Thread Krzysztof Opasiak
in system services instead of polling with predefined interval. Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- drivers/android/binder.c | 4 +-- fs/exec.c| 2 +- fs/file.c| 82 +++- fs/

[RFC PATCH v2 4/4] Allow to trace fd usage with rlimit-events

2017-12-14 Thread Krzysztof Opasiak
in system services instead of polling with predefined interval. Signed-off-by: Krzysztof Opasiak --- drivers/android/binder.c | 4 +-- fs/exec.c| 2 +- fs/file.c| 82 +++- fs/open.c| 2 +- include/linux

[RFC PATCH v2 3/4] Connect rlimit-events with process life cycle

2017-12-14 Thread Krzysztof Opasiak
Add rlimit-events call to process lifecycle to ensure that we get notified whenever process dies (to cleanup our watch levels) or forks (to implement watch levels inheritance). Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- kernel/exit.c | 3 +++ kernel/fork.c | 11

[RFC PATCH v2 3/4] Connect rlimit-events with process life cycle

2017-12-14 Thread Krzysztof Opasiak
Add rlimit-events call to process lifecycle to ensure that we get notified whenever process dies (to cleanup our watch levels) or forks (to implement watch levels inheritance). Signed-off-by: Krzysztof Opasiak --- kernel/exit.c | 3 +++ kernel/fork.c | 11 ++- 2 files changed, 13

[RFC PATCH v2 1/4] sched: Allow to get() and put() signal struct

2017-12-14 Thread Krzysztof Opasiak
Allow to get() and put() signal struct from different parts of kernel core, not only from signal.c. This is useful when you place inside signal struct additional resources that has to be accessed after process dies. Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- include

[RFC PATCH v2 1/4] sched: Allow to get() and put() signal struct

2017-12-14 Thread Krzysztof Opasiak
Allow to get() and put() signal struct from different parts of kernel core, not only from signal.c. This is useful when you place inside signal struct additional resources that has to be accessed after process dies. Signed-off-by: Krzysztof Opasiak --- include/linux/sched/signal.h | 13

[RFC PATCH v2 2/4] Add rlimit-events framework

2017-12-14 Thread Krzysztof Opasiak
of given resource. When monitoring subject crosses given usage level monitoring fd will be ready to read resource change event from it. It's possible to monitor multiple processes and single process can be monitored by multiple other processes. Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.

[RFC PATCH v2 2/4] Add rlimit-events framework

2017-12-14 Thread Krzysztof Opasiak
of given resource. When monitoring subject crosses given usage level monitoring fd will be ready to read resource change event from it. It's possible to monitor multiple processes and single process can be monitored by multiple other processes. Signed-off-by: Krzysztof Opasiak --- Documentation

[RFC PATCH v2 0/4] Add rlimit-resources change notification mechanism

2017-12-14 Thread Krzysztof Opasiak
/kopasiak/rlimit-events-tests Please share your opinion about idea and current design. -- Best regards Krzysztof Opasiak Changes since v1: - Reuse binder's file structure stored in proc - Fix license issues - Fix indentation - Fix IOCTL definiton - Add attribute packed to ioctl structures

[RFC PATCH v2 0/4] Add rlimit-resources change notification mechanism

2017-12-14 Thread Krzysztof Opasiak
/kopasiak/rlimit-events-tests Please share your opinion about idea and current design. -- Best regards Krzysztof Opasiak Changes since v1: - Reuse binder's file structure stored in proc - Fix license issues - Fix indentation - Fix IOCTL definiton - Add attribute packed to ioctl structures

Re: [PATCH 2/2] usbip: use monotonic timestamps

2017-11-07 Thread Krzysztof Opasiak
synchronized with other machines we talk to. Signed-off-by: Arnd Bergmann <a...@arndb.de> Looks good to me: Reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH 2/2] usbip: use monotonic timestamps

2017-11-07 Thread Krzysztof Opasiak
synchronized with other machines we talk to. Signed-off-by: Arnd Bergmann Looks good to me: Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH 1/2] usbip: fix off-by-one frame number calculation

2017-11-07 Thread Krzysztof Opasiak
explanation is that it was a simple typo, so I'm changing the % modulo operator into a cheaper bitmask that the other drivers use, to make it wrap after 0x7ff rather than before it. Signed-off-by: Arnd Bergmann <a...@arndb.de> Looks good to me: Reviewed-by: Krzysztof Opasiak <k.opas...@sa

Re: [PATCH 1/2] usbip: fix off-by-one frame number calculation

2017-11-07 Thread Krzysztof Opasiak
explanation is that it was a simple typo, so I'm changing the % modulo operator into a cheaper bitmask that the other drivers use, to make it wrap after 0x7ff rather than before it. Signed-off-by: Arnd Bergmann Looks good to me: Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R

Re: [PATCH 3/4][PoC][RFC] Connect rlimit-events with process life cycle

2017-10-19 Thread Krzysztof Opasiak
On 10/19/2017 09:41 AM, Greg KH wrote: On Wed, Oct 18, 2017 at 10:32:29PM +0200, Krzysztof Opasiak wrote: Add rlimit-events call to process lifecycle to ensure that we get notified whenever process dies (to cleanup our watch levels) or forks (to implement watch levels inheritance). Signed

Re: [PATCH 3/4][PoC][RFC] Connect rlimit-events with process life cycle

2017-10-19 Thread Krzysztof Opasiak
On 10/19/2017 09:41 AM, Greg KH wrote: On Wed, Oct 18, 2017 at 10:32:29PM +0200, Krzysztof Opasiak wrote: Add rlimit-events call to process lifecycle to ensure that we get notified whenever process dies (to cleanup our watch levels) or forks (to implement watch levels inheritance). Signed

Re: [PATCH 2/4][PoC][RFC] Add rlimit-events framework

2017-10-19 Thread Krzysztof Opasiak
Hi, On 10/19/2017 09:41 AM, Greg KH wrote: Meta-comments on the code, I'm not commenting on the content, just normal code review things that I always see in kernel code... On Wed, Oct 18, 2017 at 10:32:28PM +0200, Krzysztof Opasiak wrote: diff --git a/include/linux/rlimit_noti_kern.h b

Re: [PATCH 2/4][PoC][RFC] Add rlimit-events framework

2017-10-19 Thread Krzysztof Opasiak
Hi, On 10/19/2017 09:41 AM, Greg KH wrote: Meta-comments on the code, I'm not commenting on the content, just normal code review things that I always see in kernel code... On Wed, Oct 18, 2017 at 10:32:28PM +0200, Krzysztof Opasiak wrote: diff --git a/include/linux/rlimit_noti_kern.h b

Re: [PATCH 1/4][PoC][RFC] sched: Allow to get() and put() signal struct

2017-10-19 Thread Krzysztof Opasiak
On 10/19/2017 09:34 AM, Greg KH wrote: On Wed, Oct 18, 2017 at 10:32:27PM +0200, Krzysztof Opasiak wrote: Allow to get() and put() signal struct from different parts of kernel core, not only from signal.c. That says what this does, but not _why_. Who would ever want to have access

Re: [PATCH 1/4][PoC][RFC] sched: Allow to get() and put() signal struct

2017-10-19 Thread Krzysztof Opasiak
On 10/19/2017 09:34 AM, Greg KH wrote: On Wed, Oct 18, 2017 at 10:32:27PM +0200, Krzysztof Opasiak wrote: Allow to get() and put() signal struct from different parts of kernel core, not only from signal.c. That says what this does, but not _why_. Who would ever want to have access

Re: [PATCH 4/4][PoC][RFC] Allow to trace fd usage with rlimit-events

2017-10-19 Thread Krzysztof Opasiak
Hi, On 10/19/2017 01:05 AM, Al Viro wrote: On Wed, Oct 18, 2017 at 10:32:30PM +0200, Krzysztof Opasiak wrote: @@ -417,7 +417,7 @@ static int task_get_unused_fd_flags(struct binder_proc *proc, int flags) rlim_cur = task_rlimit(proc->tsk, RLIMIT_NOFILE); unlock_task_sigh

Re: [PATCH 4/4][PoC][RFC] Allow to trace fd usage with rlimit-events

2017-10-19 Thread Krzysztof Opasiak
Hi, On 10/19/2017 01:05 AM, Al Viro wrote: On Wed, Oct 18, 2017 at 10:32:30PM +0200, Krzysztof Opasiak wrote: @@ -417,7 +417,7 @@ static int task_get_unused_fd_flags(struct binder_proc *proc, int flags) rlim_cur = task_rlimit(proc->tsk, RLIMIT_NOFILE); unlock_task_sigh

[PATCH 0/4][PoC][RFC] Add rlimit-resources change notification mechanism

2017-10-18 Thread Krzysztof Opasiak
/kopasiak/rlimit-events-tests Please share your opinion about idea and current design. -- Best regards Krzysztof Opasiak --- Krzysztof Opasiak (4): sched: Allow to get() and put() signal struct Add rlimit-events framework Connect rlimit-events with process life cycle Allow to trace fd usage

[PATCH 0/4][PoC][RFC] Add rlimit-resources change notification mechanism

2017-10-18 Thread Krzysztof Opasiak
/kopasiak/rlimit-events-tests Please share your opinion about idea and current design. -- Best regards Krzysztof Opasiak --- Krzysztof Opasiak (4): sched: Allow to get() and put() signal struct Add rlimit-events framework Connect rlimit-events with process life cycle Allow to trace fd usage

[PATCH 4/4][PoC][RFC] Allow to trace fd usage with rlimit-events

2017-10-18 Thread Krzysztof Opasiak
in system services instead of polling with predefined interval. Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- drivers/android/binder.c | 4 +-- fs/exec.c| 2 +- fs/file.c| 83 fs/

[PATCH 4/4][PoC][RFC] Allow to trace fd usage with rlimit-events

2017-10-18 Thread Krzysztof Opasiak
in system services instead of polling with predefined interval. Signed-off-by: Krzysztof Opasiak --- drivers/android/binder.c | 4 +-- fs/exec.c| 2 +- fs/file.c| 83 fs/open.c| 2 +- include/linux

[PATCH 2/4][PoC][RFC] Add rlimit-events framework

2017-10-18 Thread Krzysztof Opasiak
of given resource. When monitoring subject crosses given usage level monitoring fd will be ready to read resource change event from it. It's possible to monitor multiple processes and single process can be monitored by multiple other processes. Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.

[PATCH 2/4][PoC][RFC] Add rlimit-events framework

2017-10-18 Thread Krzysztof Opasiak
of given resource. When monitoring subject crosses given usage level monitoring fd will be ready to read resource change event from it. It's possible to monitor multiple processes and single process can be monitored by multiple other processes. Signed-off-by: Krzysztof Opasiak --- include/asm

[PATCH 3/4][PoC][RFC] Connect rlimit-events with process life cycle

2017-10-18 Thread Krzysztof Opasiak
Add rlimit-events call to process lifecycle to ensure that we get notified whenever process dies (to cleanup our watch levels) or forks (to implement watch levels inheritance). Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- kernel/exit.c | 4 kernel/fork.

[PATCH 3/4][PoC][RFC] Connect rlimit-events with process life cycle

2017-10-18 Thread Krzysztof Opasiak
Add rlimit-events call to process lifecycle to ensure that we get notified whenever process dies (to cleanup our watch levels) or forks (to implement watch levels inheritance). Signed-off-by: Krzysztof Opasiak --- kernel/exit.c | 4 kernel/fork.c | 16 +++- 2 files changed, 19

[PATCH 1/4][PoC][RFC] sched: Allow to get() and put() signal struct

2017-10-18 Thread Krzysztof Opasiak
Allow to get() and put() signal struct from different parts of kernel core, not only from signal.c. Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- include/linux/sched/signal.h | 13 + kernel/fork.c| 9 ++--- 2 files changed, 15 insertions

[PATCH 1/4][PoC][RFC] sched: Allow to get() and put() signal struct

2017-10-18 Thread Krzysztof Opasiak
Allow to get() and put() signal struct from different parts of kernel core, not only from signal.c. Signed-off-by: Krzysztof Opasiak --- include/linux/sched/signal.h | 13 + kernel/fork.c| 9 ++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git

[tip:timers/core] posix-cpu-timers: Use dedicated helper to access rlimit values

2017-08-20 Thread tip-bot for Krzysztof Opasiak
Commit-ID: 3cf294962df8fcde710eb5e762e0929e2ba49947 Gitweb: http://git.kernel.org/tip/3cf294962df8fcde710eb5e762e0929e2ba49947 Author: Krzysztof Opasiak <k.opas...@samsung.com> AuthorDate: Wed, 5 Jul 2017 19:25:48 +0200 Committer: Thomas Gleixner <t...@linutronix.de> CommitD

[tip:timers/core] posix-cpu-timers: Use dedicated helper to access rlimit values

2017-08-20 Thread tip-bot for Krzysztof Opasiak
Commit-ID: 3cf294962df8fcde710eb5e762e0929e2ba49947 Gitweb: http://git.kernel.org/tip/3cf294962df8fcde710eb5e762e0929e2ba49947 Author: Krzysztof Opasiak AuthorDate: Wed, 5 Jul 2017 19:25:48 +0200 Committer: Thomas Gleixner CommitDate: Fri, 18 Aug 2017 12:44:42 +0200 posix-cpu-timers

[PATCH 4/4] mm: Use dedicated helper to access rlimit value

2017-07-05 Thread Krzysztof Opasiak
Use rlimit() helper instead of manually writing whole chain from current task to rlim_cur Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- mm/mmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index a5e3dcd75e79..8d268b3983c9

[PATCH 4/4] mm: Use dedicated helper to access rlimit value

2017-07-05 Thread Krzysztof Opasiak
Use rlimit() helper instead of manually writing whole chain from current task to rlim_cur Signed-off-by: Krzysztof Opasiak --- mm/mmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index a5e3dcd75e79..8d268b3983c9 100644 --- a/mm/mmap.c +++ b

[PATCH 3/4] fs: Use dedicated helper to access rlimit value

2017-07-05 Thread Krzysztof Opasiak
Use rlimit() helper instead of manually writing whole chain from current task to rlim_cur Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- fs/exec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/exec.c b/fs/exec.c index 904199086490..964e34e307df

[PATCH 3/4] fs: Use dedicated helper to access rlimit value

2017-07-05 Thread Krzysztof Opasiak
Use rlimit() helper instead of manually writing whole chain from current task to rlim_cur Signed-off-by: Krzysztof Opasiak --- fs/exec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/exec.c b/fs/exec.c index 904199086490..964e34e307df 100644 --- a/fs/exec.c +++ b/fs

[PATCH 2/4] time: posix: Use dedicated helper to access rlimit values

2017-07-05 Thread Krzysztof Opasiak
Use rlimit() and rlimit_max() helper instead of manually writing whole chain from task to rlimit value Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- kernel/time/posix-cpu-timers.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/kernel/time

[PATCH 2/4] time: posix: Use dedicated helper to access rlimit values

2017-07-05 Thread Krzysztof Opasiak
Use rlimit() and rlimit_max() helper instead of manually writing whole chain from task to rlimit value Signed-off-by: Krzysztof Opasiak --- kernel/time/posix-cpu-timers.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/kernel/time/posix-cpu-timers.c b/kernel

[PATCH 1/4] android: binder: Use dedicated helper to access rlimit value

2017-07-05 Thread Krzysztof Opasiak
Use rlimit() helper instead of manually writing whole chain from current task to rlim_cur Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- drivers/android/binder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/android/binder.c b/drivers/android/bi

[PATCH 1/4] android: binder: Use dedicated helper to access rlimit value

2017-07-05 Thread Krzysztof Opasiak
Use rlimit() helper instead of manually writing whole chain from current task to rlim_cur Signed-off-by: Krzysztof Opasiak --- drivers/android/binder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index aae4d8d4be36

Re: [PATCH 03/11] Creation of "usb_device_auth" LSM hook

2017-06-12 Thread Krzysztof Opasiak
dification... without matching and storing rules inside kernel.. just pure userspace which uses device/interface authorization Footnote: 1 - https://dkopecek.github.io/usbguard/ Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH 03/11] Creation of "usb_device_auth" LSM hook

2017-06-12 Thread Krzysztof Opasiak
dification... without matching and storing rules inside kernel.. just pure userspace which uses device/interface authorization Footnote: 1 - https://dkopecek.github.io/usbguard/ Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH] usb: gadget: remove redundant self assignment

2017-04-19 Thread Krzysztof Opasiak
usb_ep *ep) goto out; ret = ep->ops->disable(ep); - if (ret) { - ret = ret; + if (ret) goto out; - } ep->enabled = false; Reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> -- Krzysztof Opasia

Re: [PATCH] usb: gadget: remove redundant self assignment

2017-04-19 Thread Krzysztof Opasiak
) goto out; ret = ep->ops->disable(ep); - if (ret) { - ret = ret; + if (ret) goto out; - } ep->enabled = false; Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH 1/2] fs: configfs: make qw_sign attribute symmetric

2017-04-19 Thread Krzysztof Opasiak
ewlines in case of gadget/config strings. Reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH 1/2] fs: configfs: make qw_sign attribute symmetric

2017-04-19 Thread Krzysztof Opasiak
et/config strings. Reviewed-by: Krzysztof Opasiak Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH 2/2] fs: configfs: use hexadecimal values and new line

2017-04-19 Thread Krzysztof Opasiak
desc_ext_prop(item)->type); + return sprintf(page, "%d\n", to_usb_os_desc_ext_prop(item)->type); } static ssize_t ext_prop_type_store(struct config_item *item, looks good to me: Reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH 2/2] fs: configfs: use hexadecimal values and new line

2017-04-19 Thread Krzysztof Opasiak
n sprintf(page, "%d\n", to_usb_os_desc_ext_prop(item)->type); } static ssize_t ext_prop_type_store(struct config_item *item, looks good to me: Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: counting file descriptors with a cgroup controller

2017-03-08 Thread Krzysztof Opasiak
On 03/07/2017 09:48 PM, Tejun Heo wrote: Hello, On Tue, Mar 07, 2017 at 09:06:49PM +0100, Krzysztof Opasiak wrote: Personally, I don't want to use rlimit for this as it ends up returning error code from for example open() when we hit the limit. This may lead to some unpredictable crashes

Re: counting file descriptors with a cgroup controller

2017-03-08 Thread Krzysztof Opasiak
On 03/07/2017 09:48 PM, Tejun Heo wrote: Hello, On Tue, Mar 07, 2017 at 09:06:49PM +0100, Krzysztof Opasiak wrote: Personally, I don't want to use rlimit for this as it ends up returning error code from for example open() when we hit the limit. This may lead to some unpredictable crashes

Re: counting file descriptors with a cgroup controller

2017-03-08 Thread Krzysztof Opasiak
On 03/08/2017 03:59 AM, Parav Pandit wrote: Hi, On Tue, Mar 7, 2017 at 2:48 PM, Tejun Heo <t...@kernel.org> wrote: Hello, On Tue, Mar 07, 2017 at 09:06:49PM +0100, Krzysztof Opasiak wrote: Personally, I don't want to use rlimit for this as it ends up returning error code from for e

Re: counting file descriptors with a cgroup controller

2017-03-08 Thread Krzysztof Opasiak
On 03/08/2017 03:59 AM, Parav Pandit wrote: Hi, On Tue, Mar 7, 2017 at 2:48 PM, Tejun Heo wrote: Hello, On Tue, Mar 07, 2017 at 09:06:49PM +0100, Krzysztof Opasiak wrote: Personally, I don't want to use rlimit for this as it ends up returning error code from for example open() when we

Re: counting file descriptors with a cgroup controller

2017-03-07 Thread Krzysztof Opasiak
On 03/07/2017 08:41 PM, Tejun Heo wrote: Hello, Krzysztof. On Tue, Mar 07, 2017 at 12:19:52PM +0100, Krzysztof Opasiak wrote: So maybe let me clarify our use case so we can have some more discussion about this. We are dealing with task of monitoring system services on an IoT system. So

Re: counting file descriptors with a cgroup controller

2017-03-07 Thread Krzysztof Opasiak
On 03/07/2017 08:41 PM, Tejun Heo wrote: Hello, Krzysztof. On Tue, Mar 07, 2017 at 12:19:52PM +0100, Krzysztof Opasiak wrote: So maybe let me clarify our use case so we can have some more discussion about this. We are dealing with task of monitoring system services on an IoT system. So

Re: counting file descriptors with a cgroup controller

2017-03-07 Thread Krzysztof Opasiak
Hi On 03/06/2017 07:58 PM, Tejun Heo wrote: Hello, On Fri, Feb 17, 2017 at 12:37:11PM +0100, Krzysztof Opasiak wrote: We need to limit and monitor the number of file descriptors processes keep open. If a process exceeds certain limit we'd like to terminate it and restart it or reboot

Re: counting file descriptors with a cgroup controller

2017-03-07 Thread Krzysztof Opasiak
Hi On 03/06/2017 07:58 PM, Tejun Heo wrote: Hello, On Fri, Feb 17, 2017 at 12:37:11PM +0100, Krzysztof Opasiak wrote: We need to limit and monitor the number of file descriptors processes keep open. If a process exceeds certain limit we'd like to terminate it and restart it or reboot

Re: [PATCH] usb: gadget: add RNDIS configfs option for Windows rndiscmp.inf compatibility

2017-03-01 Thread Krzysztof Opasiak
attribute? So instead of having single attribute which sets the whole triple of values to some hardcoded ones I would prefer to have one attribute per each of this values and allow user to set them to his own values from userspace. Best regards, -- Krzysztof Opasiak Samsung R Institute Poland

Re: [PATCH] usb: gadget: add RNDIS configfs option for Windows rndiscmp.inf compatibility

2017-03-01 Thread Krzysztof Opasiak
attribute? So instead of having single attribute which sets the whole triple of values to some hardcoded ones I would prefer to have one attribute per each of this values and allow user to set them to his own values from userspace. Best regards, -- Krzysztof Opasiak Samsung R Institute Poland

Re: [PATCH v2 1/2] usbip: Fix-format-overflow

2017-02-21 Thread Krzysztof Opasiak
r comparsion but signed value to print error? Best regards -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH v2 1/2] usbip: Fix-format-overflow

2017-02-21 Thread Krzysztof Opasiak
-- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH 1/2] Fix format overflows

2017-02-20 Thread Krzysztof Opasiak
uff), "%d\n", sockfd); + if (size >= 30) { Please don't hardcode such values in if. use sizeof() like one line above + err("socket length %i >= 30", size); + return -1; + } ret = write_sysfs_attribute(sockfd_attr_path, sockfd_buff, strlen(sockfd_buff)); Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH 1/2] Fix format overflows

2017-02-20 Thread Krzysztof Opasiak
Please don't hardcode such values in if. use sizeof() like one line above + err("socket length %i >= 30", size); + return -1; + } ret = write_sysfs_attribute(sockfd_attr_path, sockfd_buff, strlen(sockfd_buff)); Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: counting file descriptors with a cgroup controller

2017-02-17 Thread Krzysztof Opasiak
ors of its members (similar to > memory controler). > > Any comments? Is there any alternative that: > > + does not require modifications of user-land code, > + enables other process (e.g. init) to be notified and apply policy. > > Kind regards, > -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: counting file descriptors with a cgroup controller

2017-02-17 Thread Krzysztof Opasiak
ors of its members (similar to > memory controler). > > Any comments? Is there any alternative that: > > + does not require modifications of user-land code, > + enables other process (e.g. init) to be notified and apply policy. > > Kind regards, > -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH] tools: usb usbip - update README USB/IP driver location

2017-01-15 Thread Krzysztof Opasiak
On 01/14/2017 12:38 AM, Shuah Khan wrote: > Update USB/IP driver location in README. > > Signed-off-by: Shuah Khan <shua...@osg.samsung.com> Reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH] tools: usb usbip - update README USB/IP driver location

2017-01-15 Thread Krzysztof Opasiak
On 01/14/2017 12:38 AM, Shuah Khan wrote: > Update USB/IP driver location in README. > > Signed-off-by: Shuah Khan Reviewed-by: Krzysztof Opasiak Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH] usbip: vudc: check for NULL before use

2016-12-21 Thread Krzysztof Opasiak
eck other udc in kernel and there is no agreement if we should check in those callbacks if our params are NULL or not. I have also run through udc-core implementation and generally it doesn't check if params are NULL or not and just dereference some of them and pass them to our callbacks. I think that the best option is just to ask Felipe (USB gadget maintainer) if we should check this or not. @Felipe Should each UDC check if values passed to gadget/endpoint callbacks is not NULL or just simply dereference them? Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [PATCH] usbip: vudc: check for NULL before use

2016-12-21 Thread Krzysztof Opasiak
n those callbacks if our params are NULL or not. I have also run through udc-core implementation and generally it doesn't check if params are NULL or not and just dereference some of them and pass them to our callbacks. I think that the best option is just to ask Felipe (USB gadget maintainer) if we should check this or not. @Felipe Should each UDC check if values passed to gadget/endpoint callbacks is not NULL or just simply dereference them? Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

[PATCH] tools: usb: usbip: Update README

2016-12-13 Thread Krzysztof Opasiak
Update README file: - remove outdated parts - clarify terminology and general structure - add some description of vUDC Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- tools/usb/usbip/README | 56 +- 1 file changed, 55 insertions

[PATCH] tools: usb: usbip: Update README

2016-12-13 Thread Krzysztof Opasiak
Update README file: - remove outdated parts - clarify terminology and general structure - add some description of vUDC Signed-off-by: Krzysztof Opasiak --- tools/usb/usbip/README | 56 +- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git

[PATCH v3] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-12 Thread Krzysztof Opasiak
Add some simple script which creates a USB gadget using ConfigFS and then exports it using vUDC. This may be useful for people who just started playing with USB/IP and vUDC as it shows exact steps how to setup all stuff. Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- Changes

[PATCH v3] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-12 Thread Krzysztof Opasiak
Add some simple script which creates a USB gadget using ConfigFS and then exports it using vUDC. This may be useful for people who just started playing with USB/IP and vUDC as it shows exact steps how to setup all stuff. Signed-off-by: Krzysztof Opasiak --- Changes since v2: - mention about

Re: [PATCH v2] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-12 Thread Krzysztof Opasiak
Hi, On 12/09/2016 10:40 PM, Shuah Khan wrote: > Hi Krzysztof, > > Thanks for getting to this so quickly. Couple of comments below: > > On 12/09/2016 10:15 AM, Krzysztof Opasiak wrote: >> Add some simple script which creates a USB gadget using ConfigFS >> and

Re: [PATCH v2] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-12 Thread Krzysztof Opasiak
Hi, On 12/09/2016 10:40 PM, Shuah Khan wrote: > Hi Krzysztof, > > Thanks for getting to this so quickly. Couple of comments below: > > On 12/09/2016 10:15 AM, Krzysztof Opasiak wrote: >> Add some simple script which creates a USB gadget using ConfigFS >> and

[PATCH v2] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-09 Thread Krzysztof Opasiak
Add some simple script which creates a USB gadget using ConfigFS and then exports it using vUDC. This may be useful for people who just started playing with USB/IP and vUDC as it shows exact steps how to setup all stuff. Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- Changes

[PATCH v2] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-09 Thread Krzysztof Opasiak
Add some simple script which creates a USB gadget using ConfigFS and then exports it using vUDC. This may be useful for people who just started playing with USB/IP and vUDC as it shows exact steps how to setup all stuff. Signed-off-by: Krzysztof Opasiak --- Changes since v1: - Fix terminology

Re: [PATCH] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-09 Thread Krzysztof Opasiak
On 12/09/2016 06:07 PM, Krzysztof Opasiak wrote: > Add some simple script which creates a USB gadget using ConfigFS > and then exports it using vUDC. > > This may be useful for people who just started playing with > USB/IP and vUDC as it shows exact steps how to setup all stuff.

Re: [PATCH] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-09 Thread Krzysztof Opasiak
On 12/09/2016 06:07 PM, Krzysztof Opasiak wrote: > Add some simple script which creates a USB gadget using ConfigFS > and then exports it using vUDC. > > This may be useful for people who just started playing with > USB/IP and vUDC as it shows exact steps how to setup all stuff.

Re: Fwd: Antwort: Re: vUDC

2016-12-09 Thread Krzysztof Opasiak
On 12/09/2016 03:43 PM, Shuah Khan wrote: > Hi Krzysztof, > > On 12/09/2016 01:43 AM, Krzysztof Opasiak wrote: >> FYI to the list for next generations;) >> >> >> Forwarded Message >> Subject: Antwort: Re: vUDC >> Date: Fri, 9 Dec

Re: Fwd: Antwort: Re: vUDC

2016-12-09 Thread Krzysztof Opasiak
On 12/09/2016 03:43 PM, Shuah Khan wrote: > Hi Krzysztof, > > On 12/09/2016 01:43 AM, Krzysztof Opasiak wrote: >> FYI to the list for next generations;) >> >> >> Forwarded Message >> Subject: Antwort: Re: vUDC >> Date: Fri, 9 Dec

[PATCH] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-09 Thread Krzysztof Opasiak
Add some simple script which creates a USB gadget using ConfigFS and then exports it using vUDC. This may be useful for people who just started playing with USB/IP and vUDC as it shows exact steps how to setup all stuff. Signed-off-by: Krzysztof Opasiak <k.opas...@samsung.com> --- too

[PATCH] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-09 Thread Krzysztof Opasiak
Add some simple script which creates a USB gadget using ConfigFS and then exports it using vUDC. This may be useful for people who just started playing with USB/IP and vUDC as it shows exact steps how to setup all stuff. Signed-off-by: Krzysztof Opasiak --- tools/usb/usbip/vudc

Fwd: Antwort: Re: vUDC

2016-12-09 Thread Krzysztof Opasiak
FYI to the list for next generations;) Forwarded Message Subject: Antwort: Re: vUDC Date: Fri, 9 Dec 2016 09:00:04 +0100 From: Elen Niedermeyer <elen.niederme...@biotronik.com> To: Krzysztof Opasiak <k.opas...@samsung.com> Hi, so your script solved my problem. I

Fwd: Antwort: Re: vUDC

2016-12-09 Thread Krzysztof Opasiak
FYI to the list for next generations;) Forwarded Message Subject: Antwort: Re: vUDC Date: Fri, 9 Dec 2016 09:00:04 +0100 From: Elen Niedermeyer To: Krzysztof Opasiak Hi, so your script solved my problem. I didn't know that I should start the daemon with 'usbipd --device

Re: vUDC

2016-12-08 Thread Krzysztof Opasiak
t; UDC $ usbipd --device Client: $ modprobe usbip-vhci $ usbip attach -r $SERVER_IP -d usbip-vudc.0 Please let me know if your setup script is similar and what exactly is not working for you. > Any ideas. Maybe it is time the documentation is updated with vudc details. > Yes I think it's a good idea. I'll try to do this when I have some spare time. Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: vUDC

2016-12-08 Thread Krzysztof Opasiak
odprobe usbip-vhci $ usbip attach -r $SERVER_IP -d usbip-vudc.0 Please let me know if your setup script is similar and what exactly is not working for you. > Any ideas. Maybe it is time the documentation is updated with vudc details. > Yes I think it's a good idea. I'll try to do this when I have some spare time. Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: usb/gadget: GPF in usb_gadget_unregister_driver

2016-12-05 Thread Krzysztof Opasiak
sult dev->gadget_registered will be set to true in dev_config() > and dev_release() will call usb_gadget_unregister_driver(), which in > turn will try to remove driver from gadget_driver_pending_list. > > Does it make any sense? > Yes. We should add gadget to pending list only if suitable UDC has not been found and gadget driver is willing to wait for new UDC to appear. Otherwise we call udc_bind_to_gadget() and if this success then we should just return 0 as we took some free udc. usually you should have empty pending list;) Your description sounds really quite similar to what Felix fixed in his patch[1]. This patch fix this function in case when we found matching UDC but it is busy. Footnotes: 1 - http://marc.info/?l=linux-usb=148054830631070=2 Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: usb/gadget: GPF in usb_gadget_unregister_driver

2016-12-05 Thread Krzysztof Opasiak
red will be set to true in dev_config() > and dev_release() will call usb_gadget_unregister_driver(), which in > turn will try to remove driver from gadget_driver_pending_list. > > Does it make any sense? > Yes. We should add gadget to pending list only if suitable UDC has not been found and gadget driver is willing to wait for new UDC to appear. Otherwise we call udc_bind_to_gadget() and if this success then we should just return 0 as we took some free udc. usually you should have empty pending list;) Your description sounds really quite similar to what Felix fixed in his patch[1]. This patch fix this function in case when we found matching UDC but it is busy. Footnotes: 1 - http://marc.info/?l=linux-usb=148054830631070=2 Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [LINUX PATCH] usb: gadget: Configure bulk maxburst through module parameter in gadget zero.

2016-09-29 Thread Krzysztof Opasiak
ike such option to f_sourcesink then you should probably do this as configfs attribute not only g_zero module param. Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [LINUX PATCH] usb: gadget: Configure bulk maxburst through module parameter in gadget zero.

2016-09-29 Thread Krzysztof Opasiak
ike such option to f_sourcesink then you should probably do this as configfs attribute not only g_zero module param. Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [RFC PATCH 0/5] USB Audio Gadget refactoring

2016-07-26 Thread Krzysztof Opasiak
the f_audio_source.c from android. Definitely agree with this opinion. I don't see any benefits of breaking the API here instead of adding just another USB function. Maybe even some pieces of code could be shared with f_uac1.c but I think that this should be a brand new function. Best regards, -- Krzysztof Opasiak Samsung R Institute Poland Samsung Electronics

Re: [RFC PATCH 0/5] USB Audio Gadget refactoring

2016-07-26 Thread Krzysztof Opasiak
ld break the userspace api that the existing UAC1 > driver exposes. Maybe we should add another virtual-sound-card > exposing UAC1 driver ... and hopefully very similar to (or just port > of) the f_audio_source.c from android. Definitely agree with this opinion. I don't see any benefits

  1   2   3   >