linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Ernesto A. Fernández" <ernesto.mnd.fernandez@gmail.com>,
	"Vyacheslav Dubeyko" <slava@dubeyko.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Sasha Levin" <sashal@kernel.org>,
	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	[thread overview]
Message-ID: <20191116154113.7417-159-sashal@kernel.org> (raw)
In-Reply-To: <20191116154113.7417-1-sashal@kernel.org>

From: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>

[ 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 <ernesto.mnd.fernandez@gmail.com>
Reviewed-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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


  parent reply	other threads:[~2019-11-16 15:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191116154113.7417-1-sashal@kernel.org>
2019-11-16 15:39 ` [PATCH AUTOSEL 4.19 120/237] selftests: fix warning: "_GNU_SOURCE" redefined Sasha Levin
2019-11-16 15:39 ` [PATCH AUTOSEL 4.19 141/237] vfs: avoid problematic remapping requests into partial EOF block Sasha Levin
2019-11-16 15:39 ` [PATCH AUTOSEL 4.19 153/237] hfsplus: fix BUG on bnode parent update Sasha Levin
2019-11-16 15:39 ` [PATCH AUTOSEL 4.19 154/237] hfs: " Sasha Levin
2019-11-16 15:39 ` [PATCH AUTOSEL 4.19 155/237] hfsplus: prevent btree data loss on ENOSPC Sasha Levin
2019-11-16 15:39 ` [PATCH AUTOSEL 4.19 156/237] hfs: " Sasha Levin
2019-11-16 15:39 ` [PATCH AUTOSEL 4.19 157/237] hfsplus: fix return value of hfsplus_get_block() Sasha Levin
2019-11-16 15:39 ` [PATCH AUTOSEL 4.19 158/237] hfs: fix return value of hfs_get_block() Sasha Levin
2019-11-16 15:39 ` Sasha Levin [this message]
2019-11-16 15:39 ` [PATCH AUTOSEL 4.19 160/237] hfs: update timestamp on truncate() Sasha Levin
2019-11-16 15:39 ` [PATCH AUTOSEL 4.19 161/237] fs/hfs/extent.c: fix array out of bounds read of array extent Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191116154113.7417-159-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=ernesto.mnd.fernandez@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=slava@dubeyko.com \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).