From patchwork Thu Nov 7 20:02:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 3154291 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 20DDBBEEB2 for ; Thu, 7 Nov 2013 20:02:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 057B8204A7 for ; Thu, 7 Nov 2013 20:02:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9CC9020490 for ; Thu, 7 Nov 2013 20:02:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753327Ab3KGUCm (ORCPT ); Thu, 7 Nov 2013 15:02:42 -0500 Received: from mail-qe0-f54.google.com ([209.85.128.54]:61984 "EHLO mail-qe0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752711Ab3KGUCl (ORCPT ); Thu, 7 Nov 2013 15:02:41 -0500 Received: by mail-qe0-f54.google.com with SMTP id 1so1012693qec.27 for ; Thu, 07 Nov 2013 12:02:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=JU3fdGOjGBrs30iFqfAwWMbRZW5iiiwHTtCqR0/Lv4w=; b=YKeIbACQqedfM+myPwHITsFPCoe/Ey9mdNoQKLsUL6gkdKmUj0/zGL92lWqQ/Z7xuN nAfNQHXbT3C5yZhzcAUfdpfkedIRwnQbRrXtPRjO1qdSI10IZhdeKgs48gXZIbV6338H vhth5imI/k0YyIBXZbMaS9y+/xG0YI+PNlfN5JfziEeKUQQ1kfGsRRbQ97uvUwhaPxXE nP6/HMSL1esDbcYw958cxIXMufysY8ek6lAWWfMCJKx69BsAgpxYchDdi4ci5UwfJPoJ MWReA8zvTzrJeYCPjvpzf20rcJzV3UqW8/PwSeV1AuVxem0dXF0sJauBK/L7gr260AJR /Cpw== X-Gm-Message-State: ALoCoQn8P+L5gO8f5PATOTUODjd1bY0IyGQH6u9p56U8kDAikXL5vf8n48778UXjmsZ/1hbJUCpE X-Received: by 10.236.115.73 with SMTP id d49mr1545556yhh.12.1383854560753; Thu, 07 Nov 2013 12:02:40 -0800 (PST) Received: from salusa.poochiereds.net (cpe-107-015-124-230.nc.res.rr.com. [107.15.124.230]) by mx.google.com with ESMTPSA id q9sm9132635yhk.16.2013.11.07.12.02.39 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Thu, 07 Nov 2013 12:02:40 -0800 (PST) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, ishikawa@yk.rim.or.jp Subject: [PATCH] cifs: change ERRnomem error mapping from ENOMEM to EREMOTEIO Date: Thu, 7 Nov 2013 15:02:35 -0500 Message-Id: <1383854555-12043-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@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 Sometimes, the server will report an error that basically indicates that it's running out of resources. These include these under SMB1: NT_STATUS_NO_MEMORY NT_STATUS_SECTION_TOO_BIG NT_STATUS_TOO_MANY_PAGING_FILES ...and this one under SMB2: STATUS_NO_MEMORY Currently, this gets mapped to ENOMEM by the client, but that's confusing as an ENOMEM error is typically an indicator that the client is out of memory. Change these errors to instead map to EREMOTEIO to indicate that the problem is actually server-side and not on the client. Reported-by: "ISHIKAWA,chiaki" Signed-off-by: Jeff Layton --- fs/cifs/netmisc.c | 2 +- fs/cifs/smb2maperror.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index 651a527..0498845 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c @@ -51,7 +51,7 @@ static const struct smb_to_posix_error mapping_table_ERRDOS[] = { {ERRnoaccess, -EACCES}, {ERRbadfid, -EBADF}, {ERRbadmcb, -EIO}, - {ERRnomem, -ENOMEM}, + {ERRnomem, -EREMOTEIO}, {ERRbadmem, -EFAULT}, {ERRbadenv, -EFAULT}, {ERRbadformat, -EINVAL}, diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c index 7c2f45c..94bd4fb 100644 --- a/fs/cifs/smb2maperror.c +++ b/fs/cifs/smb2maperror.c @@ -306,7 +306,7 @@ static const struct status_to_posix_error smb2_error_map_table[] = { {STATUS_NONEXISTENT_SECTOR, -EIO, "STATUS_NONEXISTENT_SECTOR"}, {STATUS_MORE_PROCESSING_REQUIRED, -EIO, "STATUS_MORE_PROCESSING_REQUIRED"}, - {STATUS_NO_MEMORY, -ENOMEM, "STATUS_NO_MEMORY"}, + {STATUS_NO_MEMORY, -EREMOTEIO, "STATUS_NO_MEMORY"}, {STATUS_CONFLICTING_ADDRESSES, -EADDRINUSE, "STATUS_CONFLICTING_ADDRESSES"}, {STATUS_NOT_MAPPED_VIEW, -EIO, "STATUS_NOT_MAPPED_VIEW"},