From patchwork Mon Jun 21 21:32:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 12335649 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9566C4743C for ; Mon, 21 Jun 2021 21:32:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C056B6128E for ; Mon, 21 Jun 2021 21:32:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230206AbhFUVe2 (ORCPT ); Mon, 21 Jun 2021 17:34:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230006AbhFUVe1 (ORCPT ); Mon, 21 Jun 2021 17:34:27 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08CDEC061574; Mon, 21 Jun 2021 14:32:13 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id f13so72590ljp.10; Mon, 21 Jun 2021 14:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=XttW2DB5Vb9m+WTM2zdPl5AyA493GBkpUm0PN3ByhPM=; b=rUfqdcYZammBUrDpi4PoGjfb31cugOE7LvirnXnv+GIxcaUnG3w9zOJ604Ixzfs2SG y399ErsivItDWV57S32AzLmX6zCzi7EasoNbN0Fe8pKy5JIwSGuOXhsY6XIfIPQ6woSl ReKQa4oQ+2eo0epISX/RoA3y0QlXIPk//drUdgAnbgKxq2fKNO+eBZSZgiebDe1TkrKI vccM4wy515ts297PVue+3KEjhO/21oPCudUKI5WL4OPHXBO5nlpViyh+opnwQR3S5mSC ETWkid5bbudJ9Ak1TzgsOy6AFN2+LkkZptm0OahiILvNM4O/3THH2LjL1NgJm2bf0wod 7/qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=XttW2DB5Vb9m+WTM2zdPl5AyA493GBkpUm0PN3ByhPM=; b=NqLfWpzGZK7VLqgL90FGQVqEZWyUgu8YJ8n6ORKmaondeBeZ9BJlQlIyHYQTNElX0L ER4XV3ra8lIU49SIreA3yP0cUBN8NlWkcLbvAv0LieCv6gpA8DCGf7qaoKA4c6cIlmv7 W5Vpjbn9MXr8nUIwszTDo77/VoPk6vmcdm1kt2mfQvvHWdN6XBiRvAGoJNEsb8KRLoi1 efNUNVy62k6SJ39OOrbppIxvjx2RX8mS1hkfLBTwqY5qzPDji4xhfutgidZrSit4+Bvl MTyS+Vnu9VthepYNIBa/IuELdtNqJ2f0XWjp8q2GphHDTHJY7xfFOmoOq8nB68vIHfn+ Q46Q== X-Gm-Message-State: AOAM533Hl6eYfhzWilu7TZYvhgU0vHQ1XwV5hGv7tsDzibFfX/NNh9k4 27PUf56ffdyZygRI0FzrnGp3mzpfDfYxMUNhsJg= X-Google-Smtp-Source: ABdhPJzQYy8Zv2CoT4+5jf+Ljt9HmhtwZp1c4bIUyBIO+4vf8Ela55EiC0s0gJecmfdGTLXQhmsvO2O/+kTDAQ0FLDA= X-Received: by 2002:a05:651c:10b9:: with SMTP id k25mr227755ljn.256.1624311131260; Mon, 21 Jun 2021 14:32:11 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Mon, 21 Jun 2021 16:32:00 -0500 Message-ID: Subject: [SMBDIRECT][PATCH] missing rc checks while waiting for SMB3 over RDMA events To: Long Li Cc: CIFS , LKML Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org There were two places where we weren't checking for error (e.g. ERESTARTSYS) while waiting for rdma resolution. Addresses-Coverity: 1462165 ("Unchecked return value") Signed-off-by: Steve French Reviewed-by: Long Li Reviewed-By: Tom Talpey From 9bf42caeb95d8a5bf672348e5deba583f8233713 Mon Sep 17 00:00:00 2001 From: Steve French Date: Mon, 21 Jun 2021 16:25:20 -0500 Subject: [PATCH] smbdirect: missing rc checks while waiting for rdma events There were two places where we weren't checking for error (e.g. ERESTARTSYS) while waiting for rdma resolution. Addresses-Coverity: 1462165 ("Unchecked return value") Signed-off-by: Steve French --- fs/cifs/smbdirect.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index 10dfe5006792..ae07732f750f 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -572,8 +572,11 @@ static struct rdma_cm_id *smbd_create_id( log_rdma_event(ERR, "rdma_resolve_addr() failed %i\n", rc); goto out; } - wait_for_completion_interruptible_timeout( + rc = wait_for_completion_interruptible_timeout( &info->ri_done, msecs_to_jiffies(RDMA_RESOLVE_TIMEOUT)); + /* -ERESTARTSYS, returned when interrupted, is the only rc mentioned */ + if (rc < 0) + goto out; rc = info->ri_rc; if (rc) { log_rdma_event(ERR, "rdma_resolve_addr() completed %i\n", rc); @@ -586,8 +589,10 @@ static struct rdma_cm_id *smbd_create_id( log_rdma_event(ERR, "rdma_resolve_route() failed %i\n", rc); goto out; } - wait_for_completion_interruptible_timeout( + rc = wait_for_completion_interruptible_timeout( &info->ri_done, msecs_to_jiffies(RDMA_RESOLVE_TIMEOUT)); + if (rc < 0) /* e.g. if interrupted and returns -ERESTARTSYS */ + goto out rc = info->ri_rc; if (rc) { log_rdma_event(ERR, "rdma_resolve_route() completed %i\n", rc); -- 2.30.2