From patchwork Fri Jul 18 14:50:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 4585491 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 01429C0514 for ; Fri, 18 Jul 2014 14:50:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C9B92010C for ; Fri, 18 Jul 2014 14:50:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0427200DB for ; Fri, 18 Jul 2014 14:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756773AbaGROue (ORCPT ); Fri, 18 Jul 2014 10:50:34 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:53658 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756362AbaGROud (ORCPT ); Fri, 18 Jul 2014 10:50:33 -0400 Received: by mail-lb0-f176.google.com with SMTP id u10so2638800lbd.7 for ; Fri, 18 Jul 2014 07:50:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=USfEzuq1o238Of6nhP+VbzLiQ62OIu8jyq80AsR91r8=; b=Wrs2Rqb5whi9IuSIXxlqqX9mpQoCEt+5+Q6PZsG6/GErF8s4NWznBjInY6dSDVBUSe H6a9OOaGNm1pvyaTHeFSJuB7VkdrEk+Ean89bd3+2BbPw/PSW5pW840tJ0fI7QzGS8Zj 6v2LQU1SGD9NkXHfdg9tmLBOWii894jAxAe6RItU04JgfkfJPiT83fSGWNf0/qHYsZ0+ PIgFommxBPccw8pmsfO13EMMBbZEWa7wc3ZUG7SjVQPAqGSb4jnW5n1c7WKnTWj4qNDi tvTLSyVdza+XOlHRYTAiqjCPFXtK7FZQ3BWXzx7joMP4ACeKq5HySOgxOT92p1xGHsa8 lbTg== X-Received: by 10.152.4.73 with SMTP id i9mr5865509lai.50.1405695031745; Fri, 18 Jul 2014 07:50:31 -0700 (PDT) Received: from localhost.localdomain ([92.43.3.29]) by mx.google.com with ESMTPSA id vu1sm9681848lbb.41.2014.07.18.07.50.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jul 2014 07:50:30 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH] CIFS: Fix STATUS_CANNOT_DELETE error mapping for SMB2 Date: Fri, 18 Jul 2014 18:50:22 +0400 Message-Id: <1405695022-2934-1-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.8.1.2 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 The existing mapping causes unlink() call to return error after delete operation. Changing the mapping to -EACCESS makes the client process the call like CIFS protocol does - reset dos attributes with ATTR_READONLY flag masked off and retry the operation. Cc: stable@vger.kernel.org Signed-off-by: Pavel Shilovsky --- fs/cifs/smb2maperror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c index 94bd4fb..e31a9df 100644 --- a/fs/cifs/smb2maperror.c +++ b/fs/cifs/smb2maperror.c @@ -605,7 +605,7 @@ static const struct status_to_posix_error smb2_error_map_table[] = { {STATUS_MAPPED_FILE_SIZE_ZERO, -EIO, "STATUS_MAPPED_FILE_SIZE_ZERO"}, {STATUS_TOO_MANY_OPENED_FILES, -EMFILE, "STATUS_TOO_MANY_OPENED_FILES"}, {STATUS_CANCELLED, -EIO, "STATUS_CANCELLED"}, - {STATUS_CANNOT_DELETE, -EIO, "STATUS_CANNOT_DELETE"}, + {STATUS_CANNOT_DELETE, -EACCES, "STATUS_CANNOT_DELETE"}, {STATUS_INVALID_COMPUTER_NAME, -EIO, "STATUS_INVALID_COMPUTER_NAME"}, {STATUS_FILE_DELETED, -EIO, "STATUS_FILE_DELETED"}, {STATUS_SPECIAL_ACCOUNT, -EIO, "STATUS_SPECIAL_ACCOUNT"},