Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1826124imm; Mon, 3 Sep 2018 10:25:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYrkq7AYcyPP2D+KpZQQVU3K7MksZERGL6sisadsU6Z3Y0ofGk0qopTzz3gxyl+Hj5gLc+b X-Received: by 2002:a63:c114:: with SMTP id w20-v6mr26357509pgf.234.1535995546709; Mon, 03 Sep 2018 10:25:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995546; cv=none; d=google.com; s=arc-20160816; b=amRydJYaNJIvQNsbFF/UqIHHfVF8BoRTdLOAzxexIHTbVyylBnAo/kD+P5Pr/a1Qc1 03ymoJbug+iNvvEVHbMEHD0hQ1kJiZ1k1JsY8z8kQhL2CnuKYi9K22AGYNoSmIc875JZ QSr9FIHARhYOzOopnHBN7DTWc6w0dzXSKyaIOuF+ZGkIvacFfsm2f2UnDA7P1mp/ZpxI dLTqUQf2xA76u5BQIX2OCtJ4ZcPFEec0FoqDdhM1+IMDmHgzaQCmp+NEL6j0m3S+BXri udcsS6zdiyuxM+tIDi1CeiT5H2ptPgs0HbF4/3WCYlh8QvACWhOeOP0D7V1Forck40yX c8qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=RtPpZm1JAIMdgVrl+2h0/+j6sIbeze4aAnCh9TW4xuQ=; b=lzZProJRh+n6ZnLxews/JfmfnFcPmlLzyxQCI+AsGrVFVn0Yc0enz5gSnTDZ+knQln QzlHWDMQRhEGUGBeVkhfWUutC8nSAmrdwapgkWLZp6fyKzUluhA+WGMoGUKIC+UfxGw8 Ku0rqrnHlvDn7AXtTpWH80G+gy80hAC/0jUOJPWVSxt80ynAAnvfoJk8mBCvwCpZHuUg JWJ+cZiacvKlDDIS55qrS9P7o3LM1wUvTm9f9fdBiYURfBNdZZ8NAy3T6qK6mhhAFsqB 3NF+9M1WOF+xvVNq3iFdjmG6G4w6vnCeP7uDKonH5r9FMu32cvk9jGOKPTrEdbyKUamD rXMg== ARC-Authentication-Results: i=1; mx.google.com; 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 j9-v6si5703547plk.153.2018.09.03.10.25.31; Mon, 03 Sep 2018 10:25:46 -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; 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 S1730435AbeICVnr (ORCPT + 99 others); Mon, 3 Sep 2018 17:43:47 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45342 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727783AbeICVnq (ORCPT ); Mon, 3 Sep 2018 17:43:46 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E90F3D2F; Mon, 3 Sep 2018 17:22:39 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Shilovsky , Stefan Metzmacher , Steve French Subject: [PATCH 4.14 087/165] smb3: Do not send SMB3 SET_INFO if nothing changed Date: Mon, 3 Sep 2018 18:56:13 +0200 Message-Id: <20180903165659.619930913@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Steve French commit fd09b7d3b352105f08b8e02f7afecf7e816380ef upstream. An earlier commit had a typo which prevented the optimization from working: commit 18dd8e1a65dd ("Do not send SMB3 SET_INFO request if nothing is changing") Thank you to Metze for noticing this. Also clear a reserved field in the FILE_BASIC_INFO struct we send that should be zero (all the other fields in that struct were set or cleared explicitly already in cifs_set_file_info). Reviewed-by: Pavel Shilovsky CC: Stable # 4.9.x+ Reported-by: Stefan Metzmacher Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/inode.c | 2 ++ fs/cifs/smb2inode.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1122,6 +1122,8 @@ cifs_set_file_info(struct inode *inode, if (!server->ops->set_file_info) return -ENOSYS; + info_buf.Pad = 0; + if (attrs->ia_valid & ATTR_ATIME) { set_time = true; info_buf.LastAccessTime = --- a/fs/cifs/smb2inode.c +++ b/fs/cifs/smb2inode.c @@ -267,7 +267,7 @@ smb2_set_file_info(struct inode *inode, int rc; if ((buf->CreationTime == 0) && (buf->LastAccessTime == 0) && - (buf->LastWriteTime == 0) && (buf->ChangeTime) && + (buf->LastWriteTime == 0) && (buf->ChangeTime == 0) && (buf->Attributes == 0)) return 0; /* would be a no op, no sense sending this */