[PATCH rc v2 2/4] iommufd/selftest: Add missing close(mfd) in memfd_mmap()

2025-06-24 Thread Nicolin Chen
Do not forget to close mfd in the error paths, since none of the callers would close it when ASSERT_NE(MAP_FAILED, buf) fails. Fixes: 0bcceb1f51c7 ("iommufd: Selftest coverage for IOMMU_IOAS_MAP_FILE") Cc: sta...@vger.kernel.org Reviewed-by: Jason Gunthorpe Signed-off-by: Ni

Re: [PATCH rc 2/4] iommufd/selftest: Add missing close(mfd) in memfd_mmap()

2025-06-16 Thread Jason Gunthorpe
On Sun, Jun 15, 2025 at 10:02:04PM -0700, Nicolin Chen wrote: > Do not forget to close mfd in the error paths, since none of the callers > would close it when ASSERT_NE(MAP_FAILED, buf) fails. > > Fixes: 0bcceb1f51c7 ("iommufd: Selftest coverage for IOMMU_IOAS_MAP

[PATCH rc 2/4] iommufd/selftest: Add missing close(mfd) in memfd_mmap()

2025-06-15 Thread Nicolin Chen
Do not forget to close mfd in the error paths, since none of the callers would close it when ASSERT_NE(MAP_FAILED, buf) fails. Fixes: 0bcceb1f51c7 ("iommufd: Selftest coverage for IOMMU_IOAS_MAP_FILE") Cc: sta...@vger.kernel.org Signed-off-by: Nicolin Chen --- tools/testing/selft

Re: [PATCH net-next v6 5/5] vsock/test: Add test for an unexpectedly lingering close()

2025-05-22 Thread Stefano Garzarella
On Thu, May 22, 2025 at 01:18:25AM +0200, Michal Luczaj wrote: There was an issue with SO_LINGER: instead of blocking until all queued messages for the socket have been successfully sent (or the linger timeout has been reached), close() would block until packets were handled by the peer. Add a

Re: [PATCH net-next v5 5/5] vsock/test: Add test for an unexpectedly lingering close()

2025-05-21 Thread Michal Luczaj
On 5/21/25 16:56, Stefano Garzarella wrote: > On Wed, May 21, 2025 at 12:55:23AM +0200, Michal Luczaj wrote: >> There was an issue with SO_LINGER: instead of blocking until all queued >> messages for the socket have been successfully sent (or the linger timeout >> has been re

[PATCH net-next v6 5/5] vsock/test: Add test for an unexpectedly lingering close()

2025-05-21 Thread Michal Luczaj
There was an issue with SO_LINGER: instead of blocking until all queued messages for the socket have been successfully sent (or the linger timeout has been reached), close() would block until packets were handled by the peer. Add a test to alert on close() lingering when it should not. Signed

Re: [PATCH net-next v5 5/5] vsock/test: Add test for an unexpectedly lingering close()

2025-05-21 Thread Stefano Garzarella
On Wed, May 21, 2025 at 12:55:23AM +0200, Michal Luczaj wrote: There was an issue with SO_LINGER: instead of blocking until all queued messages for the socket have been successfully sent (or the linger timeout has been reached), close() would block until packets were handled by the peer. Add a

[PATCH net-next v5 5/5] vsock/test: Add test for an unexpectedly lingering close()

2025-05-20 Thread Michal Luczaj
There was an issue with SO_LINGER: instead of blocking until all queued messages for the socket have been successfully sent (or the linger timeout has been reached), close() would block until packets were handled by the peer. Add a test to alert on close() lingering when it should not. Signed

Re: [PATCH net-next v4 3/3] vsock/test: Expand linger test to ensure close() does not misbehave

2025-05-20 Thread Stefano Garzarella
>> On Thu, May 01, 2025 at 10:05:24AM +0200, Michal Luczaj wrote: > > >>>>>> There was an issue with SO_LINGER: instead of blocking until all > > >>>>>> queued > > >>>>>> messages for the socket have been successfully sent (or th

Re: [PATCH net-next v4 3/3] vsock/test: Expand linger test to ensure close() does not misbehave

2025-05-20 Thread Stefano Garzarella
sue with SO_LINGER: instead of blocking until all queued > >>>>>> messages for the socket have been successfully sent (or the linger > >>>>>> timeout > >>>>>> has been reached), close() would block until packets were handled by > >>&

Re: [PATCH net-next v4 3/3] vsock/test: Expand linger test to ensure close() does not misbehave

2025-05-20 Thread Stefano Garzarella
+0200, Michal Luczaj wrote: There was an issue with SO_LINGER: instead of blocking until all queued messages for the socket have been successfully sent (or the linger timeout has been reached), close() would block until packets were handled by the peer. This is a new behaviour that only new

Re: [PATCH net-next v4 3/3] vsock/test: Expand linger test to ensure close() does not misbehave

2025-05-12 Thread Michal Luczaj
M +0200, Michal Luczaj wrote: >>>>> There was an issue with SO_LINGER: instead of blocking until all queued >>>>> messages for the socket have been successfully sent (or the linger timeout >>>>> has been reached), close() would block until packets were h

Re: [PATCH net-next v4 3/3] vsock/test: Expand linger test to ensure close() does not misbehave

2025-05-07 Thread Stefano Garzarella
with SO_LINGER: instead of blocking until all queued > >>> messages for the socket have been successfully sent (or the linger timeout > >>> has been reached), close() would block until packets were handled by the > >>> peer. > >> > >> This is a

Re: [PATCH net-next v4 3/3] vsock/test: Expand linger test to ensure close() does not misbehave

2025-05-06 Thread Michal Luczaj
the socket have been successfully sent (or the linger timeout >>> has been reached), close() would block until packets were handled by the >>> peer. >> >> This is a new behaviour that only new kernels will follow, so I think >> it is better to add a new

Re: [PATCH net-next v4 3/3] vsock/test: Expand linger test to ensure close() does not misbehave

2025-05-06 Thread Stefano Garzarella
gt; >has been reached), close() would block until packets were handled by the > >peer. > > This is a new behaviour that only new kernels will follow, so I think > it is better to add a new test instead of extending a pre-existing test > that we described as "SOCK_STREAM SO_

Re: [PATCH net-next v4 3/3] vsock/test: Expand linger test to ensure close() does not misbehave

2025-05-06 Thread Stefano Garzarella
On Thu, May 01, 2025 at 10:05:24AM +0200, Michal Luczaj wrote: There was an issue with SO_LINGER: instead of blocking until all queued messages for the socket have been successfully sent (or the linger timeout has been reached), close() would block until packets were handled by the peer. This

[PATCH net-next v4 3/3] vsock/test: Expand linger test to ensure close() does not misbehave

2025-05-01 Thread Michal Luczaj
There was an issue with SO_LINGER: instead of blocking until all queued messages for the socket have been successfully sent (or the linger timeout has been reached), close() would block until packets were handled by the peer. Add a check to alert on close() lingering when it should not. Signed

[PATCH net-next v3 4/4] vsock/test: Expand linger test to ensure close() does not misbehave

2025-04-30 Thread Michal Luczaj
There was an issue with SO_LINGER: instead of blocking until all queued messages for the socket have been successfully sent (or the linger timeout has been reached), close() would block until packets were handled by the peer. Add a check to alert on close() lingering when it should not. Signed

[PATCH net-next v2 3/3] vsock/test: Expand linger test to ensure close() does not misbehave

2025-04-21 Thread Michal Luczaj
There was an issue with SO_LINGER: instead of blocking until all queued messages for the socket have been successfully sent (or the linger timeout has been reached), close() would block until packets were handled by the peer. Add a check to alert on close() lingering when it should not. Signed

Re: [PATCH 4/4] sysctl: Close test ctl_headers with a for loop

2025-04-10 Thread Kees Cook
On Fri, Mar 21, 2025 at 01:47:27PM +0100, Joel Granados wrote: > As more tests are added, the exit function gets longer than it should > be. Condense the un-register calls into a for loop to make it easier to > add/remove tests. > > Signed-off-by: Joel Granados Much cleaner too. :) Reviewed-by:

Re: [PATCH RESEND bpf-next v2] selftests/bpf: close the file descriptor to avoid resource leaks

2025-04-09 Thread Andrii Nakryiko
read_mem_cgrp_file(const char *name, > unsigned long *value) > } > > got = read(fd, buf, sizeof(buf) - 1); > + close(fd); > if (got <= 0) { > *value = 0; > return; > @@ -286,8 +287,6 @@ static void htab_mem

Re: [PATCH RESEND bpf-next v2] selftests/bpf: close the file descriptor to avoid resource leaks

2025-04-09 Thread Alexei Starovoitov
On Wed, Apr 9, 2025 at 4:28 PM Andrii Nakryiko wrote: > > On Tue, Apr 8, 2025 at 11:33 AM Malaya Kumar Rout > wrote: > > > > Static Analyis for bench_htab_mem.c with cppcheck:error > > typo: analysis (lower case and typo) > > you can also make into a bit more human-readable sentence: > > "Static

Re:[PATCH RESEND bpf-next v2] selftests/bpf: close the file descriptor to avoid resource leaks

2025-04-08 Thread Malaya Kumar Rout
le(const char *name, unsigned long *value) } got = read(fd, buf, sizeof(buf) - 1); + close(fd); if (got <= 0) { *value = 0; return; @@ -286,8 +287,6 @@ static void htab_mem_read_mem_cgrp_file(const char *name, unsigned

Re: [PATCH v2] selftests/bpf: close the file descriptor to avoid resource leaks

2025-04-08 Thread Hou Tao
mem_read_mem_cgrp_file(const char *name, > unsigned long *value) > } > > got = read(fd, buf, sizeof(buf) - 1); > + close(fd); > if (got <= 0) { > *value = 0; > return; > @@ -286,8 +287,6 @@ static void htab_mem_read_

Re:[PATCH v2] selftests/bpf: close the file descriptor to avoid resource leaks

2025-04-07 Thread Malaya Kumar Rout
le(const char *name, unsigned long *value) } got = read(fd, buf, sizeof(buf) - 1); + close(fd); if (got <= 0) { *value = 0; return; @@ -286,8 +287,6 @@ static void htab_mem_read_mem_cgrp_file(const char *name, unsigned

Re: [PATCH] selftests/bpf: close the file descriptor to avoid resource leaks

2025-04-06 Thread malaya kumar rout
b_mem.c > >>> b/tools/testing/selftests/bpf/benchs/bench_htab_mem.c > >>> index 926ee822143e..59746fd2c23a 100644 > >>> --- a/tools/testing/selftests/bpf/benchs/bench_htab_mem.c > >>> +++ b/tools/testing/selftests/bpf/benchs/bench_htab_mem.c > >>>

Re: [PATCH] selftests/bpf: close the file descriptor to avoid resource leaks

2025-04-06 Thread Hou Tao
bpf/benchs/bench_htab_mem.c >>> +++ b/tools/testing/selftests/bpf/benchs/bench_htab_mem.c >>> @@ -281,6 +281,7 @@ static void htab_mem_read_mem_cgrp_file(const char >>> *name, unsigned long *value) >>> got = read(fd, buf, sizeof(buf) - 1); >> It could be a

Re: [PATCH] selftests/bpf: close the file descriptor to avoid resource leaks

2025-04-04 Thread malaya kumar rout
81,7 @@ static void htab_mem_read_mem_cgrp_file(const char > > *name, unsigned long *value) > > got = read(fd, buf, sizeof(buf) - 1); > > It could be a bit cleaner to add close(fd) here and drop the one we > have at the end of the function. > Here, close(fd) is now

[PATCH 4/4] sysctl: Close test ctl_headers with a for loop

2025-04-04 Thread Joel Granados
As more tests are added, the exit function gets longer than it should be. Condense the un-register calls into a for loop to make it easier to add/remove tests. Signed-off-by: Joel Granados --- lib/test_sysctl.c | 65 +-- 1 file changed, 29 inse

Re: [PATCH] selftests/bpf: close the file descriptor to avoid resource leaks

2025-04-04 Thread Andrii Nakryiko
/testing/selftests/bpf/benchs/bench_htab_mem.c > +++ b/tools/testing/selftests/bpf/benchs/bench_htab_mem.c > @@ -281,6 +281,7 @@ static void htab_mem_read_mem_cgrp_file(const char *name, > unsigned long *value) > got = read(fd, buf, sizeof(buf) - 1); It could be a bit cleaner to add

Re: [PATCH] selftests/bpf: close the file descriptor to avoid resource leaks

2025-03-31 Thread Hou Tao
tab_mem_read_mem_cgrp_file(const char *name, > unsigned long *value) > got = read(fd, buf, sizeof(buf) - 1); > if (got <= 0) { > *value = 0; > + close(fd); > return; > } > buf[got] = 0; > diff --git a/too

[PATCH net 3/4] selftests: mptcp: close fd_in before returning in main_loop

2025-03-28 Thread Matthieu Baerts (NGI0)
(void) ret = copyfd_io(fd_in, fd, 1, 0, &winfo); if (ret) - return ret; + goto out; if (cfg_truncate > 0) { shutdown(fd, SHUT_WR); @@ -1320,7 +1320,10 @@ int main_loop(void) close(fd); } - return 0;

[PATCH] selftests/bpf: close the file descriptor to avoid resource leaks

2025-03-23 Thread Malaya Kumar Rout
le(const char *name, unsigned long *value) got = read(fd, buf, sizeof(buf) - 1); if (got <= 0) { *value = 0; + close(fd); return; } buf[got] = 0; diff --git a/tools/testing/selftests/bpf/prog_tests/sk_assign.c b/to

Re: [PATCH v2] selftests/mount: Close 'fd' when write fails

2025-02-23 Thread Ritvik Gupta
> Yes, the kernel will handle the 'fd' cleanup automatically, but > the existing implementation already closes it before exiting. ^^^ Whoops! I meant 'returning' there. Wording issue on my part :P We're referring to the same thing! Thanks

Re: [PATCH v2] selftests/mount: Close 'fd' when write fails

2025-02-22 Thread Seyediman Seyedarab
Nevertheless it's subjective indeed. > Thanks for reviewing! > > Regards > Ritvik The current implementation doesn't close the fd before calling the die() function. It only closes fd before returning because vmaybe_write_file() doesn't necessarily exit the process. It only

Re: [PATCH v2] selftests/mount: Close 'fd' when write fails

2025-02-22 Thread Ritvik Gupta
Yes, the kernel will handle the 'fd' cleanup automatically, but the existing implementation already closes it before exiting. However, in case where write fails, its unhandled. This patch addresses that gap :) Nevertheless it's subjective indeed. Thanks for reviewing! Regards Ritvik

Re: [PATCH v2] selftests/mount: Close 'fd' when write fails

2025-02-22 Thread Seyediman Seyedarab
On 25/02/22 05:42PM, ritvikf...@gmail.com wrote: > From: Ritvik Gupta > > 1. Close the file descriptor when write fails. > 2. Introduce 'close_or_die' helper function to > reduce repetition. > > Signed-off-by: Ritvik Gupta > --- > Changes in v2: >

[PATCH v2] selftests/mount: Close 'fd' when write fails

2025-02-22 Thread ritvikfoss
From: Ritvik Gupta 1. Close the file descriptor when write fails. 2. Introduce 'close_or_die' helper function to reduce repetition. Signed-off-by: Ritvik Gupta --- Changes in v2: - Fixed formatting .../selftests/mount/unprivileged-remount-test.c| 14 ++ 1 file c

[PATCH] selftests/mount: Close 'fd' when write fails

2025-02-22 Thread ritvikfoss
From: Ritvik Gupta 1. Close the file descriptor when write fails. 2. Introduce 'close_or_die' helper function to reduce repetition. Signed-off-by: Ritvik Gupta --- .../selftests/mount/unprivileged-remount-test.c | 13 + 1 file changed, 9 insertions(+), 4 deletion

[PATCH rcu v2] 04/11] rcutorture: Expand failure/close-call grace-period output

2025-01-30 Thread Paul E. McKenney
With only eight bits per grace-period sequence number, wrap can happen in 64 grace periods. This commit therefore increases this to sixteen bits for normal grace-period sequence numbers and the combined short-form polling sequence numbers, thus deferring wrap for at least 16,384 grace periods. Be

[PATCH rcu v2] 06/11] rcutorture: Add ftrace-compatible timestamp to GP# failure/close-call output

