Re: [PATCH 04/13] Kbuild: Rust support

2021-04-16 Thread Connor Kuehl
On 4/16/21 3:22 PM, Willy Tarreau wrote: > So it simply does the equivalent of: > > #define EINVAL -1234 > > struct result { > int status; > int error; > }; Result and Option types are more like a union with a tag that describes which variant it is. struct foo_result { /* if

Re: [PATCH 00/13] [RFC] Rust support

2021-04-16 Thread Connor Kuehl
On 4/16/21 12:37 PM, Willy Tarreau wrote: > Hi Miguel, > > On Fri, Apr 16, 2021 at 07:10:17PM +0200, Miguel Ojeda wrote: >> And by having the compiler enforce this safe-unsafe split, you can >> review safe code without having to constantly worry about UB; and be >> extra alert when dealing with `u

Re: [PATCH 2/3] virtiofs: split requests that exceed virtqueue size

2021-03-24 Thread Connor Kuehl
On 3/24/21 10:30 AM, Miklos Szeredi wrote: On Wed, Mar 24, 2021 at 4:09 PM Connor Kuehl wrote: On 3/18/21 10:17 AM, Miklos Szeredi wrote: I removed the conditional compilation and renamed the limit. Also made virtio_fs_get_tree() bail out if it hit the WARN_ON(). Updated patch below. Hi

Re: [PATCH 2/3] virtiofs: split requests that exceed virtqueue size

2021-03-24 Thread Connor Kuehl
On 3/18/21 10:17 AM, Miklos Szeredi wrote: I removed the conditional compilation and renamed the limit. Also made virtio_fs_get_tree() bail out if it hit the WARN_ON(). Updated patch below. Hi Miklos, Has this patch been queued? Connor --- From: Connor Kuehl Subject: virtiofs: split

Re: [PATCH] fs/fuse/virtio_fs: Fix a potential memory allocation failure

2021-03-24 Thread Connor Kuehl
On 3/24/21 7:38 AM, zhouchuangao wrote: Allocate memory for struct fuse_conn may fail, we should not jump to out_err to kfree(fc). Why not? If fc's allocation fails then it is NULL and calling kfree() on a NULL pointer is a noop[1]. Connor [1] https://www.kernel.org/doc/html/latest/core-ap

Re: [PATCH] fuse: Fix a potential double free in virtio_fs_get_tree

2021-03-23 Thread Connor Kuehl
On 3/23/21 12:18 AM, Lv Yunlong wrote: In virtio_fs_get_tree, fm is allocated by kzalloc() and assigned to fsc->s_fs_info by fsc->s_fs_info=fm statement. If the kzalloc() failed, it will goto err directly, so that Right, I follow this so far. fsc->s_fs_info must be non-NULL and fm will be fre

Re: [PATCH 2/3] virtiofs: split requests that exceed virtqueue size

2021-03-19 Thread Connor Kuehl
On 3/19/21 8:49 AM, Vivek Goyal wrote: On Thu, Mar 18, 2021 at 08:52:22AM -0500, Connor Kuehl wrote: If an incoming FUSE request can't fit on the virtqueue, the request is placed onto a workqueue so a worker can try to resubmit it later where there will (hopefully) be space for it next

Re: [PATCH 2/3] virtiofs: split requests that exceed virtqueue size

2021-03-18 Thread Connor Kuehl
On 3/18/21 10:17 AM, Miklos Szeredi wrote: I removed the conditional compilation and renamed the limit. Also made virtio_fs_get_tree() bail out if it hit the WARN_ON(). Updated patch below. Thanks, Miklos. I think it looks better with those changes. The virtio_ring patch in this series shou

Re: Question about sg_count_fuse_req() in linux/fs/fuse/virtio_fs.c

2021-03-18 Thread Connor Kuehl
On 3/18/21 8:56 AM, Vivek Goyal wrote: I think all the in args are being mapped into a single scatter gather element and that's why it does not matter whether in_numargs is 3, 2 or 1. They will be mapped in a single element. sg_init_fuse_args() { len = fuse_len_args(numargs - argpages,

[PATCH 2/3] virtiofs: split requests that exceed virtqueue size

2021-03-18 Thread Connor Kuehl
is decomposed into a scattergather list and avoid violating section 2.6.5.3.1 of the virtio spec. Signed-off-by: Connor Kuehl --- fs/fuse/fuse_i.h| 5 + fs/fuse/inode.c | 7 +++ fs/fuse/virtio_fs.c | 14 ++ 3 files changed, 26 insertions(+) diff --git a/fs/fus

[PATCH 0/3] virtiofs: split requests that exceed virtqueue size

2021-03-18 Thread Connor Kuehl
lists generated don't exceed the size of the virtqueue. Connor Kuehl (3): virtio_ring: always warn when descriptor chain exceeds queue size virtiofs: split requests that exceed virtqueue size fuse: fix typo for fuse_conn.max_pages comment drivers/virtio/virtio_ring.c | 7 --- fs

[PATCH 3/3] fuse: fix typo for fuse_conn.max_pages comment

2021-03-18 Thread Connor Kuehl
'Maxmum' -> 'Maximum' Signed-off-by: Connor Kuehl --- fs/fuse/fuse_i.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index f0e4ee906464..8bdee79ba593 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@

[PATCH 1/3] virtio_ring: always warn when descriptor chain exceeds queue size

2021-03-18 Thread Connor Kuehl
ed-by: Stefan Hajnoczi Signed-off-by: Connor Kuehl --- drivers/virtio/virtio_ring.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 71e16b53e9c1..1bc290f9ba13 100644 --- a/drivers/virtio/virtio_ring.c +++ b/d

Question about sg_count_fuse_req() in linux/fs/fuse/virtio_fs.c

2021-03-17 Thread Connor Kuehl
Hi, I've been familiarizing myself with the virtiofs guest kernel module and I'm trying to better understand how virtiofs maps a FUSE request into scattergather lists. sg_count_fuse_req() starts knowing that there will be at least one in header, as shown here (which makes sense): u

[PATCH] docs: kvm: fix referenced ioctl symbol

2020-08-19 Thread Connor Kuehl
ude/uapi/linux/kvm.h tools/include/uapi/linux/kvm.h While we're in there, update the KVM API category for KVM_MEMORY_ENCRYPT_OP. It is called on a VM file descriptor. Signed-off-by: Connor Kuehl --- Documentation/virt/kvm/amd-memory-encryption.rst | 6 +++--- Documentation/virt/kvm/api.rst

Re: [PATCH] staging: rtl8188eu: fix null dereference when kzalloc fails

2019-10-03 Thread Connor Kuehl
On 10/1/19 6:11 AM, Dan Carpenter wrote: There is another one earlier in the function as well. drivers/staging/rtl8188eu/os_dep/usb_intf.c 336 337 pnetdev = rtw_init_netdev(padapter); 338 if (!pnetdev) 339 goto free_adapter; 340 SE

[PATCH] staging: rtl8188eu: fix null dereference when kzalloc fails

2019-09-27 Thread Connor Kuehl
s that we're no longer prepared to handle. Also update the debug message to be more consistent with the other debug messages in this function. Addresses-Coverity: ("Dereference after null check") Signed-off-by: Connor Kuehl --- drivers/staging/rtl8188eu/os_dep/usb_intf.c | 6 --

[PATCH v2] staging: rtl8188eu: fix possible null dereference

2019-09-26 Thread Connor Kuehl
dereferenced, then we will dereference a NULL pointer. Fix this by checking if 'psta' is not NULL before reading its 'psta->qos_option' data member. Addresses-Coverity: ("Dereference null return value") Signed-off-by: Connor Kuehl --- v1 -> v2: - Add the sam

Re: [PATCH] staging: rtl8188eu: fix possible null dereference

2019-09-26 Thread Connor Kuehl
On 9/25/19 5:05 PM, Larry Finger wrote: This change is a good one, but why not get the same fix at line 779? Ah yes! Thanks for pointing that out. I missed that. I will send a V2 shortly. Thank you, Connor Larry

[PATCH] staging: rtl8188eu: fix possible null dereference

2019-09-25 Thread Connor Kuehl
dereferenced, then we will dereference a NULL pointer. Fix this by checking if 'psta' is not NULL before reading its 'psta->qos_option' data member. Addresses-Coverity: ("Dereference null return value") Signed-off-by: Connor Kuehl --- drivers/staging/rtl8188e

[PATCH v2] staging: rtl8188eu: remove dead code/vestigial do..while loop

2019-09-24 Thread Connor Kuehl
_down' and 'retry_cnts' While we're in there, also fix some checkpatch.pl suggestions regarding spaces around arithmetic operators like '+' Addresses-Coverity: ("Logically dead code") Signed-off-by: Connor Kuehl --- v1 -> v2: - remove the loop and it

NACK: [PATCH] staging: rtl8188eu: remove dead code in do-while conditional step

2019-09-24 Thread Connor Kuehl
I'm sending a V2 with the loop removed. Thanks, Connor

Re: [PATCH] staging: rtl8188eu: remove dead code in do-while conditional step

2019-09-23 Thread Connor Kuehl
On 9/23/19 1:38 PM, Larry Finger wrote: On 9/23/19 2:48 PM, Connor Kuehl wrote: The local variable 'bcmd_down' is always set to true almost immediately before the do-while's condition is checked. As a result, !bcmd_down evaluates to false which short circuits the logical AND o

[PATCH] staging: rtl8188eu: remove dead code in do-while conditional step

2019-09-23 Thread Connor Kuehl
ode. Addresses-Coverity: ("Logically dead code") Signed-off-by: Connor Kuehl --- drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c b/drivers/staging/rtl8188eu/hal/rtl8188e

[PATCH] staging: rtl8188eu: remove unnecessary self-assignment

2019-09-20 Thread Connor Kuehl
This is a self-assignment which is redundant. Fix this by removing the self-assignment. Addresses-Coverity: ("Self assignment") Signed-off-by: Connor Kuehl --- drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl