From patchwork Mon Jun 13 23:01:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyunchul Lee X-Patchwork-Id: 12880281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEFEFC433EF for ; Mon, 13 Jun 2022 23:02:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236752AbiFMXCF (ORCPT ); Mon, 13 Jun 2022 19:02:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234344AbiFMXB7 (ORCPT ); Mon, 13 Jun 2022 19:01:59 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 506E03205E for ; Mon, 13 Jun 2022 16:01:53 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id e9so6939051pju.5 for ; Mon, 13 Jun 2022 16:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GW0YonjkueH+047BxZsXnZQD3obnI59nyCsoVaQzIBs=; b=ERCvJsd70F2QgRNcdd3c3xeW6tb7SslxyMl223LZBxj9MMtAObMJ0slr3uCV1zGnHb /20vioUeXGuRJ91PAIYghzGP1P3Qzu0+05w8G7TyZZjCBCpZ9aE5xsUwvb7kH1F6htmb KwsNM+qY4q+WKLD53MMO2Ol/V5nVJ9hpksNa59y61+hXGWXne5DHWGr+432zZp1dHgb7 5VLALscF1jIFTQCwPZOA04VQZtSAbMZLxaueYiVW+4LdWBn6SaWXxWc52bWYggncfReq 3EJMfp3slJibfBoSZbS2EEP7DUZLDAhYxj0OEasfdpm4FZMxXOi+tTUOWeQSe/le8N6h Nvvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GW0YonjkueH+047BxZsXnZQD3obnI59nyCsoVaQzIBs=; b=iN247aUIQtms+bCYlUzgjanje1ROCeOetWSWecobUikBA16INOtrK2JoqOoaONdIXO xiUThyCL/he/NxNCtH5znZ+d5VBBaw4MZJALvNSRW4JyO0jRHwfTKEWZfAF36r4wVlsQ DpoDZOv3pFUw3WjjXJU9zXQxtaGW10FyzR3nw/HAjC499LV+hd0jS/7LhCdcYgXiWd1v 9xApfYEcE5lp3BUeGo2aIkBbxGK81NOo4QCZOSpDcriS5QAlpu20GdhDpeURvggy6szC XFXStFNPDAf/Po8rgKEI2k+lVA6xFm4J7n/GPGMV0oZqZO21/PGI73bJYlYP07sv0fGc 0KTQ== X-Gm-Message-State: AJIora/uk2ZSoax8I02Nzy2+9VLk4omvScVZmaawd0Mbx8rmzEKyHNg4 M2iRiJjm6lVjnI37eEUQdril6AmtdBM= X-Google-Smtp-Source: AGRyM1tCyRhKGSgHvah67bvynXvbD66XLT0/qv2/2Z4bfGGvKJL7wPICaoQj7UGj0YtLR2n24CSooQ== X-Received: by 2002:a17:90a:cc0d:b0:1e3:1256:faa3 with SMTP id b13-20020a17090acc0d00b001e31256faa3mr1113481pju.107.1655161312031; Mon, 13 Jun 2022 16:01:52 -0700 (PDT) Received: from localhost.localdomain ([210.217.8.148]) by smtp.googlemail.com with ESMTPSA id o186-20020a62cdc3000000b0051c78a77702sm6097603pfg.176.2022.06.13.16.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 16:01:51 -0700 (PDT) From: Hyunchul Lee To: linux-cifs@vger.kernel.org Cc: Namjae Jeon , Sergey Senozhatsky , Steve French , Hyunchul Lee Subject: [PATCH 1/2] ksmbd: remove duplicate flag set in smb2_write Date: Tue, 14 Jun 2022 08:01:18 +0900 Message-Id: <20220613230119.73475-1-hyc.lee@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org The writethrough flag is set again if is_rdma_channel is false. Signed-off-by: Hyunchul Lee --- fs/ksmbd/smb2pdu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c index e6f4ccc12f49..553aad4ca6fa 100644 --- a/fs/ksmbd/smb2pdu.c +++ b/fs/ksmbd/smb2pdu.c @@ -6506,9 +6506,6 @@ int smb2_write(struct ksmbd_work *work) le16_to_cpu(req->DataOffset)); ksmbd_debug(SMB, "flags %u\n", le32_to_cpu(req->Flags)); - if (le32_to_cpu(req->Flags) & SMB2_WRITEFLAG_WRITE_THROUGH) - writethrough = true; - ksmbd_debug(SMB, "filename %pd, offset %lld, len %zu\n", fp->filp->f_path.dentry, offset, length); err = ksmbd_vfs_write(work, fp, data_buf, length, &offset, From patchwork Mon Jun 13 23:01:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyunchul Lee X-Patchwork-Id: 12880282 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB7E2C43334 for ; Mon, 13 Jun 2022 23:02:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232682AbiFMXCL (ORCPT ); Mon, 13 Jun 2022 19:02:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237654AbiFMXCG (ORCPT ); Mon, 13 Jun 2022 19:02:06 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A88F431DEF for ; Mon, 13 Jun 2022 16:02:04 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id 3-20020a17090a174300b001e426a02ac5so10204211pjm.2 for ; Mon, 13 Jun 2022 16:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pCL45IsiDyG8q1U2/B6kZtt/jXl5mrIpX69+TYhxyEM=; b=hYBy50wsPn5+3V+Mb8XOVXURtjfvu7Ald5Cwg4G3SQ8BkpxxoumTTgMa4vQNNEvEhg PMOKJt/vjqpBt7/Js/U24sYUtH0tawQFdirbodRYIwGi1IvAysGn7w8zaffCze4QQDDb DBreBX2C487oGIzI3DEEJBXMTjqBfXDU0WXE5z0nkg8zWiq30DiBXcYyZ3Sg2H3AgrmE LQ38QRMuqApsbV55la4jyEMAV9LPtbN8tYMqDeiTAlauWbgeF2cotKqeMreW3nBPQQ2i Og0iiCPwqHIRRpaldbmMdStfBukGOAodu1bCNLGzClrAkQXP3PqQLtE/NuIIHDAifLse T0Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pCL45IsiDyG8q1U2/B6kZtt/jXl5mrIpX69+TYhxyEM=; b=Jgz9ynDseNgHLN837BzdC7/2DXX3ANJD8wOoP0RnM+QEskBeeux2kr0LsO4sBj5L3g hkCwNk/ZtdkTpV5/GHy6kfqMWwRV+P4j02+b22mywzT1mqmLyAauxOb1jtUqO6n1hZm7 K4CnmYGNq/3wY6bn+HK5rbVLnn0TqVER14xPzxrSSVC9QQurffQN4+P8Fp5ffpCAArXH Biw+SOopbODiFepVSt6CEEruZrSE1Txz/tIyM2bOzguM3Fpec2PSRbk1rskuRToM8Gzd x0Sp8jy6mAzfJ8BC7KHy5ZG1e9d6S+cMOI8a0ZGdaeOBVpjNJOaA9UBQk9ngGKkI7T3x c+5w== X-Gm-Message-State: AJIora9DxCHlfH31Bb4fJvnI5IXjtImqSvMlc1Qd6kVog1R3zVG4ZFd/ 0kF3oEED7kO09Ms7nLPFo0IQtxTxU1w= X-Google-Smtp-Source: AGRyM1s33bq11hLiar7k4LdS+qJqjdDKJ2oehlH0mrh7QdtVS0HlcFwETWOz52V+dDjCufuCFETXSQ== X-Received: by 2002:a17:902:d509:b0:167:6ed8:afb5 with SMTP id b9-20020a170902d50900b001676ed8afb5mr1560624plg.137.1655161323620; Mon, 13 Jun 2022 16:02:03 -0700 (PDT) Received: from localhost.localdomain ([210.217.8.148]) by smtp.googlemail.com with ESMTPSA id o186-20020a62cdc3000000b0051c78a77702sm6097603pfg.176.2022.06.13.16.02.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 16:02:03 -0700 (PDT) From: Hyunchul Lee To: linux-cifs@vger.kernel.org Cc: Namjae Jeon , Sergey Senozhatsky , Steve French , Hyunchul Lee Subject: [PATCH 2/2] ksmbd: smbd: handle RDMA CM time wait event Date: Tue, 14 Jun 2022 08:01:19 +0900 Message-Id: <20220613230119.73475-2-hyc.lee@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220613230119.73475-1-hyc.lee@gmail.com> References: <20220613230119.73475-1-hyc.lee@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org After a QP has been disconnected, it stays in a timewait state for in flight packets. After the state has completed, RDMA_CM_EVENT_TIMEWAIT_EXIT is reported. Disconnect on RDMA_CM_EVENT_TIMEWAIT_EXIT so that ksmbd can restart. Signed-off-by: Hyunchul Lee Acked-by: Namjae Jeon --- 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 d035e060c2f0..4b1a471afcd0 100644 --- a/fs/ksmbd/transport_rdma.c +++ b/fs/ksmbd/transport_rdma.c @@ -1535,6 +1535,7 @@ static int smb_direct_cm_handler(struct rdma_cm_id *cm_id, wake_up_interruptible(&t->wait_status); break; } + case RDMA_CM_EVENT_TIMEWAIT_EXIT: case RDMA_CM_EVENT_DEVICE_REMOVAL: case RDMA_CM_EVENT_DISCONNECTED: { t->status = SMB_DIRECT_CS_DISCONNECTED;