From patchwork Sun Mar 17 21:06:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 10856589 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 90DCC1823 for ; Sun, 17 Mar 2019 21:06:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7044D292A6 for ; Sun, 17 Mar 2019 21:06:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 649A229259; Sun, 17 Mar 2019 21:06:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BB292922A for ; Sun, 17 Mar 2019 21:06:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726493AbfCQVGh (ORCPT ); Sun, 17 Mar 2019 17:06:37 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46005 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbfCQVGh (ORCPT ); Sun, 17 Mar 2019 17:06:37 -0400 Received: by mail-pf1-f195.google.com with SMTP id v21so9816595pfm.12; Sun, 17 Mar 2019 14:06:36 -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=c74hnbM33Kw0VEYelm1s0/qHmPaMWGkAYQa/r0ee8JI=; b=O/C+x+/cnb9QhUdhakSqrr8igZ6dHerplspoTgZjxV10Hnh+nGNjvvZl5eET2RAqPR ogOwB7wIWzi+UKUFcOsdYBvvN43meGscoMmUhqSCwnc0/+D59zxdlohIwVJ6P2YXHHCZ 18TCrsXKjza702Qy2kzcdAEpDYwO4jGxV8Q/jssuOSlzdtdn6Hj+sUUsnb2+IHQR3F3y WodgioP6Q5LiD0+axw0/W6UjcvdMVTsJrBtditYFB22fQGxheab1qUKRH32Ro2Y1M2oh SCqe+camNHfKugSnI1SkNQsv4DZxrHz7qyCvxti154GWdcySfYzgxRHOlNbbAHL6Nx0p G+CA== 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=c74hnbM33Kw0VEYelm1s0/qHmPaMWGkAYQa/r0ee8JI=; b=T0CJ9d++ibOX7OeecQsZB1kKhXhzvwf5zMh62SzBnclq/47fAQSbMHgn2ZwPe2R45i mQm6LSrjTSEJGqlaiMVcAAKbVhNdBwrRxHveZsgCz5JxKsbvxe0ui1K6Sv4JHkj/0Xz2 2POF7b5v+tPYVUbsL8XpQgzYZfIg8CID/H8Ci9pWhpjLlmAl37P2xcSRX7ZHMIyVSnaT 3HxnzERstG+enmQC+jgUaZTYvHyskfuwxxdAUXa3Ca1YVaIqEKzTwFfSxpZnOwdQB13Q DORC01zbaxronYSEDPlLdleKSqB30umaIPsEBn906IoCMmhqJbOgSHzLg5gkAVyvBUSp Er0g== X-Gm-Message-State: APjAAAVigEEZVOCN/U5jicXk2hDS0zJf0GBPmYu7JSdyuc1kEZKbybcH LKqWeGnSAD3l0/fu84KvkhmCzrLQiXcIriyivZPdJXkw X-Google-Smtp-Source: APXvYqyt5itSzYeDhR4UBgfI6xVZLloC6yR/pp637cnc4OpHCplzVpFXAK89m7fb7HddJjiC/fUokCHe5/2d5eciWok= X-Received: by 2002:a65:508b:: with SMTP id r11mr14529005pgp.242.1552856795791; Sun, 17 Mar 2019 14:06:35 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Sun, 17 Mar 2019 16:06:24 -0500 Message-ID: Subject: [PATCH][SMB3] Fix incorrect status to errno code mapping for OBJECTID_NOT_FOUND To: CIFS , linux-fsdevel Cc: Amir Goldstein , ronnie sahlberg , samba-technical Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It was mapped to EIO which can be confusing when user space queries for an object GUID for an object for which the server file system doesn't support (or hasn't saved one). As Amir Goldstein suggested this is similar to ENOATTR (equivalently ENODATA in Linux errno definitions) so changing NT STATUS code mapping for OBJECTID_NOT_FOUND to ENODATA. Signed-off-by: Steve French CC: Amir Goldstein --- fs/cifs/smb2maperror.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) "STATUS_WRONG_CREDENTIAL_HANDLE"}, From e84b8372f0418516dfe7169749eff8c59f2e7b5b Mon Sep 17 00:00:00 2001 From: Steve French Date: Sun, 17 Mar 2019 15:58:38 -0500 Subject: [PATCH] [SMB3] fix incorrect error code mapping for OBJECTID_NOT_FOUND It was mapped to EIO which can be confusing when user space queries for an object GUID for an object for which the server file system doesn't support (or hasn't saved one). As Amir Goldstein suggested this is similar to ENOATTR (equivalently ENODATA in Linux errno definitions) so changing NT STATUS code mapping for OBJECTID_NOT_FOUND to ENODATA. Signed-off-by: Steve French CC: Amir Goldstein --- fs/cifs/smb2maperror.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c index 924269cec135..e32c264e3adb 100644 --- a/fs/cifs/smb2maperror.c +++ b/fs/cifs/smb2maperror.c @@ -1036,7 +1036,8 @@ static const struct status_to_posix_error smb2_error_map_table[] = { {STATUS_UNFINISHED_CONTEXT_DELETED, -EIO, "STATUS_UNFINISHED_CONTEXT_DELETED"}, {STATUS_NO_TGT_REPLY, -EIO, "STATUS_NO_TGT_REPLY"}, - {STATUS_OBJECTID_NOT_FOUND, -EIO, "STATUS_OBJECTID_NOT_FOUND"}, + /* Note that ENOATTTR and ENODATA are the same errno */ + {STATUS_OBJECTID_NOT_FOUND, -ENODATA, "STATUS_OBJECTID_NOT_FOUND"}, {STATUS_NO_IP_ADDRESSES, -EIO, "STATUS_NO_IP_ADDRESSES"}, {STATUS_WRONG_CREDENTIAL_HANDLE, -EIO, "STATUS_WRONG_CREDENTIAL_HANDLE"}, -- 2.17.1