[Devel] [PATCH vz9] fs/fuse kio: implement rpc errors collection

2023-07-24 Thread Yuriy Vasilev
Implement collecting rpc errors and exporting them to userspace fuse daemon via relayfs. Errors are grouped per IP addresses and exported as an array. Also move pcs_net* functions to a separate file. Affects: #VSTOR-70161 https://pmc.acronis.work/browse/VSTOR-70161 Signed-off-by: Yuriy Vasilev

[Devel] [PATCH vz9 v2] fs/fuse kio: implement rpc errors collection

2023-07-27 Thread Yuriy Vasilev
://pmc.acronis.work/browse/VSTOR-70161 Signed-off-by: Yuriy Vasilev --- v2: Replace flex array with a single struct containing a 'next' field that refreshes after each successful read, provided there is a next elem in the list. Now, after reading, only head of an rpc errors list is cleaned. Replac

[Devel] [PATCH vz9 v3] fs/fuse kio: implement rpc errors collection

2023-07-27 Thread Yuriy Vasilev
://pmc.acronis.work/browse/VSTOR-70161 Signed-off-by: Yuriy Vasilev --- v2: Replace flex array with a single struct containing a 'next' field that refreshes after each successful read, provided there is a next elem in the list. Now, after reading, only head of an rpc errors list is cleaned. Replac

[Devel] [PATCH vz9] fs/fuse kio: ignore rpc errors with uninitialized addrs

2023-08-11 Thread Yuriy Vasilev
Pass addr with PCS_ADDRTYPE_NONE to netaddr_cmp will lead to BUG. Let's skip these errors. Affects: #VSTOR-73400 Signed-off-by: Yuriy Vasilev --- fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/ki

[Devel] [PATCH VZ9 2/4] fs/fuse kio: introduce try_cslist_get()

2023-11-29 Thread Yuriy Vasilev
This function allows checking if the cslist has been dropped before usage. https://pmc.acronis.work/browse/VSTOR-76384 Signed-off-by: Yuriy Vasilev --- fs/fuse/kio/pcs/pcs_map.h | 12 1 file changed, 12 insertions(+) diff --git a/fs/fuse/kio/pcs/pcs_map.h b/fs/fuse/kio/pcs

[Devel] [PATCH VZ9 3/4] fs/fuse kio: skip handling dropped cslists in pcs_map_notify_addr_change

2023-11-29 Thread Yuriy Vasilev
If try_cslist_get returns false, it indicates that the cslist has been dropped and should not be handled without holding cs->lock. https://pmc.acronis.work/browse/VSTOR-76384 Signed-off-by: Yuriy Vasilev --- fs/fuse/kio/pcs/pcs_map.c | 5 - 1 file changed, 4 insertions(+), 1 delet

[Devel] [PATCH VZ9 4/4] fs/fuse kio: skip truncating dropped cslists

2023-11-29 Thread Yuriy Vasilev
If try_cslist_get returns false, it indicates that the cslist has already been dropped and the map has been truncated. So, this cslist should not be handled. https://pmc.acronis.work/browse/VSTOR-76384 Signed-off-by: Yuriy Vasilev --- fs/fuse/kio/pcs/pcs_map.c | 3 ++- 1 file changed, 2

[Devel] [PATCH VZ9 1/4] fs/fuse kio: do not allow getting cslist when refcnt is equal to 0

2023-11-29 Thread Yuriy Vasilev
When the refcnt of a cslist is equal to 0, it indicates that the cslist has been dropped and is going to be freed. In such cases, let's trigger a BUG_ON to prevent use after free. https://pmc.acronis.work/browse/VSTOR-76384 Signed-off-by: Yuriy Vasilev --- fs/fuse/kio/pcs/pcs_map.h | 2

[Devel] [PATCH VZ7 3/4] fs/fuse kio: skip handling dropped cslists in pcs_map_notify_addr_change

2023-12-15 Thread Yuriy Vasilev
If try_cslist_get returns false, it indicates that the cslist has been dropped and should not be handled without holding cs->lock. https://pmc.acronis.work/browse/VSTOR-76384 Signed-off-by: Yuriy Vasilev --- fs/fuse/kio/pcs/pcs_map.c | 5 - 1 file changed, 4 insertions(+), 1 delet

[Devel] [PATCH VZ7 4/4] fs/fuse kio: skip truncating dropped cslists

2023-12-15 Thread Yuriy Vasilev
If try_cslist_get returns false, it indicates that the cslist has already been dropped and the map has been truncated. So, this cslist should not be handled. https://pmc.acronis.work/browse/VSTOR-76384 Signed-off-by: Yuriy Vasilev --- fs/fuse/kio/pcs/pcs_map.c | 3 ++- 1 file changed, 2

[Devel] [PATCH VZ7 2/4] fs/fuse kio: introduce try_cslist_get()

2023-12-15 Thread Yuriy Vasilev
This function allows checking if the cslist has been dropped before usage. https://pmc.acronis.work/browse/VSTOR-76384 Signed-off-by: Yuriy Vasilev --- fs/fuse/kio/pcs/pcs_map.c | 12 1 file changed, 12 insertions(+) diff --git a/fs/fuse/kio/pcs/pcs_map.c b/fs/fuse/kio/pcs

[Devel] [PATCH VZ7 1/4] fs/fuse kio: do not allow getting cslist when refcnt is equal to 0

2023-12-15 Thread Yuriy Vasilev
When the refcnt of a cslist is equal to 0, it indicates that the cslist has been dropped and is going to be freed. In such cases, let's trigger a BUG_ON to prevent use after free. https://pmc.acronis.work/browse/VSTOR-76384 Signed-off-by: Yuriy Vasilev --- fs/fuse/kio/pcs/pcs_map.c | 2