Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp889590yba; Thu, 18 Apr 2019 11:15:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzp6nbNwltFHgoi8HSyfT8HqDxlxm7xo5tu43sPcnHIsbtf6+AouD6iESkXDjQEC2zhjjQt X-Received: by 2002:a63:1749:: with SMTP id 9mr86573675pgx.94.1555611353507; Thu, 18 Apr 2019 11:15:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611353; cv=none; d=google.com; s=arc-20160816; b=GQXvZRvivO9QsEIMlupiL3Mnq9BlafY+E+1H3TYzLX4Su5ltdiQPi2oRxxjhxDYrBt u//UHMoM4kr3qP4hAlLYrCLpsvDNQ/fIH+czrBR9026i27zpFzdm1rxdAf+MBn2Tihc1 CsV87azY3s57XuLLPGhIHnqAPLG7Y0frgLRYYbhTFo+QErFma7DQQAi7kENZHe3wab2W r3rHp0echxbwFU6+4RFm8Ou+nCOvcm5NA2tKmWjyxbCstk2YLN3MjBlzlfz9b117ohO/ 23sxxZH/ucAMtV0UPjmLm01YjXVE4zTBlh0XE+Bgh+pQpdgOYfA42M5swpwfkro3N1gT 9klQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j6qDIvHsl8atHxfjIif6NeWWVPolny8LhqXlvYQR/uI=; b=Hg8ua5FFM+0B6HBNKUXvc11SK7lYFs13auI1mkJGev+U0J7BF28njqsB9g9Jnps+54 wT3Iq2yz6Kf8iFFjlqAPHHSSDCpAVx72LALkMkb32UlnJ1HRYebo41ty8RFs9t1X7dxC KxTbkkk+G86d8s+ui3BI033TayLADem9cho/j1Jh+S7YuGavKjKu7vZ+C8f1cvZBV/Cy fmFOfYwSAALim0AkgZLLVWMYQtNJs7DCmnjcudW8ryQdMo0/b69oriSUW8UgyShpaBiE v2tVnUqA/b6JsegARRxj/IytHgJNfBrf9zbaLDFTD4eF/OhyDrJp14Dl8kjSb95znl4b 4Gew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sKTjsOy6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r75si3012690pfa.10.2019.04.18.11.15.38; Thu, 18 Apr 2019 11:15:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sKTjsOy6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404378AbfDRSMy (ORCPT + 99 others); Thu, 18 Apr 2019 14:12:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:45462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403922AbfDRSMv (ORCPT ); Thu, 18 Apr 2019 14:12:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6D9FD214DA; Thu, 18 Apr 2019 18:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611170; bh=dui8KX3fwPvVDl/wtpe2ctjt8UNwrLJT3KkQ8ekNWWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sKTjsOy6vfJkuu1HCLRVFj7glK/3e5mQjoZvuR25yrjvjA1SZD8P/JAbJbY0rVlth uweGX1/EQsSiGxu1cdYvhH3yJPOSLmJQM3xYjd318jAaYH+9Yzo2Y0s9gE4baCy0HA AgMwnTmmJwKMAoGByzg/w7EKTplxaEJbZiFvdhHw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ronnie Sahlberg , Steve French , Sasha Levin Subject: [PATCH 5.0 85/93] cifs: return -ENODATA when deleting an xattr that does not exist Date: Thu, 18 Apr 2019 19:58:03 +0200 Message-Id: <20190418160445.470178035@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 2109464184919f81efd593b4008291448c522815 ] BUGZILLA: https://bugzilla.kernel.org/show_bug.cgi?id=202007 When deleting an xattr/EA: SMB2/3 servers will return SUCCESS when clients delete non-existing EAs. This means that we need to first QUERY the server and check if the EA exists or not so that we can return -ENODATA correctly when this happens. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/smb2ops.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index b29f711ab965..ea56b1cdbdde 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -949,6 +949,16 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, resp_buftype[0] = resp_buftype[1] = resp_buftype[2] = CIFS_NO_BUFFER; memset(rsp_iov, 0, sizeof(rsp_iov)); + if (ses->server->ops->query_all_EAs) { + if (!ea_value) { + rc = ses->server->ops->query_all_EAs(xid, tcon, path, + ea_name, NULL, 0, + cifs_sb); + if (rc == -ENODATA) + goto sea_exit; + } + } + /* Open */ memset(&open_iov, 0, sizeof(open_iov)); rqst[0].rq_iov = open_iov; -- 2.19.1