* [PATCH 1/2] ksmbd: fix outstanding credits related bugs
@ 2022-05-17 21:46 Hyunchul Lee
2022-05-17 21:46 ` [PATCH 2/2] ksmbd: smbd: fix connection dropped issue Hyunchul Lee
2022-05-19 8:00 ` [PATCH 1/2] ksmbd: fix outstanding credits related bugs Namjae Jeon
0 siblings, 2 replies; 4+ messages in thread
From: Hyunchul Lee @ 2022-05-17 21:46 UTC (permalink / raw)
To: linux-cifs
Cc: Namjae Jeon, Sergey Senozhatsky, Steve French, Hyunchul Lee,
Yufan Chen
outstanding credits must be initialized to 0,
because it means the sum of credits consumed by
in-flight requests.
And outstanding credits must be compared with
total credits in smb2_validate_credit_charge(),
because total credits are the sum of credits
granted by ksmbd.
This patch fix the following error,
while frametest with Windows clients:
Limits exceeding the maximum allowable outstanding requests,
given : 128, pending : 8065
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Reported-by: Yufan Chen <wiz.chen@gmail.com>
Tested-by: Yufan Chen <wiz.chen@gmail.com>
---
fs/ksmbd/connection.c | 2 +-
fs/ksmbd/smb2misc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ksmbd/connection.c b/fs/ksmbd/connection.c
index 7db87771884a..e8f476c5f189 100644
--- a/fs/ksmbd/connection.c
+++ b/fs/ksmbd/connection.c
@@ -62,7 +62,7 @@ struct ksmbd_conn *ksmbd_conn_alloc(void)
atomic_set(&conn->req_running, 0);
atomic_set(&conn->r_count, 0);
conn->total_credits = 1;
- conn->outstanding_credits = 1;
+ conn->outstanding_credits = 0;
init_waitqueue_head(&conn->req_running_q);
INIT_LIST_HEAD(&conn->conns_list);
diff --git a/fs/ksmbd/smb2misc.c b/fs/ksmbd/smb2misc.c
index 4a9460153b59..f8f456377a51 100644
--- a/fs/ksmbd/smb2misc.c
+++ b/fs/ksmbd/smb2misc.c
@@ -338,7 +338,7 @@ static int smb2_validate_credit_charge(struct ksmbd_conn *conn,
ret = 1;
}
- if ((u64)conn->outstanding_credits + credit_charge > conn->vals->max_credits) {
+ if ((u64)conn->outstanding_credits + credit_charge > conn->total_credits) {
ksmbd_debug(SMB, "Limits exceeding the maximum allowable outstanding requests, given : %u, pending : %u\n",
credit_charge, conn->outstanding_credits);
ret = 1;
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/2] ksmbd: smbd: fix connection dropped issue
2022-05-17 21:46 [PATCH 1/2] ksmbd: fix outstanding credits related bugs Hyunchul Lee
@ 2022-05-17 21:46 ` Hyunchul Lee
2022-05-20 0:21 ` Namjae Jeon
2022-05-19 8:00 ` [PATCH 1/2] ksmbd: fix outstanding credits related bugs Namjae Jeon
1 sibling, 1 reply; 4+ messages in thread
From: Hyunchul Lee @ 2022-05-17 21:46 UTC (permalink / raw)
To: linux-cifs
Cc: Namjae Jeon, Sergey Senozhatsky, Steve French, Hyunchul Lee,
Yufan Chen
When there are bursty connection requests,
RDMA connection event handler is deferred and
Negotiation requests are received even if
connection status is NEW.
To handle it, set the status to CONNECTED
if Negotiation requests are received.
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Reported-by: Yufan Chen <wiz.chen@gmail.com>
Tested-by: Yufan Chen <wiz.chen@gmail.com>
---
fs/ksmbd/transport_rdma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ksmbd/transport_rdma.c b/fs/ksmbd/transport_rdma.c
index 0741fd129d16..e91acc2746bc 100644
--- a/fs/ksmbd/transport_rdma.c
+++ b/fs/ksmbd/transport_rdma.c
@@ -576,6 +576,7 @@ static void recv_done(struct ib_cq *cq, struct ib_wc *wc)
}
t->negotiation_requested = true;
t->full_packet_received = true;
+ t->status = SMB_DIRECT_CS_CONNECTED;
enqueue_reassembly(t, recvmsg, 0);
wake_up_interruptible(&t->wait_status);
break;
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] ksmbd: smbd: fix connection dropped issue
2022-05-17 21:46 ` [PATCH 2/2] ksmbd: smbd: fix connection dropped issue Hyunchul Lee
@ 2022-05-20 0:21 ` Namjae Jeon
0 siblings, 0 replies; 4+ messages in thread
From: Namjae Jeon @ 2022-05-20 0:21 UTC (permalink / raw)
To: Hyunchul Lee; +Cc: linux-cifs, Sergey Senozhatsky, Steve French, Yufan Chen
2022-05-18 6:46 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
> When there are bursty connection requests,
> RDMA connection event handler is deferred and
> Negotiation requests are received even if
> connection status is NEW.
>
> To handle it, set the status to CONNECTED
> if Negotiation requests are received.
>
> Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
> Reported-by: Yufan Chen <wiz.chen@gmail.com>
> Tested-by: Yufan Chen <wiz.chen@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] ksmbd: fix outstanding credits related bugs
2022-05-17 21:46 [PATCH 1/2] ksmbd: fix outstanding credits related bugs Hyunchul Lee
2022-05-17 21:46 ` [PATCH 2/2] ksmbd: smbd: fix connection dropped issue Hyunchul Lee
@ 2022-05-19 8:00 ` Namjae Jeon
1 sibling, 0 replies; 4+ messages in thread
From: Namjae Jeon @ 2022-05-19 8:00 UTC (permalink / raw)
To: Hyunchul Lee; +Cc: linux-cifs, Sergey Senozhatsky, Steve French, Yufan Chen
2022-05-18 6:46 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
> outstanding credits must be initialized to 0,
> because it means the sum of credits consumed by
> in-flight requests.
> And outstanding credits must be compared with
> total credits in smb2_validate_credit_charge(),
> because total credits are the sum of credits
> granted by ksmbd.
>
> This patch fix the following error,
> while frametest with Windows clients:
>
> Limits exceeding the maximum allowable outstanding requests,
> given : 128, pending : 8065
>
> Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
> Reported-by: Yufan Chen <wiz.chen@gmail.com>
> Tested-by: Yufan Chen <wiz.chen@gmail.com>
Please add Fixes and stable tags.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-05-20 0:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-17 21:46 [PATCH 1/2] ksmbd: fix outstanding credits related bugs Hyunchul Lee
2022-05-17 21:46 ` [PATCH 2/2] ksmbd: smbd: fix connection dropped issue Hyunchul Lee
2022-05-20 0:21 ` Namjae Jeon
2022-05-19 8:00 ` [PATCH 1/2] ksmbd: fix outstanding credits related bugs Namjae Jeon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox