From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f196.google.com ([209.85.214.196]:37789 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725926AbeJMFbw (ORCPT ); Sat, 13 Oct 2018 01:31:52 -0400 Received: by mail-pl1-f196.google.com with SMTP id u6-v6so3777013plz.4 for ; Fri, 12 Oct 2018 14:57:24 -0700 (PDT) Message-ID: <1539381441.3203.6.camel@slavad-ubuntu-14.04> Subject: Re: [PATCH 1/2] hfsplus: update timestamps 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:21 -0700 In-Reply-To: <9beb0913eea37288599e8e1b7cec8768fb52d1b8.1539316825.git.ernesto.mnd.fernandez@gmail.com> 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:22 -0300, Ernesto A. Fernández wrote: > 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. > > Signed-off-by: Ernesto A. Fernández > --- > fs/hfsplus/inode.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c > index 8e9427a42b81..d7ab9d8c4b67 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); Looks good. Reviewed-by: Vyacheslav Dubeyko Thanks, Vyacheslav Dubeyko.