Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1809201imm; Mon, 3 Sep 2018 10:00:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbqyQwstcswzhNVVZ5mXJ/ZQO7JMQfRH8txuXAsNr6m5awke6sxBesthpW89cpmY8v4Wyhn X-Received: by 2002:a17:902:7447:: with SMTP id e7-v6mr5076731plt.186.1535994049614; Mon, 03 Sep 2018 10:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535994049; cv=none; d=google.com; s=arc-20160816; b=Ire0KH7adfZMeihrfndT4XRBiQhTgDBeP1to31ZmanFPcrbtZhHrD2gBa7uvFo/CnP XO44/2BopKoo5EggP9VKeC0G7hkA0AJTc/g0jPrw+NjLQe7xLrqm423WUn6Ui2JtdVac q+tPh+3sRBW90EWyqvmWuRY6fxtOIryr6LETqZbhZWOngtC1fGYe5MgSHBtNpgcafOhz YBbL2+WnroRiJ50A9wchluZutobrCPNbPpCCB1yr8cDsz+nUmbsz8KQ93QRInuEW+vYv OydzjpbP4s3mAZLjY7cNB2F+fDDzKCsXqL236HkEQtdiaArZX5uFxEnTp1KL8VrGh/cX UBIA== 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=bUTadr5KoaQ+SGoQSg7pJH513rGXh6JaQvbtfLqHd+8=; b=h5+1t+MQuLNtbaP+ehLPf8TJ4bQ/dOaPr1BMD8IYz9mVHHWW4L2aNtJcfBr3Lm2q5E grv4YB3K3YKl4Q9u0352m8fYMEwnrfGSr18H9/cqWYBxUDzH42U22USc84j7vvputw51 KRBdY4zTfuzI3TL06TBLcSzpdlnrGTapUuH+Jv2RT56BK0hiAlwbPXDwjuSs2boCpz8b skVNJ8ThsM9dUh8oK4z5jbeYvbySbKji0tjU42NqopZdhDxsIGbWhXuzOX3qusIZUwyn 7xGJ7ewLPJmTf5bzs9UEpF9CXbrI8nxQrkleBDIpj7NDiqgipz1AazY6iQnLZgMg3g7J 17Nw== 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 o12-v6si18639435plg.487.2018.09.03.10.00.34; Mon, 03 Sep 2018 10:00:49 -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 S1728674AbeICVUK (ORCPT + 99 others); Mon, 3 Sep 2018 17:20:10 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38500 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727978AbeICVUI (ORCPT ); Mon, 3 Sep 2018 17:20:08 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1C779CFB; Mon, 3 Sep 2018 16:59:09 +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.4 43/80] smb3: Do not send SMB3 SET_INFO if nothing changed Date: Mon, 3 Sep 2018 18:49:21 +0200 Message-Id: <20180903164935.870280645@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903164934.171677301@linuxfoundation.org> References: <20180903164934.171677301@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.4-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 @@ -1063,6 +1063,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 */