Re: [Cluster-devel] [PATCH 13/18] [try #2] DLM: fix conversion deadlock when DLM_LKF_NODLCKWT flag is set

2017-09-12 Thread David Teigland
On Tue, Sep 12, 2017 at 09:01:31AM +, tsutomu@toshiba.co.jp wrote: > When the DLM_LKF_NODLCKWT flag was set, even if conversion deadlock > was detected, the caller of can_be_granted() was unknown. > We change the behavior of can_be_granted() and change it to detect > conversion deadlock

[Cluster-devel] [PATCH 07/18] [try #2] DLM: fix to use sock_mutex correctly in xxx_accept_from_sock

2017-09-12 Thread tsutomu.owa
In the current implementation, we think that exclusion control for othercon in tcp_accept_from_sock() and sctp_accept_from_sock() was not enough. We fix them. Signed-off-by: Tadashi Miyauchi Signed-off-by: Tsutomu Owa ---

[Cluster-devel] [PATCH 17/18] [try #2] DLM: fix to reschedule rwork

2017-09-12 Thread tsutomu.owa
When an error occurs in kernel_recvmsg or kernel_sendpage and close_connection is called and receive work is already scheduled, receive work is canceled. In that case, the receive work will not be scheduled forever after reconnection, because CF_READ_PENDING flag is established. Signed-off-by:

[Cluster-devel] [PATCH 11/18] [try #2] DLM: Reanimate CF_WRITE_PENDING flag

2017-09-12 Thread tsutomu.owa
CF_WRITE_PENDING flag has been reanimated to make dlm_send stop properly when running dlm_lowcomms_stop. Signed-off-by: Tadashi Miyauchi Signed-off-by: Tsutomu Owa --- fs/dlm/lowcomms.c | 9 - 1 file changed, 8 insertions(+), 1

[Cluster-devel] [PATCH 08/18] [try #2] DLM: retry rcom when dlm_wait_function is timed out.

2017-09-12 Thread tsutomu.owa
If a node sends a DLM_RCOM_STATUS command and an error occurs on the receiving side, the DLM_RCOM_STATUS_REPLY response may not be returned. We retransmitted the DLM_RCOM_STATUS command so that we do not wait for an infinite response. Signed-off-by: Tadashi Miyauchi

[Cluster-devel] [PATCH 02/18] [try #2] DLM: Eliminate CF_WRITE_PENDING flag

2017-09-12 Thread tsutomu.owa
--- This version implements Steve Whitehouse's suggestion to put cond_resched() after the queue_work in function send_to_sock. This was just a thinko; it does make more sense to do it afterward. Before this patch the CF_WRITE_PENDING flag was used to indicate when writes to the socket were

[Cluster-devel] [PATCH 06/18] [try #2] DLM: fix race condition between dlm_send and dlm_recv

2017-09-12 Thread tsutomu.owa
When kernel_sendpage(in send_to_sock) and kernel_recvmsg (in receive_from_sock) return error, close_connection may works at the same time. At that time, they may wait for each other by cancel_work_sync. Signed-off-by: Tadashi Miyauchi Signed-off-by: Tsutomu Owa

[Cluster-devel] [PATCH 13/18] [try #2] DLM: fix conversion deadlock when DLM_LKF_NODLCKWT flag is set

2017-09-12 Thread tsutomu.owa
When the DLM_LKF_NODLCKWT flag was set, even if conversion deadlock was detected, the caller of can_be_granted() was unknown. We change the behavior of can_be_granted() and change it to detect conversion deadlock regardless of whether the DLM_LKF_NODLCKWT flag is set or not. And depending on

[Cluster-devel] [PATCH 18/18] [try #2] DLM: fix NULL pointer dereference in send_to_sock()

2017-09-12 Thread tsutomu.owa
The writequeue and writequeue_lock member of othercon was not initialized. If lowcomms_state_change() is called from network layer, othercon->swork may be scheduled. In this case, send_to_sock() will generate a NULL pointer reference. We avoid this problem by correctly initializing writequeue and

[Cluster-devel] [PATCH 05/18] [try #2] DLM: fix double list_del()

2017-09-12 Thread tsutomu.owa
dlm_lowcomms_stop() was not functioning properly. Correctly, we have to wait until all processing is finished with send_workqueue and recv_workqueue. This problem causes the following issue. Senario is 1. dlm_send thread: send_to_sock refers con->writequeue 2. main thread:

[Cluster-devel] [PATCH 16/18] [try #2] DLM: fix to use sk_callback_lock correctly

2017-09-12 Thread tsutomu.owa
In the current implementation, we think that exclusion control between processing to set the callback function to the connection structure and processing to refer to the connection structure from the callback function was not enough. We fix them. Signed-off-by: Tadashi Miyauchi

[Cluster-devel] [PATCH 04/18] [try #2] DLM: fix remove save_cb argument from add_sock()

2017-09-12 Thread tsutomu.owa
save_cb argument is not used. We remove them. Signed-off-by: Tadashi Miyauchi Signed-off-by: Tsutomu Owa --- fs/dlm/lowcomms.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/dlm/lowcomms.c

[Cluster-devel] [PATCH 09/18] [try #2] DLM: close othercon at send/receive error

2017-09-12 Thread tsutomu.owa
If an error occurs in the sending / receiving process, if othercon exists, sending / receiving processing using othercon may also result in an error. We fix to pre-close othercon as well. Signed-off-by: Tadashi Miyauchi Signed-off-by: Tsutomu Owa

[Cluster-devel] [PATCH 15/18] [try #2] DLM: fix overflow dlm_cb_seq

2017-09-12 Thread tsutomu.owa
dlm_cb_seq is 64 bits. If dlm_cb_seq overflows and returns to 0, dlm_rem_lkb_callback() will not work properly. Signed-off-by: Tadashi Miyauchi Signed-off-by: Tsutomu Owa --- fs/dlm/ast.c | 2 ++ 1 file changed, 2 insertions(+) diff

[Cluster-devel] [PATCH 12/18] [try #2] DLM: use CF_CLOSE flag to stop dlm_send correctly

2017-09-12 Thread tsutomu.owa
If reconnection fails while executing dlm_lowcomms_stop, dlm_send will not stop. Signed-off-by: Tadashi Miyauchi Signed-off-by: Tsutomu Owa --- fs/dlm/lowcomms.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/dlm/lowcomms.c

[Cluster-devel] [PATCH 00/18] [try #2] DLM: dlm patches need review

2017-09-12 Thread tsutomu.owa
Hi, This series of patches (2nd version after previous review on August) is to fix various bugs. This patch set is against the mainline kernel. We'd like reviewed to make sure those changes are fine. Patch number 01/02/03 were posted on this mailing list. However, I've modifed 03 to correct a