From patchwork Thu Sep 28 11:03:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13402804 X-Patchwork-Delegate: paul@paul-moore.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CDA8E732C5 for ; Thu, 28 Sep 2023 11:23:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232197AbjI1LXs (ORCPT ); Thu, 28 Sep 2023 07:23:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232252AbjI1LXd (ORCPT ); Thu, 28 Sep 2023 07:23:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1DB719A1; Thu, 28 Sep 2023 04:05:53 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E2E7C433C7; Thu, 28 Sep 2023 11:05:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899152; bh=C22B2g/SgAvtHDu6LBtQOcUovQ/o8sJV/B6h/lwEOZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tjVSq0VZ9ZixOCI2LTExv2W1XKrvAXkOB2Akc8mYQZ0QsZj6zFfAFu4f44fI5smx2 qVmZec5FxZblIMmCz0iirOtVMnDEslnixfZ83anyEbHDpve/zrwAIzyUu4DErJXVf6 cNU+yQv2tiT7PgwOKjcBQzsKqOmdjqP+sgm41tk7Usx26UlA6L4oczEmiAlJN94efa yFEuaF9fh9J3LFmffxpG35OtWDN/lVsY7/YgAOitiB9DdYYHwWCIxpMjxkxooBTS0r GgIxU1tFqix6FO+0RxpUrmDN2p7k4Y2C6M3oSEwGwc4TyF09qfkEe4TLwFTfvgdR63 rhHX3YTFl4VCQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org Subject: [PATCH 82/87] security/apparmor: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:31 -0400 Message-ID: <20230928110413.33032-81-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: Signed-off-by: Jeff Layton --- security/apparmor/apparmorfs.c | 7 ++++--- security/apparmor/policy_unpack.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index bd6a910f6528..53a0070ff5df 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -226,7 +226,7 @@ static int __aafs_setup_d_inode(struct inode *dir, struct dentry *dentry, inode->i_ino = get_next_ino(); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = iops ? iops : &simple_dir_inode_operations; @@ -1557,7 +1557,8 @@ void __aafs_profile_migrate_dents(struct aa_profile *old, if (new->dents[i]) { struct inode *inode = d_inode(new->dents[i]); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_current(inode)); } old->dents[i] = NULL; } @@ -2543,7 +2544,7 @@ static int aa_mk_null_file(struct dentry *parent) inode->i_ino = get_next_ino(); inode->i_mode = S_IFCHR | S_IRUGO | S_IWUGO; - inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); + simple_inode_init_ts(inode); init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, MKDEV(MEM_MAJOR, 3)); d_instantiate(dentry, inode); diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index 8b8846073e14..913ec8d0eb63 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -89,10 +89,10 @@ void __aa_loaddata_update(struct aa_loaddata *data, long revision) struct inode *inode; inode = d_inode(data->dents[AAFS_LOADDATA_DIR]); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); inode = d_inode(data->dents[AAFS_LOADDATA_REVISION]); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); } }