From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f195.google.com ([209.85.214.195]:38338 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbeJMFc0 (ORCPT ); Sat, 13 Oct 2018 01:32:26 -0400 Received: by mail-pl1-f195.google.com with SMTP id q19-v6so3434551pll.5 for ; Fri, 12 Oct 2018 14:57:58 -0700 (PDT) Message-ID: <1539381475.3203.7.camel@slavad-ubuntu-14.04> Subject: Re: [PATCH 2/2] hfs: update timestamp on truncate() From: Viacheslav Dubeyko To: "Ernesto A." =?ISO-8859-1?Q?Fern=E1ndez?= Cc: linux-fsdevel@vger.kernel.org, Andrew Morton Date: Fri, 12 Oct 2018 14:57:55 -0700 In-Reply-To: References: <9beb0913eea37288599e8e1b7cec8768fb52d1b8.1539316825.git.ernesto.mnd.fernandez@gmail.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, 2018-10-12 at 01:23 -0300, Ernesto A. Fernández wrote: > The vfs takes care of updating mtime on ftruncate(), but on truncate() > it must be done by the module. > > Signed-off-by: Ernesto A. Fernández > --- > fs/hfs/inode.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c > index a2dfa1b2a89c..da243c84e93b 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); Looks good. Reviewed-by: Vyacheslav Dubeyko Thanks, Vyacheslav Dubeyko.