Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp735964ybc; Sat, 16 Nov 2019 07:48:24 -0800 (PST) X-Google-Smtp-Source: APXvYqznDB90Y/q7sm+J6gdLfe9J1KaPsowcfpG9jTTP/DSO/W+iCC7KtOiE9qxm0QuTE99oYaUU X-Received: by 2002:a17:906:1c92:: with SMTP id g18mr10623027ejh.33.1573919304262; Sat, 16 Nov 2019 07:48:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573919304; cv=none; d=google.com; s=arc-20160816; b=JcYl+73IZTEDkfb115ahjGDzRjgJ0rMYapi/xtdNRRoHgiyHnxm3MM9SkC3I1a5sy/ FuaH5n3QJs0PxoveBDEYwQeCUUnWGelkaA3MTIj9nM0Dyst/Sqp3c4/65TmmL0fO6EIy VSdlpENakCaVsK5olHjzHTGNk9fzDoBqj/zNPrFua4neFIsa9yUrbyGSxu67bqFgOTe3 JiPoHnoh3HaT2Ox8keXqGVah8juAgH3lqwAqXfbHxdKFbIErrl3peedkHnOXrxY2rKh/ 986Isf/l5zPlH0VfEFrpgwAxk3NT3f8wCABSxl1y7+pIj5RDs/u2bYB5EsdosJNxx2S5 O2BA== 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=fIBou4HeHG+qr++dPdwTvQuefpdb/kWn3efTxJCfLxo=; b=csrgdpD924wrEPujtVMCp5ax4NY+D1ZvfO78v/PsVbj+U0SyLjyvRWKdmsO+uFQmxS NGm2eiuw9VqPGKn19/ej7fFMMVy8H+TpY9jxvZwykEA6HBntTLqiR2JbqMTW93XzyyQW uY9ePUSv8wXkoOEzQOEgG77mILEk7qIY5gaTcjEzylUMF54TWNT6h11wAeQnxVmM2hEW mc0LBCJYk0aVYTAdBO7P4AgRci1cd0ilks+Sne7zlrHVfIS0orGO8cXP/DWTPc3O8l5B Fmsx0QbaF1lMy3UxVWhypZ4FMp0bdUaNTQY0bCUdDsjsB79um4btwoCpcXCYChoWURKp JFgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OoE288NA; 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 c5si8989700edc.246.2019.11.16.07.47.59; Sat, 16 Nov 2019 07:48:24 -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=OoE288NA; 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 S1729192AbfKPPpg (ORCPT + 99 others); Sat, 16 Nov 2019 10:45:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:51156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728339AbfKPPpe (ORCPT ); Sat, 16 Nov 2019 10:45:34 -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 6602D20803; Sat, 16 Nov 2019 15:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919133; bh=W6T0qxVUQejosUr+bj/+5xttfCFxqDgrSuXmTQbWXog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OoE288NAWNTNd67ezOCW5ozavdxZC+p2qAZmAuqYqiRF00d1PfYHaU+J7/hNMObMs mwEHvC5qXE+zyTKT8AJk4zPkzrPcuaiYJgFk73vwX0vdc09tscxXhGeqJXNOgcBL05 ZFoOsKGXg36bKYzzcmWAYlmGUBqaFXbF1Kbn2JmE= 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 159/237] hfsplus: update timestamps on truncate() Date: Sat, 16 Nov 2019 10:39:54 -0500 Message-Id: <20191116154113.7417-159-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 dc8844aada735890a6de109bef327f5df36a982e ] The vfs takes care of updating ctime and mtime on ftruncate(), but on truncate() it must be done by the module. This patch can be tested with xfstests generic/313. Link: http://lkml.kernel.org/r/9beb0913eea37288599e8e1b7cec8768fb52d1b8.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/hfsplus/inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 8e9427a42b819..d7ab9d8c4b674 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -261,6 +261,7 @@ static int hfsplus_setattr(struct dentry *dentry, struct iattr *attr) } truncate_setsize(inode, attr->ia_size); hfsplus_file_truncate(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); } setattr_copy(inode, attr); -- 2.20.1