Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp737832ybc; Sat, 16 Nov 2019 07:50:36 -0800 (PST) X-Google-Smtp-Source: APXvYqze60S2bsiEytlyqJgD/sFepDVrznzyT6nrFerE74/QZyHUUcQzcWwb5+dij0QZIHCKb0NM X-Received: by 2002:a17:907:426e:: with SMTP id nx22mr10312965ejb.139.1573919436509; Sat, 16 Nov 2019 07:50:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573919436; cv=none; d=google.com; s=arc-20160816; b=VU6MhGgic86gFJGJ1fRR6zTLilhgvpYGfAcN3L0jZIiqhTzYuUOKn70V2d8SavBt1P 9dSlwXoSi+ufm+aoVjIhUemC2w80se3SvW/Avp8rZ/kMCHwDg2nensqYx96SkXwjD5iQ emY+clFgYEcqjzqnAoggfH5U2rg2K1fJqPTZcYs23zbzzr2FNLMQzzpJdAn3dnbQAzXl fH54eoZHzAYnetiTTu4lVTMynq7P3xoR6EmVw5Os+2lL6KcDC2urZoV7HQZD2PvnZ3up p4VTGALgtiCELGksxtJ1rQUoRO4lYgOwVFkuTbSBSve0qv4azTAjbgxkC7gT6IV0smMV +nFg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MzJawq8KYqqB/uqtw01OYtOuK1nIWlVHwlVIG0pHdoM=; b=ps4FfSQrt9SWpPZ8JBDxDqHr8HBlyDphO+yeYDNFl/NqqRrMlOPaC17akd537IgIZY NHUeQbSZbeI5Em3nFNjADTLg2wi5HG9LCeW3UVUcNO3gujUfO9zNA4CUqUOKM/2nMADf TzKiBNdpgCyuWuPbmJ3kmAOkR2vyCmTRiH4nwsMiVrJAuE9+399S1Ztt7oHLUhRq0/ib rVUVIflHwjvF3PabNSszgTG+kJiTdrKOVPY5Hb+Hc+ot1LKYWp9SkuDEbaZpL05H4tAv jcc09nsISAsDcIaJ9bpQLbKrVtAi/bGmmpg2NzlpGZDe+xYapuFQ8kkg4vUVcrxzidvE Q4pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jcsCd2nC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13si8252101eja.112.2019.11.16.07.50.11; Sat, 16 Nov 2019 07:50:36 -0800 (PST) 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=jcsCd2nC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729196AbfKPPpk (ORCPT + 99 others); Sat, 16 Nov 2019 10:45:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:51236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729193AbfKPPph (ORCPT ); Sat, 16 Nov 2019 10:45:37 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6379C20803; Sat, 16 Nov 2019 15:45:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919136; bh=EQZ7mfCriInnZRn9UMpQSDdMM3ZNFHm+aa73nZvvwtU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jcsCd2nCGCmj6jlLPaXo77aG6naZj9HT1pLLqYucqKX+t4jmyGpQQgrZjuUDUU75b 1UO/aHmkdDqGgG4JYUNjYL96EFAj1CJqYid5yLjX8bpWZCQdRM3v1NpaKHI7zn2FLr 5T0nK2W4k2sZayNIpknswcoIQ2esl5loHVwfKiac= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Ernesto=20A=2E=20Fern=C3=A1ndez?= , Vyacheslav Dubeyko , Andrew Morton , Linus Torvalds , Sasha Levin , linux-fsdevel@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 160/237] hfs: update timestamp on truncate() Date: Sat, 16 Nov 2019 10:39:55 -0500 Message-Id: <20191116154113.7417-160-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ernesto A. Fernández [ Upstream commit 8cd3cb5061730af085a3f9890a3352f162b4e20c ] The vfs takes care of updating mtime on ftruncate(), but on truncate() it must be done by the module. Link: http://lkml.kernel.org/r/e1611eda2985b672ed2d8677350b4ad8c2d07e8a.1539316825.git.ernesto.mnd.fernandez@gmail.com Signed-off-by: Ernesto A. Fernández Reviewed-by: Vyacheslav Dubeyko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- fs/hfs/inode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index a2dfa1b2a89c7..da243c84e93b0 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c @@ -642,6 +642,8 @@ int hfs_inode_setattr(struct dentry *dentry, struct iattr * attr) truncate_setsize(inode, attr->ia_size); hfs_file_truncate(inode); + inode->i_atime = inode->i_mtime = inode->i_ctime = + current_time(inode); } setattr_copy(inode, attr); -- 2.20.1