From patchwork Tue Oct 27 22:04:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 7504381 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7A546BEEA4 for ; Tue, 27 Oct 2015 22:04:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DE0C209CD for ; Tue, 27 Oct 2015 22:04:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A38D6209CC for ; Tue, 27 Oct 2015 22:04:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754011AbbJ0WES (ORCPT ); Tue, 27 Oct 2015 18:04:18 -0400 Received: from mail-bl2on0093.outbound.protection.outlook.com ([65.55.169.93]:14240 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753161AbbJ0WEN (ORCPT ); Tue, 27 Oct 2015 18:04:13 -0400 Received: from BY1PR0201CA0015.namprd02.prod.outlook.com (10.160.191.153) by CY1PR02MB1263.namprd02.prod.outlook.com (10.163.16.156) with Microsoft SMTP Server (TLS) id 15.1.306.13; Tue, 27 Oct 2015 22:04:09 +0000 Received: from BY2FFO11OLC007.protection.gbl (2a01:111:f400:7c0c::194) by BY1PR0201CA0015.outlook.office365.com (2a01:111:e400:4814::25) with Microsoft SMTP Server (TLS) id 15.1.312.18 via Frontend Transport; Tue, 27 Oct 2015 22:04:09 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=sandisk.com; dev.mellanox.co.il; dkim=none (message not signed) header.d=none;dev.mellanox.co.il; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.173 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.173; helo=milsmgep12.sandisk.com; Received: from milsmgep12.sandisk.com (63.163.107.173) by BY2FFO11OLC007.mail.protection.outlook.com (10.1.14.254) with Microsoft SMTP Server id 15.1.306.13 via Frontend Transport; Tue, 27 Oct 2015 22:04:09 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id EF.D7.32178.9D4FF265; Tue, 27 Oct 2015 15:04:09 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.248.2; Tue, 27 Oct 2015 15:04:09 -0700 X-AuditID: ac160a69-f79f76d000007db2-5b-562ff4d9d1cb Received: from [10.60.52.33] ( [10.177.8.100]) by milsmgip11.sandisk.com (Symantec Messaging Gateway) with SMTP id DB.AE.03643.9D4FF265; Tue, 27 Oct 2015 15:04:09 -0700 (PDT) Subject: [PATCH 7/7] IB/srp: Avoid that mapping failure triggers an infinite loop To: Doug Ledford References: <562FF404.7000504@sandisk.com> CC: Sagi Grimberg , Sebastian Parschauer , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <562FF4D9.2060809@sandisk.com> Date: Tue, 27 Oct 2015 15:04:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <562FF404.7000504@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRmVeSWpSXmKPExsWyRoxnke7NL/phBhuPKlq8PP+B1eLZoV4W i9fHnzJZnLzN78DiMX3GJlaPP38+M3u833eVzePzJrkAligum5TUnMyy1CJ9uwSujIl7lrEX TGGt+DZjOVMD43qWLkZODgk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8Nn/VnltMldnz2/Y7q7n6B1c+NFu8tm2PWNTkxdxbtUVX6tbVJjPZdeiZSh596HPNNsFJ tjl08azZmkWpcxNO/SzaLdm6urfHnP00j6Iwx7tLm58mO/3uWdIcs3CXPdPbwL2et59e3uzk Nn29zSvF18stK26aOMyQW3dv250bGw6uOleWUFykxFKckWioxVxUnAgAZquKJgMCAAA= X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC007; 1:q8xm8PkPJppLf9eToE6AnDuneFWYiUjCZ5tbO3TxtLyqzun9sKXpoV3j0nQQuQreR0Vwz2ctYXE4UOITeg8KzdVGsKrswrx0ed1nf4ueBkmSUJzmG6VJ+9WbQA/4FMz5uwldsBtJ14UTyWqd+ZdLbfiI5DRlM/nchxxPF38O8lvxQdc5GHg34H94KoFus3mn/5eNa+wKvyzqk61WVCzRIZOuTCZxOLBemYB4DX4qshgWj0ppQuKq1R1g89ezigDU1K/vgdWo2a5uKB1zA49CkUnwML4w2wR7LI6oEDJRXYAA7TjrQ6wmk63gBgK7zKD4++qShX2cKogBbYUTrsNMSsgMB2zvmRv+lFzhbI99IILF2/Ry5MwV9qrTtZz9gyByYQrGBbPwVk+sL2YK78TAig== X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(199003)(189002)(2950100001)(69596002)(110136002)(65806001)(189998001)(65956001)(5001960100002)(80316001)(47776003)(81156007)(19580405001)(97736004)(19580395003)(4001350100001)(5008740100001)(11100500001)(50986999)(5007970100001)(36756003)(92566002)(54356999)(59896002)(87266999)(229853001)(76176999)(65816999)(50466002)(33656002)(87936001)(83506001)(77096005)(64126003)(23676002)(106466001)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1263; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics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EmYctHzI2/emgjwICwvE8QVZEg8vVzGCae6PHY8X2G0sNX3UwuEn71zcGYUGl/satHGikYoQOBmQJQocRI2WU0ohMPUy9K1WPKCIT9pKMGM6D5isXAu9SVaSIpMbF6JR7SxxSembW162ExCXfF++4x1GlwyJ+K0JiykisYpf4m6a5kx3CXPEMkMYRvauRrWHV1ir9qeS2DEkEnkgwDHZBbbaOXY3xcYdTzIfriX5v3VNIbrdsE5n9P5TNWTouxSWyfNpcqZBKVbbYr5dZ6ya42YYlLOXh23VYogxU48; 4:Cmjr6lXzDpsGt20454TOm0zuIfKD6plExLiJYp2sZTjATyWwYwhO5uLyldulRZQkhj3sLw2jnAY7xWdXvmBtV5RpQH5BVMhDWZFrb2mJvrwhC5RTGVkXBR33DISnpNYPdOKnAkqG1bVEqMFudoqo01OetWcc4nSJ4V8C13A5N3crSiYEw4Tgt80RZGWRtoSAGGHonu2EUZLvo62mmxWF0W0+VjK4P8AKF8A/dzORmVOQenrNLTvZO/AMC9IZurZCvKo9Hfo3jUtVZpeyXTZbtoMmTfaZUGMc/JtDa+j5e6TBXzLlcGRE9UkUTWpXvlEfayjUkL0nRHfg/6JMGp7fcoKIhCA+r4GZAO8UySjG+N1GewHunnN4D5uvtqlEzb+H X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(34787635062028)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(102215026); SRVR:CY1PR02MB1263; BCL:0; PCL:0; RULEID:; SRVR:CY1PR02MB1263; X-Forefront-PRVS: 0742443479 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjAyTUIxMjYzOzIzOlpXUGVKUXhUam9SdGx0alZoZ244OUVaRmRJ?= =?utf-8?B?dEczeU9RSlVJakl6MFlzeTlWZFlmWEZsMGJWdkVSRlFmQ2VFb3kvZ3VVOVht?= =?utf-8?B?Y0Z4S0hxOUFhdU9XM2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tQwKUWD59E0FSyq52HAHhkqIjMM4vAv8oTGSS0pCUXr SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2015 22:04:09.5263 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.173]; Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1263 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Bart Van Assche Cc: Sagi Grimberg Cc: Sebastian Parschauer --- drivers/infiniband/ulp/srp/ib_srp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 47c3a72..59d3ff9 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1666,6 +1666,8 @@ map_complete: unmap: srp_unmap_data(scmnd, ch, req, true); + if (ret == -ENOMEM && req->nmdesc >= target->mr_pool_size) + ret = -E2BIG; return ret; }