From patchwork Fri Oct 12 04:23:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ernesto_A=2E_Fern=C3=A1ndez?= X-Patchwork-Id: 10637847 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1122114E2 for ; Fri, 12 Oct 2018 04:23:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED15627F97 for ; Fri, 12 Oct 2018 04:23:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC62628066; Fri, 12 Oct 2018 04:23:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 926EA27F97 for ; Fri, 12 Oct 2018 04:23:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727042AbeJLLxo (ORCPT ); Fri, 12 Oct 2018 07:53:44 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:40390 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726725AbeJLLxn (ORCPT ); Fri, 12 Oct 2018 07:53:43 -0400 Received: by mail-qt1-f195.google.com with SMTP id b4-v6so12544177qtc.7 for ; Thu, 11 Oct 2018 21:23:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=xtzw7+ziB3Epj+vw2aVjhqytzBN5VsrmV2SZ0Q91F6E=; b=bN005J91Ia2n+HjPZCA01BcE1fiSTboU03f+H2DjmdQeh2ozAj+rv6yed49PxzVaYw yLBQowwcxuSHth5QFTMSHeBRKxhl5+c9RStjNPLzwjYlgJJNaWQksI3EMAyOK6bXaRZg t3Qeh/4I0ErWdmZOXhqZNhUGH7birStIeBbX43uSaVo3SMiJWJksqfUqumNkcfPKd5Bl sYRlaIuOrEPW6uGRS6X1lJwN4aNqAQ4dDd8NgjAusndq60dauNkYlIB+YwGFe70AmNiz P1wFR+ssEDC6sH+RzTbaj05uWzqQpJB7/r+BIEaJ5/q3yv9SHuXZ4tEeCigH/DUSIlVV uyxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=xtzw7+ziB3Epj+vw2aVjhqytzBN5VsrmV2SZ0Q91F6E=; b=q7+OMi2v6/5iePt3QWqLiInyZ7sSxRqllKrz0SYCjBFsK47s87EEqHmLvu0JX2kbT1 +AZYMyLq0nP4bMY+p0mhNZXdF6oywAFoYRz2UZLtxGHRy0B58KKR/4C7KX44pu1RtF0+ jt0o81V37ukECTTTKky9KQs8EGCKKnzEDa8vlRyddPIl5SHF/FAwJGTcXq7Bu6yliyZl wVddGaj6ogGkinMV6XFGhKaSc+Om0gqilDwzRwG5d9HJUukqfrrV5jk08mOqbeDFTt4R +64O9prFikFKnp4vep+41seKbn7Tf95F/kCgb0RM+Ph0RHTe+eVDCuobiyyjSlubmb0H wtfQ== X-Gm-Message-State: ABuFfoieKuU0W+bb0K8f4PyRNjsZnDddcqW8X4y9Mdu5GEIoEi7I8oNv pu3U3dRXFN4rS8oluMEhjj3yz41P X-Google-Smtp-Source: ACcGV62PgvJJkJi6skcXDeeed4WlhCOv0NxtwUyX03FWTc3ampA0X+QoSPk4A/iMpdS2dOZ0coI96A== X-Received: by 2002:ac8:7482:: with SMTP id v2-v6mr4333426qtq.251.1539318194953; Thu, 11 Oct 2018 21:23:14 -0700 (PDT) Received: from eaf ([181.47.179.0]) by smtp.gmail.com with ESMTPSA id p127-v6sm8363562qkd.70.2018.10.11.21.23.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Oct 2018 21:23:14 -0700 (PDT) Date: Fri, 12 Oct 2018 01:23:10 -0300 From: Ernesto =?utf-8?q?A=2E_Fern=C3=A1ndez?= To: linux-fsdevel@vger.kernel.org Cc: Andrew Morton Subject: [PATCH 2/2] hfs: update timestamp on truncate() Message-ID: References: <9beb0913eea37288599e8e1b7cec8768fb52d1b8.1539316825.git.ernesto.mnd.fernandez@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9beb0913eea37288599e8e1b7cec8768fb52d1b8.1539316825.git.ernesto.mnd.fernandez@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Vyacheslav Dubeyko --- 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);