From patchwork Tue Aug 19 03:33:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 4739941 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 B21E4C0338 for ; Tue, 19 Aug 2014 03:33:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB81620120 for ; Tue, 19 Aug 2014 03:33:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BEAD20108 for ; Tue, 19 Aug 2014 03:33:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752173AbaHSDd2 (ORCPT ); Mon, 18 Aug 2014 23:33:28 -0400 Received: from mail-qc0-f170.google.com ([209.85.216.170]:55638 "EHLO mail-qc0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751880AbaHSDd2 (ORCPT ); Mon, 18 Aug 2014 23:33:28 -0400 Received: by mail-qc0-f170.google.com with SMTP id x3so5771019qcv.15 for ; Mon, 18 Aug 2014 20:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc:content-type; bh=DI4lAZVkh0htPFv4FVGBKkjBHAnIneUzdh7nUm3/Nwk=; b=f9PSOJDDHDFbs8ioX85Lo5t4PTij9udq4Ww3hQaBjtwQ0kCARtpq0UP73qPsR/aQTk 7CMOCwJiMYfyWIU40Yx2+7n4G8vg5DLm+FqwmFngn7dm1fWvQoE02aq2ZYDXcAmhMc7P YmQ75iB+n59G8hkkIeCMbs9FJunw+XW08Q2u51SO/LrlEBygNe/MJmISXWfbtUBAMReg q0H0I0GPrtsb6+LwHrZyPzj6k+UwmEKKfToqgdNl5ATANumbqmajPnjXaTGOCjHHk1qo QBnG3g54vzoBRUaLYhLTk2afh1eLIY8KmkLek6CtSlOZiu2ttf7dhv9pUYZXqbb1wISn jWdg== X-Received: by 10.229.140.70 with SMTP id h6mr62915297qcu.3.1408419207019; Mon, 18 Aug 2014 20:33:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.101.107 with HTTP; Mon, 18 Aug 2014 20:33:06 -0700 (PDT) From: Steve French Date: Mon, 18 Aug 2014 22:33:06 -0500 Message-ID: Subject: [PATCH] [CIFS] Incorrect error returned on setting file compressed on SMB2 To: "linux-cifs@vger.kernel.org" Cc: David Disseldorp Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 When the server (for an SMB2 or SMB3 mount) doesn't support an ioctl (such as setting the compressed flag on a file) we were incorrectly returning EIO instead of EOPNOTSUPP, this is confusing e.g. doing chattr +c to a file on a non-btrfs Samba partition, now the error returned is more intuitive to the user. Signed-off-by: Steve French Reviewed-by: David Disseldorp --- fs/cifs/smb2maperror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) {STATUS_WRONG_VOLUME, -EIO, "STATUS_WRONG_VOLUME"}, {STATUS_NO_MEDIA_IN_DEVICE, -EIO, "STATUS_NO_MEDIA_IN_DEVICE"}, diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c index a689514..af59d03 100644 --- a/fs/cifs/smb2maperror.c +++ b/fs/cifs/smb2maperror.c @@ -298,7 +298,7 @@ static const struct status_to_posix_error smb2_error_map_table[] = { {STATUS_INVALID_PARAMETER, -EINVAL, "STATUS_INVALID_PARAMETER"}, {STATUS_NO_SUCH_DEVICE, -ENODEV, "STATUS_NO_SUCH_DEVICE"}, {STATUS_NO_SUCH_FILE, -ENOENT, "STATUS_NO_SUCH_FILE"}, - {STATUS_INVALID_DEVICE_REQUEST, -EIO, "STATUS_INVALID_DEVICE_REQUEST"}, + {STATUS_INVALID_DEVICE_REQUEST, -EOPNOTSUPP, "STATUS_INVALID_DEVICE_REQUEST"}, {STATUS_END_OF_FILE, -ENODATA, "STATUS_END_OF_FILE"},