2025-01-30 Thread Paul E. McKenney
This commit adds an ftrace-compatible microsecond-scale timestamp to the failure/close-call output, but only in kernels built with CONFIG_RCU_TORTURE_TEST_LOG_GP=y. Signed-off-by: Paul E. McKenney --- kernel/rcu/rcutorture.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff

[PATCH rcu v2] 03/11] rcutorture: Include grace-period sequence numbers in failure/close-call

2025-01-30 Thread Paul E. McKenney
This commit includes the grace-period sequence numbers at the beginning and end of each segment in the "Failure/close-call rcutorture reader segments" list. These are in hexadecimal, and only the bottom byte. Currently, only RCU is supported, with its three sequence numbers (normal,

[PATCH rcu 06/11] rcutorture: Add ftrace-compatible timestamp to GP# failure/close-call output

2025-01-16 Thread Paul E. McKenney
This commit adds an ftrace-compatible microsecond-scale timestamp to the failure/close-call output, but only in kernels built with CONFIG_RCU_TORTURE_TEST_LOG_GP=y. Signed-off-by: Paul E. McKenney --- kernel/rcu/rcutorture.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff

[PATCH rcu 03/11] rcutorture: Include grace-period sequence numbers in failure/close-call

2025-01-16 Thread Paul E. McKenney
This commit includes the grace-period sequence numbers at the beginning and end of each segment in the "Failure/close-call rcutorture reader segments" list. These are in hexadecimal, and only the bottom byte. Currently, only RCU is supported, with its three sequence numbers (normal,

[PATCH rcu 04/11] rcutorture: Expand failure/close-call grace-period output

2025-01-16 Thread Paul E. McKenney
With only eight bits per grace-period sequence number, wrap can happen in 64 grace periods. This commit therefore increases this to sixteen bits for normal grace-period sequence numbers and the combined short-form polling sequence numbers, thus deferring wrap for at least 16,384 grace periods. Be

Re: [PATCH net v2 3/5] vsock/virtio: cancel close work in the destructor

2025-01-10 Thread Hyunwoo Kim
> But in the latter case, the destructor is called by AF_VSOCK core, just > after the release(), so there may still be delayed work scheduled. > > Refactor the code, moving the code to delete the close work already in > the do_close() to a new function. Invoke it during destruction t

Re: [PATCH net v2 3/5] vsock/virtio: cancel close work in the destructor

2025-01-10 Thread Luigi Leonardi
by AF_VSOCK core, just after the release(), so there may still be delayed work scheduled. Refactor the code, moving the code to delete the close work already in the do_close() to a new function. Invoke it during destruction to make sure we don't leave any pending work. Fixes: c0cfa2d8a788 (&

[PATCH net v2 3/5] vsock/virtio: cancel close work in the destructor

2025-01-10 Thread Stefano Garzarella
delayed work scheduled. Refactor the code, moving the code to delete the close work already in the do_close() to a new function. Invoke it during destruction to make sure we don't leave any pending work. Fixes: c0cfa2d8a788 ("vsock: add multi-transports support") Cc: sta...@vger.kernel.

Re: [PATCH] selftests/bpf: Removed redundant fd after close in bpf_prog_load_log_buf

2024-10-10 Thread patchwork-bot+netdevbpf
adability and removes redundant operations. > > Signed-off-by: Zhu Jun > --- > tools/testing/selftests/bpf/prog_tests/log_buf.c | 3 --- > 1 file changed, 3 deletions(-) Here is the summary with links: - selftests/bpf: Removed redundant fd after close in bpf_prog_load_log_buf

[PATCH] selftests/bpf: Removed redundant fd after close in bpf_prog_load_log_buf

2024-10-09 Thread Zhu Jun
+169,6 @@ static void bpf_prog_load_log_buf(void) ASSERT_GE(fd, 0, "good_fd1"); if (fd >= 0) close(fd); - fd = -1; /* log_level == 2 should always fill log_buf, even for good prog */ log_buf[0] = '\0'; @@ -180,

[PATCH v3 0/4] close various race windows for swap

2021-04-20 Thread Miaohe Lin
reduce the performance overhead on the hot-path as much as possible, it appears we can use the percpu_ref to close this race window(as suggested by Huang, Ying). The patch 1 adds percpu_ref support for swap and most of the remaining patches try to use this to close various race windows. More details can

[PATCH 5.10 083/103] ch_ktls: tcb close causes tls connection failure

2021-04-19 Thread Greg Kroah-Hartman
o/inline_crypto/ch_ktls/chcr_ktls.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c @@ -355,18 +355,6 @@ static int chcr_set_tcb_field(struct chc } /* - * chcr_ktls_mark_tcb_close: mark tcb state to CLOSE - * @tx_info - driver specific tls info. - * return: NET_TX_OK/NET_XMIT_DRO

[PATCH 5.10 082/103] ch_ktls: fix device connection close

2021-04-19 Thread Greg Kroah-Hartman
From: Vinay Kumar Yadav commit bc16efd2430652f894ae34b1de5eccc3bf0d2810 upstream. When sge queue is full and chcr_ktls_xmit_wr_complete() returns failure, skb is not freed if it is not the last tls record in this skb, causes refcount never gets freed and tls_dev_del() never gets called on this c

[PATCH 5.11 100/122] ch_ktls: tcb close causes tls connection failure

2021-04-19 Thread Greg Kroah-Hartman
o/inline_crypto/ch_ktls/chcr_ktls.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c @@ -355,18 +355,6 @@ static int chcr_set_tcb_field(struct chc } /* - * chcr_ktls_mark_tcb_close: mark tcb state to CLOSE - * @tx_info - driver specific tls info. - * return: NET_TX_OK/NET_XMIT_DRO

[PATCH 5.11 099/122] ch_ktls: fix device connection close

2021-04-19 Thread Greg Kroah-Hartman
From: Vinay Kumar Yadav commit bc16efd2430652f894ae34b1de5eccc3bf0d2810 upstream. When sge queue is full and chcr_ktls_xmit_wr_complete() returns failure, skb is not freed if it is not the last tls record in this skb, causes refcount never gets freed and tls_dev_del() never gets called on this c

[PATCH v2 0/5] close various race windows for swap

2021-04-17 Thread Miaohe Lin
reduce the performance overhead on the hot-path as much as possible, it appears we can use the percpu_ref to close this race window(as suggested by Huang, Ying). The patch 1 adds percpu_ref support for swap and most of the remaining patches try to use this to close various race windows. More details can

[PATCH v2 3/5] staging: rtl8192e: remove unnecessary blank line after close brace

2021-04-13 Thread Mitali Borkar
Removed an extra blank line after close brace '{' as it was not necessary. Reported by checkpatch Signed-off-by: Mitali Borkar --- Changes from v1:- No changes. drivers/staging/rtl8192e/rtl819x_HTProc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/stagin

[PATCH 5.11 153/210] RDMA/rtrs-clt: Close rtrs client conn before destroying rtrs clt session files

2021-04-12 Thread Greg Kroah-Hartman
ll the present rtrs_clt_sess and triggers close on them. However, the call to rtrs_clt_destroy_sess_files is done before the rtrs_clt_close_conns. This is incorrect since during the initialization phase we allocate rtrs_clt_sess first, and then we go ahead and create rtrs_clt_con for it. If we fr

[PATCH 5.10 138/188] RDMA/rtrs-clt: Close rtrs client conn before destroying rtrs clt session files

2021-04-12 Thread Greg Kroah-Hartman
ll the present rtrs_clt_sess and triggers close on them. However, the call to rtrs_clt_destroy_sess_files is done before the rtrs_clt_close_conns. This is incorrect since during the initialization phase we allocate rtrs_clt_sess first, and then we go ahead and create rtrs_clt_con for it. If we fr

[PATCH v1 4/8] scsi: megaraid: clean up for open/close brace

2021-04-09 Thread Luo Jiaxing
There are few kinds of error about open/close brace is reported by checkpatch.pl: ERROR: open brace '{' following function definitions go on the next line int megasas_sync_pd_seq_num(struct megasas_instance *instance, bool pend) { ERROR: else should follow close brace '}' +

Re: [PATCH 0/5] close various race windows for swap

2021-04-09 Thread Miaohe Lin
inst concurrent swapoff for >> swap_readpage() looks terrible because swap_readpage() may take really >> long time. And to reduce the performance overhead on the hot-path as >> much as possible, it appears we can use the percpu_ref to close this >> race window(as suggested by Huang

Re: [PATCH 0/5] close various race windows for swap

2021-04-08 Thread riteshh
errible because swap_readpage() may take really > long time. And to reduce the performance overhead on the hot-path as > much as possible, it appears we can use the percpu_ref to close this > race window(as suggested by Huang, Ying). The patch 1 adds percpu_ref > support for swap and the rest

[PATCH 0/5] close various race windows for swap

2021-04-08 Thread Miaohe Lin
reduce the performance overhead on the hot-path as much as possible, it appears we can use the percpu_ref to close this race window(as suggested by Huang, Ying). The patch 1 adds percpu_ref support for swap and the rest of the patches use this to close various race windows. More details can be found in

[PATCH 4/8] drm/msm: Split iova purge and close

2021-04-05 Thread Rob Clark
/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -357,9 +357,14 @@ static void del_vma(struct msm_gem_vma *vma) kfree(vma); } -/* Called with msm_obj locked */ +/** + * If close is true, this also closes the VMA (releasing the allocated + * iova range) in addition to removing the iommu

[PATCH printk v2 5/5] printk: syslog: close window between wait and read

2021-03-30 Thread John Ogness
Syslog's SYSLOG_ACTION_READ is supposed to block until the next syslog record can be read, and then it should read that record. However, because @syslog_lock is not held between waking up and reading the record, another reader could read the record first, thus causing SYSLOG_ACTION_READ to return w

Re: [PATCH net-next] net: lapbether: Close the LAPB device before its underlying Ethernet device closes

2021-03-18 Thread patchwork-bot+netdevbpf
e Ethernet device > closes. It would be better to close it before the Ethernet device closes. > This would allow the LAPB device to transmit a last frame to notify the > other side that it is disconnecting. > > [...] Here is the summary with links: - [net-next] net: lapbether:

[PATCH net-next] net: lapbether: Close the LAPB device before its underlying Ethernet device closes

2021-03-18 Thread Xie He
When a virtual LAPB device's underlying Ethernet device closes, the LAPB device is also closed. However, currently the LAPB device is closed after the Ethernet device closes. It would be better to close it before the Ethernet device closes. This would allow the LAPB device to transmit a

[PATCH 5.10 196/290] cifs: do not send close in compound create+close requests

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Paulo Alcantara commit 04ad69c342fc4de5bd23be9ef15ea7574fb1a87e upstream. In case of interrupted syscalls, prevent sending CLOSE commands for compound CREATE+CLOSE requests by introducing an CIFS_CP_CREATE_CLOSE_OP flag to indicate lower layers that it should

[PATCH 5.11 192/306] cifs: do not send close in compound create+close requests

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Paulo Alcantara commit 04ad69c342fc4de5bd23be9ef15ea7574fb1a87e upstream. In case of interrupted syscalls, prevent sending CLOSE commands for compound CREATE+CLOSE requests by introducing an CIFS_CP_CREATE_CLOSE_OP flag to indicate lower layers that it should

[PATCH 5.11 123/306] mptcp: reset last_snd on subflow close

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Florian Westphal [ Upstream commit e0be4931f3fee2e04dec4013ea4f27ec2db8556f ] Send logic caches last active subflow in the msk, so it needs to be cleared when the cached subflow is closed. Fixes: d5f49190def61c ("mptcp: allow picking different xmit subflows") Cl

[PATCH 4.19 10/39] Revert "zram: close udev startup race condition as default groups"

2021-03-10 Thread gregkh
From: Greg Kroah-Hartman From: Jeffle Xu This reverts commit 9e07f4e243791e00a4086ad86e573705cf7b2c65. The original commit is actually a "merged" fix of [1] and [2], as described in [3]. Since now we have more fixes that rely on [1], revert this commit first, and then get the original [1] and

[PATCH 5/5] habanalabs: print if device is used on FD close

2021-02-22 Thread Oded Gabbay
Notify to the user that although he closed the FD, the device is still in use because there are live CS and/or memory mappings (mmaps). Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 8 +--- drivers/misc/habanalabs/common/habanalabs.h | 2 +- 2 files changed, 6

[PATCH 5.10 081/120] drm/i915/gt: Close race between enable_breadcrumbs and cancel_breadcrumbs

2021-02-08 Thread Greg Kroah-Hartman
From: Chris Wilson commit e4747cb3ec3c232d65c84cbe77633abd5871fda3 upstream. If we enable_breadcrumbs for a request while that request is being removed from HW; we may see that the request is active as we take the ce->signal_lock and proceed to attach the request to ce->signals. However, during

[RFC: timer passthrough 8/9] KVM: vmx: Dynamically open or close the timer-passthrough for pre-vm

2021-02-05 Thread Zhimin Feng
Timer passthrough is default disabled Signed-off-by: Zhimin Feng --- arch/x86/include/asm/kvm_host.h | 3 +-- arch/x86/kvm/lapic.c| 10 +--- arch/x86/kvm/vmx/vmx.c | 52 + arch/x86/kvm/x86.c | 6 + include/linux/

[PATCH 4.14 23/50] pNFS: Mark layout for return if return-on-close was not sent

2021-01-22 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 67bbceedc9bb8ad48993a8bd6486054756d711f4 upstream. If the layout return-on-close failed because the layoutreturn was never sent, then we should mark the layout for return again. Fixes: 9c47b18cf722 ("pNFS: Ensure we do clear the return-on-close layout state

Re: [PATCH] USB: serial: cp210x: suppress modem-control error on open and close

2021-01-21 Thread Johan Hovold
-32 > > Add a crtscts flag to keep track of the hardware flow-control setting > and use it to suppress the request in dtr_rts(). > > Note that both lines are still deasserted when disabling the UART as > part of close(). > > Also note that TIOCMSET is left unchanged an

[PATCH] USB: serial: cp210x: suppress modem-control error on open and close

2021-01-21 Thread Johan Hovold
it to suppress the request in dtr_rts(). Note that both lines are still deasserted when disabling the UART as part of close(). Also note that TIOCMSET is left unchanged and will continue to return an error to user-space when flow control is enabled (i.e. instead of disabling and re-enabling auto

[PATCH 5.4 23/76] cifs: fix interrupted close commands

2021-01-18 Thread Greg Kroah-Hartman
From: Paulo Alcantara [ Upstream commit 2659d3bff3e1b000f49907d0839178b101a89887 ] Retry close command if it gets interrupted to not leak open handles on the server. Signed-off-by: Paulo Alcantara (SUSE) Reported-by: Duncan Findlay Suggested-by: Pavel Shilovsky Fixes: 6988a619f5b7 ("

[PATCH 4.19 30/43] pNFS: Mark layout for return if return-on-close was not sent

2021-01-18 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 67bbceedc9bb8ad48993a8bd6486054756d711f4 upstream. If the layout return-on-close failed because the layoutreturn was never sent, then we should mark the layout for return again. Fixes: 9c47b18cf722 ("pNFS: Ensure we do clear the return-on-close layout state

[PATCH 5.4 22/76] smb3: remove unused flag passed into close functions

2021-01-18 Thread Greg Kroah-Hartman
From: Steve French [ Upstream commit 9e8fae2597405ab1deac8909928eb8e99876f639 ] close was relayered to allow passing in an async flag which is no longer needed in this path. Remove the unneeded parameter "flags" passed in on close. Signed-off-by: Steve French Reviewed-by: Pavel

[PATCH 5.4 57/76] pNFS: Mark layout for return if return-on-close was not sent

2021-01-18 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 67bbceedc9bb8ad48993a8bd6486054756d711f4 upstream. If the layout return-on-close failed because the layoutreturn was never sent, then we should mark the layout for return again. Fixes: 9c47b18cf722 ("pNFS: Ensure we do clear the return-on-close layout state

[PATCH 5.4 56/76] pNFS: We want return-on-close to complete when evicting the inode

2021-01-18 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 078000d02d57f02dde61de4901f289672e98c8bc upstream. If the inode is being evicted, it should be safe to run return-on-close, so we should do it to ensure we don't inadvertently leak layout segments. Fixes: 1c5bd76d17cc ("pNFS: Enable layoutreturn ope

[PATCH 5.10 024/152] cifs: fix interrupted close commands

2021-01-18 Thread Greg Kroah-Hartman
From: Paulo Alcantara commit 2659d3bff3e1b000f49907d0839178b101a89887 upstream. Retry close command if it gets interrupted to not leak open handles on the server. Signed-off-by: Paulo Alcantara (SUSE) Reported-by: Duncan Findlay Suggested-by: Pavel Shilovsky Fixes: 6988a619f5b7 ("

[PATCH 5.10 122/152] pNFS: We want return-on-close to complete when evicting the inode

2021-01-18 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 078000d02d57f02dde61de4901f289672e98c8bc upstream. If the inode is being evicted, it should be safe to run return-on-close, so we should do it to ensure we don't inadvertently leak layout segments. Fixes: 1c5bd76d17cc ("pNFS: Enable layoutreturn ope

[PATCH 5.10 123/152] pNFS: Mark layout for return if return-on-close was not sent

2021-01-18 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 67bbceedc9bb8ad48993a8bd6486054756d711f4 upstream. If the layout return-on-close failed because the layoutreturn was never sent, then we should mark the layout for return again. Fixes: 9c47b18cf722 ("pNFS: Ensure we do clear the return-on-close layout state

[PATCH 5.10 097/103] block/rnbd-clt: avoid module unload race with close confirmation

2021-01-15 Thread Greg Kroah-Hartman
From: Jack Wang commit 3a21777c6ee99749bac10727b3c17e5bcfebe5c1 upstream. We had kernel panic, it is caused by unload module and last close confirmation. call trace: [1196029.743127] free_sess+0x15/0x50 [rtrs_client] [1196029.743128] rtrs_clt_close+0x4c/0x70 [rtrs_client] [1196029.743129

[PATCH 5.10 007/103] drm/panfrost: Dont corrupt the queue mutex on open/close

2021-01-15 Thread Greg Kroah-Hartman
From: Steven Price [ Upstream commit a17d609e3e216c406f7c0cec2a94086a4401ac06 ] The mutex within the panfrost_queue_state should have the lifetime of the queue, however it was erroneously initialised/destroyed during panfrost_job_{open,close} which is called every time a client opens/closes the

[PATCH 4.19 39/77] Bluetooth: revert: hci_h5: close serdev device and free hu in h5_close

2021-01-11 Thread Greg Kroah-Hartman
From: Hans de Goede commit 5c3b5796866f85354a5ce76a28f8ffba0dcefc7e upstream. There have been multiple revisions of the patch fix the h5->rx_skb leak. Accidentally the first revision (which is buggy) and v5 have both been merged: v1 commit 70f259a3f427 ("Bluetooth: hci_h5: close serde

[PATCH 5.4 47/92] Bluetooth: revert: hci_h5: close serdev device and free hu in h5_close

2021-01-11 Thread Greg Kroah-Hartman
From: Hans de Goede commit 5c3b5796866f85354a5ce76a28f8ffba0dcefc7e upstream. There have been multiple revisions of the patch fix the h5->rx_skb leak. Accidentally the first revision (which is buggy) and v5 have both been merged: v1 commit 70f259a3f427 ("Bluetooth: hci_h5: close serde

[PATCH 5.10 069/145] Bluetooth: revert: hci_h5: close serdev device and free hu in h5_close

2021-01-11 Thread Greg Kroah-Hartman
From: Hans de Goede commit 5c3b5796866f85354a5ce76a28f8ffba0dcefc7e upstream. There have been multiple revisions of the patch fix the h5->rx_skb leak. Accidentally the first revision (which is buggy) and v5 have both been merged: v1 commit 70f259a3f427 ("Bluetooth: hci_h5: close serde

Re: [PATCH 0/2] drivers:tty:pty: Fix a race causing data loss on close

2021-01-07 Thread Greg Kroah-Hartman
t a bad idea. > > >From what I can tell, the tty_vhangup() is there in case there was a > console redirect to the pty slave. When you close the master, you need > to release the redirect. I didn't see another reason for tty_vhangup(). > So this has two parts, export the

Re: [PATCH 2/2] drivers:tty:pty: Fix a race causing data loss on close

2021-01-07 Thread Greg Kroah-Hartman
On Sat, Jan 02, 2021 at 08:41:09AM -0600, Corey Minyard wrote: > On Mon, Nov 23, 2020 at 06:49:02PM -0600, miny...@acm.org wrote: > > From: Corey Minyard > > > > Remove the tty_vhangup() from the pty code and just release the > > redirect. The tty_vhangup() results in data loss and data out of o

Re: [PATCH net-next] net: nfc: nci: Change the NCI close sequence

2021-01-05 Thread David Miller
From: Bongsu Jeon Date: Mon, 28 Dec 2020 10:46:31 +0900 > From: Bongsu Jeon > > Change the NCI close sequence because the NCI Command timer should be > deleted after flushing the NCI command work queue. > > Signed-off-by: Bongsu Jeon Applied.

[PATCH 4.19 15/29] Bluetooth: hci_h5: close serdev device and free hu in h5_close

2021-01-05 Thread Greg Kroah-Hartman
From: Anant Thazhemadam commit 70f259a3f4276b71db365b1d6ff1eab805ea6ec3 upstream. When h5_close() gets called, the memory allocated for the hu gets freed only if hu->serdev doesn't exist. This leads to a memory leak. So when h5_close() is requested, close the serdev device instance and

[PATCH 5.4 25/47] Bluetooth: hci_h5: close serdev device and free hu in h5_close

2021-01-04 Thread Greg Kroah-Hartman
From: Anant Thazhemadam commit 70f259a3f4276b71db365b1d6ff1eab805ea6ec3 upstream. When h5_close() gets called, the memory allocated for the hu gets freed only if hu->serdev doesn't exist. This leads to a memory leak. So when h5_close() is requested, close the serdev device instance and

[PATCH 5.10 27/63] Bluetooth: hci_h5: close serdev device and free hu in h5_close

2021-01-04 Thread Greg Kroah-Hartman
From: Anant Thazhemadam commit 70f259a3f4276b71db365b1d6ff1eab805ea6ec3 upstream. When h5_close() gets called, the memory allocated for the hu gets freed only if hu->serdev doesn't exist. This leads to a memory leak. So when h5_close() is requested, close the serdev device instance and

[PATCH 5.10 07/63] io_uring: close a small race gap for files cancel

2021-01-04 Thread Greg Kroah-Hartman
From: Pavel Begunkov commit dfea9fce29fda6f2f91161677e0e0d9b671bc099 upstream. The purpose of io_uring_cancel_files() is to wait for all requests matching ->files to go/be cancelled. We should first drop files of a request in io_req_drop_files() and only then make it undiscoverable for io_uring_

[PATCH 4.19 21/35] Bluetooth: hci_h5: close serdev device and free hu in h5_close

2021-01-04 Thread Greg Kroah-Hartman
From: Anant Thazhemadam commit 70f259a3f4276b71db365b1d6ff1eab805ea6ec3 upstream. When h5_close() gets called, the memory allocated for the hu gets freed only if hu->serdev doesn't exist. This leads to a memory leak. So when h5_close() is requested, close the serdev device instance and

Re: [PATCH 2/2] drivers:tty:pty: Fix a race causing data loss on close

2021-01-02 Thread Corey Minyard
is. I'm pretty sure this is the right fix, the more I've thought about it. Thankks, -corey > > If you write to a pty master an immediately close the pty master, the > receiver might get a chunk of data dropped, but then receive some later > data. That's obviou

[PATCH net-next v2] net: nfc: nci: Change the NCI close sequence

2020-12-30 Thread Bongsu Jeon
From: Bongsu Jeon If there is a NCI command in work queue after closing the NCI device at nci_unregister_device, The NCI command timer starts at flush_workqueue function and then NCI command timeout handler would be called 5 second after flushing the NCI command work queue and destroying the qu

  1   2   3   4   5   6   7   8   9   10   >