From patchwork Fri Oct 12 04:22:12 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: 10637845 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 EF20A13AD for ; Fri, 12 Oct 2018 04:22:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2EF12BFEE for ; Fri, 12 Oct 2018 04:22:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C706F2C01E; Fri, 12 Oct 2018 04:22:22 +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 BB86B2BFEE for ; Fri, 12 Oct 2018 04:22:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726671AbeJLLwq (ORCPT ); Fri, 12 Oct 2018 07:52:46 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:46873 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726664AbeJLLwq (ORCPT ); Fri, 12 Oct 2018 07:52:46 -0400 Received: by mail-qt1-f195.google.com with SMTP id d8-v6so12537078qtk.13 for ; Thu, 11 Oct 2018 21:22:18 -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:mime-version:content-disposition :content-transfer-encoding; bh=+nbybJvx+JB+1hH23q0AwgervnD+aycxCNtFyfRvS9o=; b=Bssw28zyg5kLG4vhupH3y6kc4FoaiTDcYR4/NrA6Kse6nQSU/xiO/oTgDoJDoy9gFL XDwA3VC/VQgnKJRMPK6C466U6zuvMseHf7Ky/6xPfRvLEL/LfwhKLDM8UED0T3AugnBt LuVJaDA72/AiLZSL5Ag0DcmZLglrlZpLd3lbbDPNkDKBDDxdN5GHyIC/wAgUV5fVMPt9 nzWN4mMBdRT76bR5CydaQ44IZiPFfcjoitKwcqFOWb8hnX30yzsstjX1GW8JD8IGANmr 4IqaYDHx+dSZvXVBmzYy5qu7GwmHdpHO7bKxRGxWoyqmq8ho6l1jIvbBneESwKVlAgMf 2HaQ== 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:mime-version :content-disposition:content-transfer-encoding; bh=+nbybJvx+JB+1hH23q0AwgervnD+aycxCNtFyfRvS9o=; b=ReAwsU2O/suLHnMJXj4MucH9MiscelW6iDU6ZPxnRwQVBtV3/oT9DrR/JKjiBZLdwW Ozj8+5kPT19BuTme4sxzVwgK2fYufQGYjCzDF6VtDdIQJxeBiPaha43ERUkjcauxvGQx 9fmTXwk/OvYBV35nkDaNEZ2kt2bc7fulbftt9t/rdv91BYSWXHYykrgeO1rfpTAVzaXO LL+BDAUMLrOv9ybcifruH+wK6eUvMWz1d6S6xbPFLKfiiaZqH1iR0BBma992ZhyuICYa Hq9FSn3SIIUvoRKnA6eIHewBt9BF/562qolOktYM0fEbGKInn8M9ugUmBT4R+DACew4R hs6A== X-Gm-Message-State: ABuFfojxGn4j4IDnEZLTAQkHmTrDUzyHAc/AjOEPNfO3Wu9/3SFQX4I2 Fs5uMoXC5loIm39nakcKBxhuUma9 X-Google-Smtp-Source: ACcGV60MvbwIyHVtIw90SU3j0zSAnuNtpRYQwKdSWJtIH/uT1Kg++BIlVrHSM1RW4qyHrFBKg65eMw== X-Received: by 2002:a0c:f611:: with SMTP id r17-v6mr4430296qvm.242.1539318137515; Thu, 11 Oct 2018 21:22:17 -0700 (PDT) Received: from eaf ([181.47.179.0]) by smtp.gmail.com with ESMTPSA id d12-v6sm12470629qte.75.2018.10.11.21.22.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Oct 2018 21:22:16 -0700 (PDT) Date: Fri, 12 Oct 2018 01:22:12 -0300 From: Ernesto =?utf-8?q?A=2E_Fern=C3=A1ndez?= To: linux-fsdevel@vger.kernel.org Cc: Andrew Morton Subject: [PATCH 1/2] hfsplus: update timestamps on truncate() Message-ID: <9beb0913eea37288599e8e1b7cec8768fb52d1b8.1539316825.git.ernesto.mnd.fernandez@gmail.com> MIME-Version: 1.0 Content-Disposition: inline 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 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 Reviewed-by: Vyacheslav Dubeyko --- 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); 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);