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 160/237] hfs: update timestamp on truncate()
Date: Sat, 16 Nov 2019 10:39:55 -0500 [thread overview]
Message-ID: <20191116154113.7417-160-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 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 <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/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
next prev parent reply other threads:[~2019-11-16 16:20 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 ` [PATCH AUTOSEL 4.19 159/237] hfsplus: update timestamps on truncate() Sasha Levin
2019-11-16 15:39 ` Sasha Levin [this message]
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-160-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).